protected void GridViewItem_RowUpdating(object sender, GridViewUpdateEventArgs e) { GridViewRow row = GridViewItem.Rows[e.RowIndex]; Label lblID = (Label)row.FindControl("lblID"); // Label lblID = (Label)row.FindControl("Label1"); int ID = Convert.ToInt32(lblID.Text); TextBox txtTergetQty = ((TextBox)row.FindControl("txtTergetQty")); TextBox txtSchedule_Date = ((TextBox)row.FindControl("txtSchedule_Date")); DropDownList ddlStatus = ((DropDownList)row.FindControl("ddlStatus")); DropDownList ddlResposiblePerson = ((DropDownList)row.FindControl("ddlResposiblePerson")); TextBox txtComments = ((TextBox)row.FindControl("txtComments")); TextBox txtTergetLine = ((TextBox)row.FindControl("txtTergetLine")); Label lblDailyProduction = ((Label)row.FindControl("lblDailyProduction")); LC_ProductionDetails _LC_ProductionDetails = new LC_ProductionDetails(); _LC_ProductionDetails.Order_No = txtOrder.Text; DateTime?nullabledate = null; _LC_ProductionDetails.Schedule_Date = txtSchedule_Date.Text == "" ? nullabledate : Convert.ToDateTime(txtSchedule_Date.Text); _LC_ProductionDetails.Responsible_Person = ddlResposiblePerson.SelectedValue; _LC_ProductionDetails.Status = ddlStatus.SelectedValue; _LC_ProductionDetails.TergetQty = Convert.ToDecimal(txtTergetQty.Text); _LC_ProductionDetails.TergetLine = Convert.ToDouble(txtTergetLine.Text); if (lblDailyProduction.Text == "") { _LC_ProductionDetails.DailyProduction = 0; } else { _LC_ProductionDetails.DailyProduction = Convert.ToDouble(lblDailyProduction.Text); } _LC_ProductionDetails.Comments = txtComments.Text; _LC_ProductionDetails.EditDate = DateTime.Today; _LC_ProductionDetails.EditUser = ((SessionUser)Session["SessionUser"]).UserId; _LC_ProductionDetails.OCode = ((SessionUser)Session["SessionUser"]).OCode; int result1 = masterBLL.UpdateProductionProcess(_LC_ProductionDetails, ID); if (result1 == 1) { GridViewItem.EditIndex = -1; LoadProductionProccess(); ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Data Updated Successfully')", true); } }
protected void btnUpdate_Click(object sender, EventArgs e) { try { foreach (GridViewRow gvRow in GridViewItem.Rows) { CheckBox rowChkBox = ((CheckBox)gvRow.FindControl("rowPlanCheckBox")); if (rowChkBox.Checked == true) { Label lblInput_Name = ((Label)gvRow.FindControl("lblInput_Name")); TextBox txtTergettxtQty = ((TextBox)gvRow.FindControl("txtTergettxtQty")); TextBox ScheduleDate = ((TextBox)gvRow.FindControl("txtScheduleDate")); DropDownList ddlStatus = ((DropDownList)gvRow.FindControl("ddlstatus")); DropDownList ddlResponsiblePerson = ((DropDownList)gvRow.FindControl("ddlResponsiblePerson")); TextBox txtComent = ((TextBox)gvRow.FindControl("txtComments")); //Label lblWorkingDay = ((Label)gvRow.FindControl("lblWorkingDay")); LC_ProductionDetails _LC_ProductionDetails = new LC_ProductionDetails(); _LC_ProductionDetails.ProductionProcess = lblInput_Name.Text; _LC_ProductionDetails.Order_No = txtOrder.Text; _LC_ProductionDetails.Schedule_Date = Convert.ToDateTime(ScheduleDate.Text); _LC_ProductionDetails.Responsible_Person = ddlResponsiblePerson.Text; _LC_ProductionDetails.Status = ddlStatus.Text; _LC_ProductionDetails.TergetQty = Convert.ToDecimal(txtTergettxtQty.Text); _LC_ProductionDetails.EditDate = DateTime.Today; _LC_ProductionDetails.EditUser = ((SessionUser)Session["SessionUser"]).UserId; _LC_ProductionDetails.Create_Date = DateTime.Today; _LC_ProductionDetails.Create_User = ((SessionUser)Session["SessionUser"]).UserId; _LC_ProductionDetails.OCode = ((SessionUser)Session["SessionUser"]).OCode; int result1 = masterBLL.InsertProductionProcces(_LC_ProductionDetails); } } lblMessageUpdate.Text = "Data Update Successfully"; //ScriptManager.RegisterStartupScript(this.Page, Page.GetType(), "text", "func('Data Updated Successfully')", true); } catch (Exception ex) { throw ex; } }
private void InsertProductionProcess() { try { bool isOrderExist = masterBLL.isOrderExist(txtOrder.Text); if (isOrderExist != true) { string OCode = Convert.ToString(((SessionUser)Session["SessionUser"]).OCode); List <LC_InputType> InputType = inputTypeBll.GetALLProductionProcess(OCode); if (InputType.Count > 0) { foreach (var item in InputType) { //Label lblWorkingDay = ((Label)gvRow.FindControl("lblWorkingDay")); LC_ProductionDetails _LC_ProductionDetails = new LC_ProductionDetails(); _LC_ProductionDetails.ProductionProcess = item.Input_Name; _LC_ProductionDetails.Order_No = txtOrder.Text; _LC_ProductionDetails.Schedule_Date = null; _LC_ProductionDetails.Responsible_Person = null; _LC_ProductionDetails.Status = "Pending"; _LC_ProductionDetails.TergetQty = Convert.ToDecimal(0); _LC_ProductionDetails.EditDate = DateTime.Today; _LC_ProductionDetails.EditUser = ((SessionUser)Session["SessionUser"]).UserId; _LC_ProductionDetails.Create_Date = DateTime.Today; _LC_ProductionDetails.Create_User = ((SessionUser)Session["SessionUser"]).UserId; _LC_ProductionDetails.OCode = ((SessionUser)Session["SessionUser"]).OCode; int result1 = masterBLL.InsertProductionProcces(_LC_ProductionDetails); } } } } catch (Exception ex) { throw ex; } }
internal int UpdateProductionProcess(LC_ProductionDetails _LC_ProductionDetails, int ID) { return(_masterlcDAL.UpdateProductionProcess(_LC_ProductionDetails, ID)); }
internal int InsertProductionProcces(LC_ProductionDetails _LC_ProductionDetails) { return(_masterlcDAL.InsertProductionProcces(_LC_ProductionDetails)); }