//Method to insert checklist public bool Insert_Checklist(string itemID, string item, string procedureOwner, string status, string contractID) { SqlCommand cmd_checklist = new SqlCommand(); cmd_checklist.CommandText = "[VRM].[INSERT_Checklist]"; cmd_checklist.CommandType = CommandType.StoredProcedure; cmd_checklist.Parameters.Clear(); SqlParameter sqlParaItemID = new SqlParameter("@itemID", SqlDbType.VarChar, 10); sqlParaItemID.Value = itemID; cmd_checklist.Parameters.Add(sqlParaItemID); SqlParameter sqlParaItem = new SqlParameter("@item", SqlDbType.VarChar, 20); sqlParaItem.Value = item; cmd_checklist.Parameters.Add(sqlParaItem); SqlParameter sqlParaProcedureOwner = new SqlParameter("@procedureOwner", SqlDbType.VarChar, 30); sqlParaProcedureOwner.Value = procedureOwner; cmd_checklist.Parameters.Add(sqlParaProcedureOwner); SqlParameter sqlParaStatus = new SqlParameter("@status", SqlDbType.VarChar, 10); sqlParaStatus.Value = status; cmd_checklist.Parameters.Add(sqlParaStatus); SqlParameter sqlParaContractID = new SqlParameter("@contractID", SqlDbType.VarChar, 10); sqlParaContractID.Value = contractID; cmd_checklist.Parameters.Add(sqlParaContractID); return executeNotQuery(cmd_checklist); }
ALTER PROCEDURE [VRM].[INSERT_Checklist] ( @itemID varchar(10), @item varchar(20), @procedureOwner varchar(30), @status varchar(10), @contractID varchar(10) ) AS BEGIN INSERT INTO VRM.Checklist VALUES(@itemID, @item , @procedureOwner, @status , @contractID) END
protected void gvChecklist_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.Footer) { DropDownList cmbStatus = (DropDownList)e.Row.FindControl("cmbStatus"); cmbStatus.DataSource = vrmdb.Get_Status(); cmbStatus.DataBind(); } }