public void GetStandardizationProductsAddedDetails(int RMRId) { DataSet DS = new DataSet(); bstdpdata = new BStandardizationProductsAdded(); DS = bstdpdata.GetStandardizationProductsAddedDetailsById(RMRId); if (!Comman.Comman.IsDataSetEmpty(DS)) { string DATE = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["QualityDate"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["QualityDate"].ToString(); //sky 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")); } txtBatchNo.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["BatchNo"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["BatchNo"].ToString(); dpShiftDetails.ClearSelection(); string Shift = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["QualityShiftId"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["QualityShiftId"].ToString(); if (Shift == "") { dpShiftDetails.SelectedIndex = 0; } else { //dpShiftDetails.Items.FindByValue(Convert.ToInt32(DS.Tables[0].Rows[0]["StandardizationProductsAddedShiftId"]).ToString()) != null) dpShiftDetails.Items.FindByValue(Convert.ToInt32(DS.Tables[0].Rows[0]["QualityShiftId"]).ToString()).Selected = true; } txtMilkType.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["TypeOfMilk"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["TypeOfMilk"].ToString(); txtSMPQuantity.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["SMPQuantity"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["SMPQuantity"].ToString(); txtCreamkg.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["Creamkg"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["Creamkg"].ToString(); txtWaterliters.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["Waterliters"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["Waterliters"].ToString(); txtCondensedMilk.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["CondensedMilk"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["CondensedMilk"].ToString(); txtButterOil.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["ButterOil"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["ButterOil"].ToString(); txtSkimmedMilk.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["SkimmedMilk"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["SkimmedMilk"].ToString(); txtOthers.Text = string.IsNullOrEmpty(DS.Tables[0].Rows[0]["Others"].ToString()) ? string.Empty : DS.Tables[0].Rows[0]["Others"].ToString(); dpStdAddDone.ClearSelection(); try { if (Convert.ToInt32(DS.Tables[0].Rows[0]["StdStatusId"]).ToString() != "") { dpStdAddDone.Items.FindByValue(Convert.ToInt32(DS.Tables[0].Rows[0]["StdStatusId"]).ToString()).Selected = true; } } catch (InvalidCastException) { dpStdAddDone.SelectedIndex = 2; } } }