private void FillPaymentNumber() { const string METHOD_NAME = "FillPaymentNumber"; try { lstPaymentNumber.Items.Clear(); lstPaymentNumber.DataValueField = "PaymentNumber"; lstPaymentNumber.DataTextField = "PaymentNumDesc"; lstPaymentNumber.DataSource = BeetDataDomain.GetPaymentDescriptions(Convert.ToInt32(Common.UILib.GetDropDownText(ddlCropYear)), false); lstPaymentNumber.DataBind(); if (lstPaymentNumber.Items.Count > 0) { lstPaymentNumber.Items[0].Selected = true; btnExport.Enabled = true; } else { btnExport.Enabled = false; } } catch (Exception ex) { Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex); throw (wex); } }
protected void Page_Load(object sender, EventArgs e) { const string METHOD_NAME = "Page_Load"; try { Common.AppHelper.HideWarning((HtmlGenericControl)Master.FindControl("divWarning")); txtFromSHID.Attributes.Add("onkeypress", "CheckFromEnterKey(event);"); txtToSHID.Attributes.Add("onkeypress", "CheckToEnterKey(event);"); btnTransferDelete.Attributes.Add("onclick", "confirm('Are you sure you want to delete this transfer? Press Ok to continue or Cancel to abort.');"); btnCustomOk.Attributes.Add("onclick", "copyCustomSelection();"); locPDF.Text = ""; if (Globals.IsUserPermissionReadOnly((RolePrincipal)User)) { btnTransferAdd.Enabled = false; btnTransferUpdate.Enabled = false; btnTransferDelete.Enabled = false; } if (!Page.IsPostBack) { BeetDataDomain.FillCropYear(ddlCropYear, DateTime.Now.Year.ToString()); ResetFromSHID(); ResetToSHID(); DoCropYearChange(); } } catch (System.Exception ex) { Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex); ((PrimaryTemplate)Page.Master).ShowWarning(ex); } }
private void FillPayment() { const string METHOD_NAME = "FillPayment"; try { lstPayment.Items.Clear(); lstPayment.DataValueField = "PaymentNumber"; lstPayment.DataTextField = "PaymentNumDesc"; // We want non-finished, but use Linq to remove the payments without valid descriptions. var payments = BeetDataDomain.GetPaymentDescriptions(Convert.ToInt32(Common.UILib.GetDropDownText(ddlCropYear)), false) .Where(p => p.PaymentDesc != "Blank" && p.IsFinished == false && p.IsRequired == true); lstPayment.DataSource = payments; lstPayment.DataBind(); if (lstPayment.Items.Count > 0) { lstPayment.Items[0].Selected = true; //btnProcess.Enabled = true; } else { //btnProcess.Enabled = false; } } catch (Exception ex) { Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex); throw (wex); } }
protected void Page_Load(object sender, EventArgs e) { const string METHOD_NAME = "Page_Load"; try { Common.AppHelper.HideWarning((HtmlGenericControl)Master.FindControl("divWarning")); Common.AppHelper.HideWarning(addrWarning); txtSHID.Attributes.Add("onkeypress", "CheckEnterKey(event);"); btnDeleteDeduction.Attributes.Add("onclick", "confirm('Are you sure you want to delete this Member Equity Deduction?');"); //BBS TEST ONLY !!!! //_paymentDate = _paymentDate.AddYears(-1); if (!Page.IsPostBack) { BeetDataDomain.FillCropYear(ddlCropYear, DateTime.Now.Year.ToString()); //WSCField.FillCropYear(ddlCropYear, DateTime.Now.Year.ToString()); MySHID = ""; FillGridEqDeduction("0", 0); FillGridEqPayment("0", _paymentDate); FillEquityDeductionList(); } } catch (System.Exception ex) { Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex); ((PrimaryTemplate)Page.Master).ShowWarning(ex, "Unable to load page correctly at this time.", addrWarning); } }
protected void Page_Load(object sender, EventArgs e) { const string METHOD_NAME = "Page_Load"; try { Common.AppHelper.HideWarning((HtmlGenericControl)Master.FindControl("divWarning")); Common.AppHelper.HideWarning(addrWarning); txtSHID.Attributes.Add("onkeypress", "CheckEnterKey(event);"); if (!Page.IsPostBack) { BeetDataDomain.FillCropYear(ddlCropYear, DateTime.Now.Year.ToString()); MySHID = ""; btnCustomPct.Text = OVERRIDE_OFF; txtOverPlantPercentage.ReadOnly = true; txtOverPlantPercentage.CssClass = "highlightRO"; BeetDataDomain.FillFactory(ddlFactoryOverPlant); FillOverPlantAcceptance(); } } catch (System.Exception ex) { Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex); ((PrimaryTemplate)Page.Master).ShowWarning(ex, "Unable to load page correctly at this time.", addrWarning); } }
private void FillControls() { const string METHOD_NAME = "FillControls"; try { BeetDataDomain.FillCropYear(ddlCropYear, DateTime.Now.Year.ToString()); FillStations(); } catch (Exception ex) { Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex); throw (wex); } }
private void FillPaymentDesc() { const string METHOD_NAME = "FillPaymentDesc"; try { ddlPsPaymentDesc.Items.Clear(); ddlPsStatementDate.Items.Clear(); txtStatementDate.Text = ""; string cropYear = ((MasterReportTemplate)Master).CropYear; List <ListPaymentDescItem> stateList = BeetDataDomain.GetPaymentDescriptions(Convert.ToInt32(cropYear), false); foreach (ListPaymentDescItem state in stateList) { // Only show payments with transmittal dates. if (state.TransmittalDate.Length > 0) { int paymentID = Convert.ToInt32(state.PaymentDescID); string paymentDesc = state.PaymentDesc; ListItem liDesc = new ListItem(paymentDesc, paymentID.ToString()); ddlPsPaymentDesc.Items.Add(liDesc); ddlPsStatementDate.Items.Add(state.TransmittalDate); } } // Handle empty controls. if (ddlPsPaymentDesc.Items.Count == 0) { ddlPsPaymentDesc.Items.Add("None Available"); ddlPsStatementDate.Items.Add(" "); txtStatementDate.Text = " "; } if (ddlPsPaymentDesc.Items.Count > 0) { ddlPsPaymentDesc.SelectedIndex = 0; ddlPsStatementDate.SelectedIndex = 0; txtStatementDate.Text = Common.UILib.GetDropDownText(ddlPsStatementDate); } } catch (Exception ex) { Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex); throw (wex); } }
private void FillPaymentDesc() { string cropYear = ((HarvestReportTemplate)Master).CropYear; ddlGtPaymentDesc.Items.Clear(); List <ListPaymentDescItem> stateList = BeetDataDomain.GetPaymentDescriptions(Convert.ToInt32(cropYear), true); ddlGtPaymentDesc.DataValueField = "PaymentNumber"; ddlGtPaymentDesc.DataTextField = "PaymentDesc"; ddlGtPaymentDesc.DataSource = stateList; ddlGtPaymentDesc.DataBind(); // Handle empty controls. if (ddlGtPaymentDesc.Items.Count == 0) { ddlGtPaymentDesc.Items.Add("None Available"); } }
private void FillPaymentNumber() { const string METHOD_NAME = "FillPaymentNumber"; try { ddlPaymentNumber.Items.Clear(); string cropYear = ((MasterReportTemplate)Master).CropYear; List <ListPaymentDescItem> stateList = BeetDataDomain.GetPaymentDescriptions(Convert.ToInt32(cropYear), false); ddlPaymentNumber.DataValueField = "PaymentNumber"; ddlPaymentNumber.DataTextField = "PaymentDescSpecial"; ddlPaymentNumber.DataSource = stateList; ddlPaymentNumber.DataBind(); } catch (Exception ex) { Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex); throw (wex); } }
protected void Page_Load(object sender, EventArgs e) { const string METHOD_NAME = "Page_Load"; try { Common.AppHelper.HideWarning((HtmlGenericControl)Master.FindControl("divWarning")); btnPost.Attributes.Add("onclick", "confirm('This will permanently change all Undecided members to No, and cannot be undone. Do you want to continue?');"); if (!Page.IsPostBack) { BeetDataDomain.FillCropYear(ddlCropYear, DateTime.Now.Year.ToString()); FillFactoryGrid(); } } catch (System.Exception ex) { Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex); ((PrimaryTemplate)Page.Master).ShowWarning(ex); } }
private void FillFactory(ListBox lst) { const string METHOD_NAME = "FillFactory"; try { lst.Items.Clear(); List <ListBeetFactoryNameItem> ftyList = BeetDataDomain.BeetFactoryNameGetList(); lst.DataTextField = "FactoryLongName"; lst.DataValueField = "FactoryNumber"; lst.DataSource = ftyList; lst.DataBind(); lst.SelectedIndex = -1; } catch (Exception ex) { Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex); throw (wex); } }
private void FillFactory() { const string METHOD_NAME = "FillFactory"; try { ArrayList listIDs = new System.Collections.ArrayList(_factoryList.Split(new char[] { ',' })); ListBox lst = lstFaFactory; lst.Items.Clear(); string cropYear = ((MasterReportTemplate)Master).CropYear; List<ListBeetFactoryIDItem> stateList = BeetDataDomain.BeetFactoryIDGetList(Convert.ToInt32(cropYear)); System.Text.StringBuilder sbList = new System.Text.StringBuilder(""); foreach (ListBeetFactoryIDItem state in stateList) { ListItem item = new ListItem(state.FactoryLongName, state.FactoryID); lst.Items.Add(item); if (listIDs.Contains(item.Value)) { lst.Items[lst.Items.Count - 1].Selected = true; // Rebuild factoryList because the listIDs are now qualified sbList.Append(item.Value + ","); } } if (sbList.Length > 0) { sbList.Length = sbList.Length - 1; } _factoryList = sbList.ToString(); } catch (Exception ex) { Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex); throw (wex); } }
private void FillStations() { const string METHOD_NAME = "FillStations"; try { //List<ListBeetFactoryIDItem> BeetFactoryIDGetList(int cropYear) int cropYear = Convert.ToInt32(Common.UILib.GetDropDownText(ddlCropYear)); List <ListBeetStationIDItem> stationList = BeetDataDomain.StationListGetAll(cropYear); ddlCriteriaContractStation.Items.Add(new ListItem("Any", "0")); ddlCriteriaDeliveryStation.Items.Add(new ListItem("Any", "0")); ddlEditContractStation.Items.Add(new ListItem(" ", "0")); ddlEditDeliveryStation.Items.Add(new ListItem(" ", "0")); // Fill various station controls with list of stations. foreach (ListBeetStationIDItem station in stationList) { ddlCriteriaContractStation.Items.Add(new ListItem(station.StationNumberName, station.StationNumber)); ddlCriteriaDeliveryStation.Items.Add(new ListItem(station.StationNumberName, station.StationNumber)); ddlEditContractStation.Items.Add(new ListItem(station.StationNumberName, station.StationNumber)); ddlEditDeliveryStation.Items.Add(new ListItem(station.StationNumberName, station.StationNumber)); } ddlCriteriaContractStation.SelectedIndex = 0; ddlCriteriaDeliveryStation.SelectedIndex = 0; ddlEditContractStation.SelectedIndex = 0; ddlEditDeliveryStation.SelectedIndex = 0; } catch (Exception ex) { Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex); throw (wex); } }
private void FillFactory() { const string METHOD_NAME = "FillFactory"; try { ListBox lst = lstFactory; lst.Items.Clear(); List <ListBeetFactoryIDItem> ftyList = BeetDataDomain.BeetFactoryIDGetList(Convert.ToInt32(Common.UILib.GetDropDownText(ddlCropYear))); lst.DataTextField = "FactoryLongName"; lst.DataValueField = "FactoryID"; lst.DataSource = ftyList; lst.DataBind(); if (lst.Items.Count > 0) { lst.Items[0].Selected = true; } } catch (Exception ex) { Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex); throw (wex); } }
private void FillPaymentDescription() { ClearPaymentDescription(); List <ListPaymentDescItem> stateList = BeetDataDomain.GetPaymentDescriptions(_cropYear, false); foreach (ListPaymentDescItem state in stateList) { int paymentNumber = Convert.ToInt32(state.PaymentNumber); switch (paymentNumber) { case 1: ShowPaymentInfo(state, lblPayNum1, ddlFinished1, ddlRequired1, txtTransmittalDate1, txtPaymentDesc1, txtPaymentDescID1); break; case 2: ShowPaymentInfo(state, lblPayNum2, ddlFinished2, ddlRequired2, txtTransmittalDate2, txtPaymentDesc2, txtPaymentDescID2); break; case 3: ShowPaymentInfo(state, lblPayNum3, ddlFinished3, ddlRequired3, txtTransmittalDate3, txtPaymentDesc3, txtPaymentDescID3); break; case 4: ShowPaymentInfo(state, lblPayNum4, ddlFinished4, ddlRequired4, txtTransmittalDate4, txtPaymentDesc4, txtPaymentDescID4); break; case 5: ShowPaymentInfo(state, lblPayNum5, ddlFinished5, ddlRequired5, txtTransmittalDate5, txtPaymentDesc5, txtPaymentDescID5); break; case 6: ShowPaymentInfo(state, lblPayNum6, ddlFinished6, ddlRequired6, txtTransmittalDate6, txtPaymentDesc6, txtPaymentDescID6); break; case 7: ShowPaymentInfo(state, lblPayNum7, ddlFinished7, ddlRequired7, txtTransmittalDate7, txtPaymentDesc7, txtPaymentDescID7); break; case 8: ShowPaymentInfo(state, lblPayNum8, ddlFinished8, ddlRequired8, txtTransmittalDate8, txtPaymentDesc8, txtPaymentDescID8); break; case 9: ShowPaymentInfo(state, lblPayNum9, ddlFinished9, ddlRequired9, txtTransmittalDate9, txtPaymentDesc9, txtPaymentDescID9); break; case 10: ShowPaymentInfo(state, lblPayNum10, ddlFinished10, ddlRequired10, txtTransmittalDate10, txtPaymentDesc10, txtPaymentDescID10); break; } } }
private static List <ListDirectDeliveryStatementItem> RptDirectDeliveryStatementData(int cropYear, DateTime fromDate, DateTime toDate, string shid) { const string METHOD_NAME = "RptDirectDeliveryStatementData"; List <ListDirectDeliveryStatementItem> state = new List <ListDirectDeliveryStatementItem>(); try { string shidList = null; string shidLo = null; string shidHi = null; BeetDataDomain.SplitShidList(shid, out shidList, out shidLo, out shidHi); using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["BeetConn"].ToString())) { string procName = "bawpRptDirectDeliveryStatement"; if (conn.State != System.Data.ConnectionState.Open) { conn.Open(); } System.Data.SqlClient.SqlParameter[] spParams = SqlHelperParameterCache.GetSpParameterSet(conn, procName, false); // Manually synch these fields with database. spParams[0].Value = cropYear; spParams[1].Value = fromDate; spParams[2].Value = toDate; spParams[3].Value = shidLo; spParams[4].Value = shidHi; spParams[5].Value = shidList; using (SqlDataReader dr = SqlHelper.ExecuteReader(conn, CommandType.StoredProcedure, procName, spParams)) { int icontractNumber = dr.GetOrdinal("contract_no"); int iShid = dr.GetOrdinal("address_no"); int iBusName = dr.GetOrdinal("address_business_name"); int iAddrLine1 = dr.GetOrdinal("address_line_1"); int iAddrLine2 = dr.GetOrdinal("address_line_2"); int icity = dr.GetOrdinal("address_city"); int istate = dr.GetOrdinal("address_state"); int izipCode = dr.GetOrdinal("address_zip_code"); int ipayee = dr.GetOrdinal("payee"); int ipayAmt = dr.GetOrdinal("payment_amount"); int ifirstNetTons = dr.GetOrdinal("first_net_tons"); int ideliveryStation = dr.GetOrdinal("delivery_station_no"); int icontractStation = dr.GetOrdinal("contract_station_no"); int ininetySixPct = dr.GetOrdinal("nintysix_percent"); int iratePerTon = dr.GetOrdinal("rate_per_ton"); int icontractStationName = dr.GetOrdinal("contract_station_name"); int ideliveryStationName = dr.GetOrdinal("delivery_station_name"); while (dr.Read()) { state.Add(new ListDirectDeliveryStatementItem(dr.GetString(icontractNumber), dr.GetString(iShid), dr.GetString(iBusName), dr.GetString(iAddrLine1), dr.GetString(iAddrLine2), dr.GetString(icity), dr.GetString(istate), dr.GetString(izipCode), dr.GetString(ipayee), dr.GetDecimal(ipayAmt), dr.GetDecimal(ifirstNetTons), dr.GetInt32(ideliveryStation), dr.GetInt32(icontractStation), dr.GetDecimal(ininetySixPct), dr.GetDecimal(iratePerTon), dr.GetString(icontractStationName), dr.GetString(ideliveryStationName))); } } } return(state); } catch (SqlException sqlEx) { if (sqlEx.Number == Convert.ToInt32(WSCIEMP.Common.CException.KnownError.DataWarning)) { WSCIEMP.Common.CWarning wscWarn = new WSCIEMP.Common.CWarning(sqlEx.Message, sqlEx); throw (wscWarn); } else { string errMsg = MOD_NAME + METHOD_NAME; WSCIEMP.Common.CException wscEx = new WSCIEMP.Common.CException(errMsg, sqlEx); throw (wscEx); } } catch (System.Exception e) { string errMsg = MOD_NAME + METHOD_NAME; WSCIEMP.Common.CException wscEx = new WSCIEMP.Common.CException(errMsg, e); throw (wscEx); } }