protected void btnUpdateProductindetail_Click(object sender, EventArgs e) { stdmdata = new MStandardization(); stdbdata = new BStandardization(); int Result = 0; stdmdata.RMRId = string.IsNullOrEmpty(hId.Value) ? 0 : Convert.ToInt32(hId.Value); stdmdata.StandardDate = DateTime.Now.ToString(); stdmdata.StdShiftId = Convert.ToInt32(dpShiftDetails.SelectedItem.Value); stdmdata.SiloNo = string.IsNullOrEmpty(txtSiloNo.Text) ? string.Empty : txtSiloNo.Text; stdmdata.RCMQuantity = string.IsNullOrEmpty(txtRCMQty.Text) ? 0 : Convert.ToDouble(txtRCMQty.Text); stdmdata.StandardizationStartTime = txtStandardizationStartTime.Text; stdmdata.StandardizationEndTime = txtStandardizationEndTime.Text; stdmdata.CuttingMilkQuantity = string.IsNullOrEmpty(txtCuttingMilkQuantity.Text) ? 0 : Convert.ToDouble(txtCuttingMilkQuantity.Text); stdmdata.CuttingMilkFAT = string.IsNullOrEmpty(txtCuttingMilkFat.Text) ? 0 : Convert.ToDouble(txtCuttingMilkFat.Text); stdmdata.CuttingMilkSNF = string.IsNullOrEmpty(txtCuttingMilkSnf.Text) ? 0 : Convert.ToDouble(txtCuttingMilkSnf.Text); stdmdata.Skim = string.IsNullOrEmpty(txtSkim.Text) ? 0 : Convert.ToDouble(txtSkim.Text); stdmdata.SkimFAT = string.IsNullOrEmpty(txtSkimFat.Text) ? 0 : Convert.ToDouble(txtSkimFat.Text); stdmdata.SkimSNF = string.IsNullOrEmpty(txtSkimSnf.Text) ? 0 : Convert.ToDouble(txtSkimSnf.Text); stdmdata.RCM = string.IsNullOrEmpty(txtRcm.Text) ? 0 : Convert.ToDouble(txtRcm.Text); stdmdata.SMP = string.IsNullOrEmpty(txtRcm.Text) ? 0 : Convert.ToDouble(txtRcm.Text); stdmdata.CreamAdd = string.IsNullOrEmpty(txtCreamAdd.Text) ? 0 : Convert.ToDouble(txtCreamAdd.Text); stdmdata.CreamProduced = string.IsNullOrEmpty(txtCreamAdd.Text) ? 0 : Convert.ToDouble(txtCreamAdd.Text); stdmdata.Remarks = txtRemarks.Text; stdmdata.StandardizationStatusId = Convert.ToInt32(dpStandardDone.SelectedItem.Value); //stdmdata.Custom1 = txtCustom1.Text; //stdmdata.Custom2 = txtCustom2.Text; //stdmdata.Custom3 = txtCustom3.Text; //stdmdata.Custom4 = txtCustom4.Text; //stdmdata.Custom5 = txtCustom5.Text; stdmdata.flag = "Update"; Result = stdbdata.StandardizationData(stdmdata); if (Result > 0) { divDanger.Visible = false; divwarning.Visible = false; divSusccess.Visible = true; lblSuccess.Text = "Data Updated Successfully"; ScriptManager.RegisterStartupScript(this, this.GetType(), "sel3", "$('#bx1').addClass('collapsed-box');", true); pnlError.Update(); //string dates; //dates = string.IsNullOrEmpty(txtSearchDate.Text) ? string.Empty : Convert.ToDateTime(txtSearchDate.Text).ToString("dd-MM-yyyy"); RMRecieve R = new RMRecieve(); R.RMRDate = Convert.ToDateTime(txtSearchDate.Text); GetStandardizationDetails(R); uprouteList.Update(); // ClearTextbox(); } else { divDanger.Visible = false; divwarning.Visible = true; divSusccess.Visible = false; lblSuccess.Text = "Something went wrong plz contact site admin"; pnlError.Update(); } }
protected void btnAddProductionInfo_Click(object sender, EventArgs e) { stdmdata = new MStandardization(); stdbdata = new BStandardization(); int Result = 0; stdmdata.StdId = 0; stdmdata.RMRId = string.IsNullOrEmpty(hId.Value) ? 0 : Convert.ToInt32(hId.Value); foreach (RepeaterItem item in rpStandardizationList.Items) { HiddenField hdfID = item.FindControl("hfQualityId") as HiddenField; if (hdfID != null) { stdmdata.QualityId = string.IsNullOrEmpty(hdfID.Value) ? 0 : Convert.ToInt32(hdfID.Value); } } stdmdata.StandardDate = DateTime.Now.ToString(); stdmdata.StdShiftId = Convert.ToInt32(dpShiftDetails.SelectedItem.Value); stdmdata.SiloNo = string.IsNullOrEmpty(txtSiloNo.Text) ? string.Empty : txtSiloNo.Text; stdmdata.RCMQuantity = string.IsNullOrEmpty(txtRCMQty.Text) ? 0 : Convert.ToDouble(txtRCMQty.Text); stdmdata.StandardizationStartTime = string.IsNullOrEmpty(txtStandardizationStartTime.Text) ? string.Empty : txtStandardizationStartTime.Text; stdmdata.StandardizationEndTime = string.IsNullOrEmpty(txtStandardizationEndTime.Text) ? string.Empty : txtStandardizationEndTime.Text; stdmdata.CuttingMilkQuantity = string.IsNullOrEmpty(txtCuttingMilkQuantity.Text) ? 0 : Convert.ToDouble(txtCuttingMilkQuantity.Text); stdmdata.CuttingMilkFAT = string.IsNullOrEmpty(txtCuttingMilkFat.Text) ? 0 : Convert.ToDouble(txtCuttingMilkFat.Text); stdmdata.CuttingMilkSNF = string.IsNullOrEmpty(txtCuttingMilkSnf.Text) ? 0 : Convert.ToDouble(txtCuttingMilkSnf.Text); stdmdata.Skim = string.IsNullOrEmpty(txtSkim.Text) ? 0 : Convert.ToDouble(txtSkim.Text); stdmdata.SkimFAT = string.IsNullOrEmpty(txtSkimFat.Text) ? 0 : Convert.ToDouble(txtSkimFat.Text); stdmdata.SkimSNF = string.IsNullOrEmpty(txtSkimSnf.Text) ? 0 : Convert.ToDouble(txtSkimSnf.Text); stdmdata.RCM = string.IsNullOrEmpty(txtRcm.Text) ? 0 : Convert.ToDouble(txtRcm.Text); stdmdata.SMP = string.IsNullOrEmpty(txtRcm.Text) ? 0 : Convert.ToDouble(txtRcm.Text); stdmdata.CreamAdd = string.IsNullOrEmpty(txtCreamAdd.Text) ? 0 : Convert.ToDouble(txtCreamAdd.Text); stdmdata.CreamProduced = string.IsNullOrEmpty(txtCreamAdd.Text) ? 0 : Convert.ToDouble(txtCreamAdd.Text); //stdmdata.TotalQuantity = string.IsNullOrEmpty(txtTotalQuantity.Text) ? 0 : Convert.ToDouble(txtTotalQuantity.Text); //stdmdata.TypeOfMilk = string.IsNullOrEmpty(txtTypeOfMilk.Text) ? string.Empty : txtTypeOfMilk.Text; stdmdata.Remarks = string.IsNullOrEmpty(txtRemarks.Text) ? string.Empty : txtRemarks.Text; stdmdata.StandardizationStatusId = Convert.ToInt32(dpStandardDone.SelectedItem.Value); stdmdata.flag = "Insert"; Result = stdbdata.StandardizationData(stdmdata); if (Result > 0) { divDanger.Visible = false; divwarning.Visible = false; divSusccess.Visible = true; lblSuccess.Text = "Data Added Successfully"; ScriptManager.RegisterStartupScript(this, this.GetType(), "sel3", "$('#bx1').addClass('collapsed-box');", true); pnlError.Update(); string dates; dates = string.IsNullOrEmpty(txtSearchDate.Text) ? string.Empty : Convert.ToDateTime(txtSearchDate.Text).ToString("dd-MM-yyyy"); GetStandardizationDetails(dates); uprouteList.Update(); } else { divDanger.Visible = false; divwarning.Visible = true; divSusccess.Visible = false; lblSuccess.Text = "Something went wrong plz contact site admin"; pnlError.Update(); } //return Result; }