public void GetGheeProductionRegisterDetails() { bgpr = new BGheeProductionRegister(); DataSet DS = new DataSet(); DS = bgpr.GetGheeProductionRegisterDetails(); if (!Comman.Comman.IsDataSetEmpty(DS)) { rpGheeProductionRegister.DataSource = DS; rpGheeProductionRegister.DataBind(); } }
protected void btnUpdate_Click(object sender, EventArgs e) { mgpr = new MGheeProductionRegister(); bgpr = new BGheeProductionRegister(); int Result = 0; mgpr.GheeProductionRegisterId = 0; mgpr.RMRId = string.IsNullOrEmpty(hId.Value) ? 0 : Convert.ToInt32(hId.Value); mgpr.GheeProductionRegisterDate = Convert.ToDateTime(txtDate.Text.ToString()); mgpr.GheeProductionRegisterShiftId = Convert.ToInt32(dpShiftDetails.SelectedItem.Value); mgpr.CreamQualityPhysical = string.IsNullOrEmpty(txtCreamQualityPhysical.Text) ? string.Empty : txtCreamQualityPhysical.Text; mgpr.CreamQualityOthers = string.IsNullOrEmpty(txtCreamQualityOthers.Text) ? string.Empty : txtCreamQualityOthers.Text; mgpr.CreamQualityCheckedBy = string.IsNullOrEmpty(txtCreamQualityCheckedBy.Text) ? string.Empty : txtCreamQualityCheckedBy.Text;; mgpr.CreamApprovedBy = string.IsNullOrEmpty(txtCreamApprovedBy.Text) ? string.Empty : txtCreamApprovedBy.Text; mgpr.HeatingTemperature = string.IsNullOrEmpty(txtHeatingTemp.Text) ? 0 : Convert.ToDouble(txtHeatingTemp.Text); mgpr.BoilingStartingTime = string.IsNullOrEmpty(txtBoilingStartingTime.Text) ? string.Empty : txtBoilingStartingTime.Text; mgpr.BoilingEndTime = string.IsNullOrEmpty(txtBoilingEndTime.Text) ? string.Empty : txtBoilingEndTime.Text; mgpr.SettingStartTime = string.IsNullOrEmpty(txtSettingStartTime.Text) ? string.Empty : txtSettingStartTime.Text; mgpr.SettingEndTime = string.IsNullOrEmpty(txtSetEndTime.Text) ? string.Empty : txtSetEndTime.Text; mgpr.ResidueQuantity = string.IsNullOrEmpty(txtResidueQuantity.Text) ? 0 : Convert.ToDouble(txtResidueQuantity.Text); mgpr.VesselsCleaning = string.IsNullOrEmpty(txtVesselsCleaning.Text) ? string.Empty : txtVesselsCleaning.Text; mgpr.InoculationcultureQualityandAcidityFlavour = string.IsNullOrEmpty(txtInoculationFlavour.Text) ? string.Empty : txtInoculationFlavour.Text; mgpr.InoculationcultureQualityandAciditySetting = string.IsNullOrEmpty(txtInoculationSetting.Text) ? string.Empty : txtInoculationSetting.Text; mgpr.InoculationcultureQualityandAcidityTemperature = string.IsNullOrEmpty(txtInoculationTemperature.Text) ? 0 : Convert.ToDouble(txtInoculationTemperature.Text); mgpr.QualityBeforePackingAppearing = string.IsNullOrEmpty(txtQualityBeforePackingAppearing.Text) ? string.Empty : txtQualityBeforePackingAppearing.Text; mgpr.QualityBeforePackingFlavour = string.IsNullOrEmpty(txtQualityBeforePackingFlavour.Text) ? string.Empty : txtQualityBeforePackingFlavour.Text; mgpr.FinalProductionQuantity = string.IsNullOrEmpty(txtFinalProductionQuantity.Text) ? 0 : Convert.ToDouble(txtFinalProductionQuantity.Text); mgpr.InspectedBy = string.IsNullOrEmpty(txtInspectedBy.Text) ? string.Empty : txtInspectedBy.Text; mgpr.VerifiedBy = string.IsNullOrEmpty(txtVerifiedBy.Text) ? string.Empty : txtVerifiedBy.Text; mgpr.ApprovedBy = string.IsNullOrEmpty(txtApprovedBy.Text) ? string.Empty : txtApprovedBy.Text; mgpr.flag = "Update"; Result = bgpr.gheedata(mgpr); if (Result > 0) { divDanger.Visible = false; divwarning.Visible = false; divSusccess.Visible = true; lblSuccess.Text = "Ghee Production Register Data Updated Successfully"; pnlError.Update(); // GetPastDetails(); } else { divDanger.Visible = false; divwarning.Visible = true; divSusccess.Visible = false; lblSuccess.Text = "Something went wrong plz contact site admin"; pnlError.Update(); } }
public void GetGheeProductionRegisterDetails(int RMRId) { DataSet DS = new DataSet(); bgpr = new BGheeProductionRegister(); DS = bgpr.GetGheeProductionRegisterDetailsById(RMRId); if (!Comman.Comman.IsDataSetEmpty(DS)) { string DATE = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["GheeProductionRegisterDate"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["GheeProductionRegisterDate"].ToString(); if (DATE == "") { txtDate.Text = Convert.ToString(DateTime.Now.ToString("yyy-MM-dd")); } else { DateTime date1 = Convert.ToDateTime(DATE, System.Globalization.CultureInfo.GetCultureInfo("ur-PK").DateTimeFormat); txtDate.Text = (Convert.ToDateTime(date1).ToString("yyyy-MM-dd")); } dpShiftDetails.ClearSelection(); string Shift = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["GheeProductionRegisterShiftId"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["GheeProductionRegisterShiftId"].ToString(); if (Shift == "") { dpShiftDetails.SelectedIndex = 0; } else { dpShiftDetails.Items.FindByValue(Convert.ToInt32(DS.Tables[0].Rows[0]["GheeProductionRegisterShiftId"]).ToString()).Selected = true; } txtBatchNo.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["BatchNo"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["BatchNo"].ToString(); txtCreamQualityPhysical.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["CreamQualityPhysical"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["CreamQualityPhysical"].ToString(); txtCreamQualityOthers.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["CreamQualityOthers"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["CreamQualityOthers"].ToString(); txtCreamQualityCheckedBy.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["CreamQualityCheckedBy"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["CreamQualityCheckedBy"].ToString(); txtCreamApprovedBy.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["CreamApprovedBy"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["CreamApprovedBy"].ToString(); txtHeatingTemp.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["HeatingTemperature"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["HeatingTemperature"].ToString(); txtBoilingStartingTime.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["BoilingStartingTime"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["BoilingStartingTime"].ToString(); txtBoilingEndTime.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["BoilingEndTime"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["BoilingEndTime"].ToString(); txtSettingStartTime.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["SettingStartTime"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["SettingStartTime"].ToString(); txtSetEndTime.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["SettingEndTime"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["SettingEndTime"].ToString(); txtResidueQuantity.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["ResidueQuantity"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["ResidueQuantity"].ToString(); txtVesselsCleaning.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["VesselsCleaning"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["VesselsCleaning"].ToString(); txtInoculationFlavour.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["InoculationcultureQualityandAcidityFlavour"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["InoculationcultureQualityandAcidityFlavour"].ToString(); txtInoculationSetting.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["InoculationcultureQualityandAciditySetting"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["InoculationcultureQualityandAciditySetting"].ToString(); txtInoculationTemperature.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["InoculationcultureQualityandAcidityTemperature"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["InoculationcultureQualityandAcidityTemperature"].ToString(); txtQualityBeforePackingAppearing.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["QualityBeforePackingAppearing"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["QualityBeforePackingAppearing"].ToString(); txtQualityBeforePackingFlavour.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["QualityBeforePackingFlavour"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["QualityBeforePackingFlavour"].ToString(); txtFinalProductionQuantity.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["FinalProductionQuantity"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["FinalProductionQuantity"].ToString(); txtInspectedBy.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["InspectedBy"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["InspectedBy"].ToString(); txtVerifiedBy.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["VerifiedBy"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["VerifiedBy"].ToString(); txtApprovedBy.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["ApprovedBy"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["ApprovedBy"].ToString(); } }