Beispiel #1
0
        private void DoPrintReady(object sender, CommandEventArgs e)
        {
            const string METHOD_NAME = "DoPrintReady";

            try {

                WSCSecurity auth = Globals.SecurityState;
                string logoUrl = Page.MapPath(WSCReportsExec.GetReportLogo());
                string pdfTempFolder = Page.MapPath(WSCReportsExec.GetPDFFolderPath());
                string fileName = txtFileName.Text;

                // Get File Name
                if (fileName.Length == 0) {
                    Common.CWarning warn = new Common.CWarning("Please enter a file name.");
                    throw (warn);
                }

                string pdf = "";

                string cropYear = ((MasterReportTemplate)Master).CropYear;
                pdf = WSCReports.rptBeet1099.ReportPackager(cropYear, fileName, logoUrl, pdfTempFolder);

                if (pdf.Length > 0) {
                    // convert file system path to virtual path
                    pdf = pdf.Replace(Common.AppHelper.AppPath(), Page.ResolveUrl("~")).Replace(@"\", @"/");
                }
                ((MasterReportTemplate)sender).LocPDF = pdf;
            }
            catch (System.Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                ((MasterReportTemplate)Page.Master).ShowWarning(ex);
            }
        }
        private void DoPrintReady(object sender, CommandEventArgs e)
        {
            const string METHOD_NAME = "DoPrintReady";

            try {

                WSCSecurity auth = Globals.SecurityState;
                string logoUrl = Page.MapPath(WSCReportsExec.GetReportLogo());
                string pdfTempFolder = Page.MapPath(WSCReportsExec.GetPDFFolderPath());
                string fileName = auth.UserID + "_" + ((MasterReportTemplate)Master).ReportName.Replace(" ", "");
                string reportDate = txtCpsReportDate.Text;
                string cropYear = ((MasterReportTemplate)Master).CropYear;
                string shid = txtCpsSHID.Text;

                if (reportDate == null || reportDate.Length == 0 || !Common.CodeLib.IsDate(reportDate)) {
                    Common.CWarning warn = new Common.CWarning("You must enter a valid report date, mm/dd/yyyy");
                    throw (warn);
                }

                WSCReports.rptContractPayeeSummary rpt = new WSCReports.rptContractPayeeSummary();
                string pdf = rpt.ReportPackager(Int32.Parse(cropYear), DateTime.Parse(reportDate), shid, fileName, logoUrl, pdfTempFolder);

                if (pdf.Length > 0) {
                    // convert file system path to virtual path
                    pdf = pdf.Replace(Common.AppHelper.AppPath(), Page.ResolveUrl("~")).Replace(@"\", @"/");
                }

                ((MasterReportTemplate)sender).LocPDF = pdf;
            }
            catch (System.Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                ((MasterReportTemplate)Page.Master).ShowWarning(ex);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            const string METHOD_NAME = "Page_Load";

            try {

                Common.AppHelper.HideWarning((HtmlGenericControl)Master.FindControl("divWarning"));
                //((MasterReportTemplate)Master).LocPDF = "";
                lnkPaymentFile.Visible = false;

                ((MasterReportTemplate)Page.Master).CropYearChange += new CommandEventHandler(DoCropYearChange);

                // Sink the Master page event, PrintReady
                ((MasterReportTemplate)Page.Master).PrintReady += new CommandEventHandler(DoPrintReady);

                if (!Page.IsPostBack) {
                    FillPaymentNumber();
                }

            }
            catch (System.Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                ((MasterReportTemplate)Page.Master).ShowWarning(ex);
            }
        }
        private void DoPrintReady(object sender, CommandEventArgs e)
        {
            const string METHOD_NAME = "DoPrintReady";

            try {

                WSCSecurity auth = Globals.SecurityState;
                string logoUrl = Page.MapPath(WSCReportsExec.GetReportLogo());
                string pdfTempFolder = Page.MapPath(WSCReportsExec.GetPDFFolderPath());
                string fileName = auth.UserID + "_" + ((HarvestReportTemplate)Master).ReportName.Replace(" ", "");

                int cropYear = Convert.ToInt32(((HarvestReportTemplate)Master).CropYear);
                string shid = ((HarvestReportTemplate)Master).SHID.ToString();

                DateTime activityFromDate = DateTime.MinValue;
                DateTime activityToDate = DateTime.MinValue;
                bool isLienInfoWanted = false;

                WSCReports.rptEquityStatement rptEqStmt = new WSCReports.rptEquityStatement();
                string pdf = rptEqStmt.ReportPackager(cropYear, DateTime.Now, shid, false, fileName, logoUrl, pdfTempFolder,
                    activityFromDate, activityToDate, isLienInfoWanted);

                if (pdf.Length > 0) {
                    // convert file system path to virtual path
                    pdf = pdf.Replace(Common.AppHelper.AppPath(), Page.ResolveUrl("~")).Replace(@"\", @"/");
                }

                ((HarvestReportTemplate)sender).LocPDF = pdf;
            }
            catch (System.Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                ((HarvestReportTemplate)Page.Master).ShowWarning(ex);
            }
        }
        protected void btnPrintForm_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = "btnPrintForm_Click";

            try {

                if (UsrCntSelector.IsChangedSHID) {
                    Common.AppHelper.ShowWarning((HtmlGenericControl)Master.FindControl("divWarning"), "You changed the SHID without pressing the Find button.  Please press Find.");
                    return;
                }

                // Give client the url to open the pdf
                string filePath = "";
                WSCSecurity auth = Globals.SecurityState;
                string logoUrl = Page.MapPath(WSCReportsExec.GetReportLogo());
                string pdfTempFolder = Page.MapPath(WSCReportsExec.GetPDFFolderPath());
                string fileName = auth.UserID + "_" + "Field Contracting".Replace(" ", "");

                filePath = WSCReports.rptFieldContracting.ReportPackager(UsrCntSelector.CropYear, "", "", "", UsrCntSelector.FieldID.ToString(), auth.UserID, fileName, logoUrl, pdfTempFolder);

                if (filePath.Length > 0) {
                    // convert file system path to virtual path
                    filePath = filePath.Replace(Common.AppHelper.AppPath(), Page.ResolveUrl("~")).Replace(@"\", @"/");
                }

                locPDF.Text = filePath;

            }
            catch (Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                ((PrimaryTemplate)Page.Master).ShowWarning(ex);
            }
        }
Beispiel #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            const string METHOD_NAME = "Page_Load";

            try {

                Common.AppHelper.HideWarning(divWarning);

                // This is really GREAT !!!
                HtmlGenericControl script = new HtmlGenericControl("script");
                script.Attributes.Add("type", "text/javascript");
                script.Attributes.Add("src", Page.ResolveUrl("~/Script/Common.js"));
                Page.Header.Controls.Add(script);

                System.Collections.Specialized.NameValueCollection nv = Page.Request.QueryString;
                MasterControlName.Text = nv["MasterControlName"];
                ActionControlName.Text = nv["ActionControlName"];
                Action.Text = nv["Action"];
                lblTextEntryLabel.Text = nv["Label"];

                string clickCtrl = (nv["clickCtrlName"] != null ? nv["clickCtrlName"].ToString() : "");
                btnOk.Attributes.Add("onclick", "DoOk('" + clickCtrl + "');");

            }
            catch (System.Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                ((PrimaryTemplate)Page.Master).ShowWarning(ex);
            }
        }
Beispiel #7
0
        protected void btnDeletePDF_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = "btnDeletePDF_Click";

            try {

                //------------------------------------------
                // Delete the PDF File.
                //------------------------------------------
                string locLastPdf = ((MasterReportTemplate)Page.Master).LocLastPDF;
                string fileName = Page.MapPath(locLastPdf);

                if (System.IO.File.Exists(fileName)) {
                    System.IO.File.Delete(fileName);
                    Common.AppHelper.ShowWarning((HtmlGenericControl)Master.FindControl("divWarning"), "Successfully deleted " + fileName + ".");
                } else {
                    Common.CWarning warn = new WSCIEMP.Common.CWarning("PDF file not found on file system.");
                    throw (warn);
                }

            }
            catch (System.Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                ((MasterReportTemplate)Page.Master).ShowWarning(ex);
            }
        }
Beispiel #8
0
        private void DoPrintReady(object sender, CommandEventArgs e)
        {
            const string METHOD_NAME = "DoPrintReady";

            try {

                WSCSecurity auth = Globals.SecurityState;
                string logoUrl = Page.MapPath(WSCReportsExec.GetReportLogo());
                string pdfTempFolder = Page.MapPath(WSCReportsExec.GetPDFFolderPath());
                string fileName = auth.UserID + "_" + ((HarvestReportTemplate)Master).ReportName.Replace(" ", "");

                string cropYear = ((HarvestReportTemplate)Master).CropYear;
                string shid = ((HarvestReportTemplate)Master).SHID.ToString();

                string pdf = WSCReports.rptFieldSummary.ReportPackager(Convert.ToInt32(cropYear), "", "", "",
                    shid, "", "", auth.UserID, fileName, logoUrl, pdfTempFolder);

                if (pdf.Length > 0) {
                    // convert file system path to virtual path
                    pdf = pdf.Replace(Common.AppHelper.AppPath(), Page.ResolveUrl("~")).Replace(@"\", @"/");
                }

                ((HarvestReportTemplate)sender).LocPDF = pdf;
            }
            catch (System.Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                ((HarvestReportTemplate)Page.Master).ShowWarning(ex);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            const string METHOD_NAME = "Page_Load";

            Common.AppHelper.HideWarning((HtmlGenericControl)Master.FindControl("divWarning"));
            ((HarvestReportTemplate)Master).LocPDF = "";

            // Sink the Master page events...
            ((HarvestReportTemplate)Master).PrintReady += new CommandEventHandler(DoPrintReady);
            ((HarvestReportTemplate)Master).ShidChange += new CommandEventHandler(DoShidChange);
            ((HarvestReportTemplate)Master).CropYearChange += new CommandEventHandler(DoCropYearChange);

            lstDgtdContract.Attributes.Add("onchange", "SetSubRefOptions(this," +
                "'" + lstDgtdDeliveryDate.ClientID + "', " + "'" + lstDgtdRefDeliveryDate.ClientID + "');");

            try {

                System.Collections.Specialized.NameValueCollection nv = Page.Request.Form;
                _deliveryDates = nv[lstDgtdDeliveryDate.ClientID.Replace("_", "$")];
                if (_deliveryDates == null) { _deliveryDates = ""; }

                if (!Page.IsPostBack) {
                    FillControls();
                }
            }
            catch (System.Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                ((HarvestReportTemplate)Page.Master).ShowWarning(ex);
            }
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = "btnSave_Click";
            int taxYear = 0;
            int cropYear = 0;
            bool ok = false;

            try {

                cropYear = Convert.ToInt32(Common.UILib.GetDropDownText(ddlCropYear));
                taxYear = Convert.ToInt32(Common.UILib.GetDropDownText(ddlTaxYear));

                string tmp = txtRatePerTon.Text;
                decimal ratePerTon = 0;
                if (!Decimal.TryParse(tmp, out ratePerTon)) {
                    Common.CWarning warn = new Common.CWarning("Please enter a valid Rate Per Ton.");
                    throw (warn);
                }

                decimal percentToApply = 0;
                tmp = txtPercentageToApply.Text;
                if (!Decimal.TryParse(tmp, out percentToApply)) {
                    Common.CWarning warn = new Common.CWarning("Please enter a valid Percentage to Apply.");
                    throw (warn);
                }

                DateTime reportDate = DateTime.MinValue;
                tmp = txtReportDate.Text;
                if (tmp != "") {
                    if (!DateTime.TryParse(tmp, out reportDate)) {
                        Common.CWarning warn = new Common.CWarning("Please enter a valid Report Date.");
                        throw (warn);
                    }
                }

                DateTime fiscalYearEndDate = DateTime.MinValue;
                tmp = txtFiscalYearEndDate.Text;
                if (tmp != "") {
                    if (!DateTime.TryParse(tmp, out fiscalYearEndDate)) {
                        Common.CWarning warn = new Common.CWarning("Please enter a valid Fiscal Year End Date.");
                        throw (warn);
                    }
                }

                WSCAdmin.PassthroughAllSave(cropYear, taxYear, ratePerTon, percentToApply,
                    reportDate, fiscalYearEndDate, Globals.SecurityState.UserName);

                ok = true;

            }
            catch (System.Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                ((PrimaryTemplate)Page.Master).ShowWarning(ex);
            }

            if (ok) {
                Response.Redirect("~/Admin/PassthroughManagement.aspx?YR=" + cropYear.ToString()
                    + "&UpdateOk=true");
            }
        }
        protected void btnExport_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = "btnExport_Click";

            try {

                int cropYear = Convert.ToInt32(ddlCropYear.SelectedValue);

                // Jump to the appropriate export routine.
                if (chkExportAll.Checked) {
                    WSCFieldExport.DeleteAllTables(cropYear);
                    WSCFieldExport.PopulateAllTables(cropYear);
                } else {

                    if (chkExportAgronomy.Checked) {
                        WSCFieldExport.DeleteAgronomyTable(cropYear);
                        WSCFieldExport.PopulateAgronomyTable(cropYear);
                    }
                    if (chkExportContracting.Checked) {
                        WSCFieldExport.DeleteContractingTable(cropYear);
                        WSCFieldExport.PopulateContractingTable(cropYear);
                    }
                    if (chkExportReportCard.Checked) {
                        WSCFieldExport.PopulateGrowerPerformanceTable(cropYear);
                    }

                    if (chkExportDeletePerformance.Checked) {
                        WSCFieldExport.DeletePerformanceTable(cropYear);
                    }
                    if (chkExportDeleteDirt.Checked) {
                        WSCFieldExport.DeleteContractDirtTable(cropYear);
                    }
                    if (chkExportGenPerformance.Checked) {
                        WSCFieldExport.PopulateBeetAccountingPerformance(cropYear);
                    }
                    if (chkExportGenDirt.Checked) {
                        WSCFieldExport.PopulateBeetAccountingPerformance2(cropYear);
                    }
                    if (chkExportPerformanceData.Checked) {
                        WSCFieldExport.PopulatePerformanceTable(cropYear);
                    }
                    if (chkExportDirtData.Checked) {
                        WSCFieldExport.PopulateContractDirtTable(cropYear);
                    }
                }

                Common.AppHelper.ShowConfirmation((HtmlGenericControl)Master.FindControl("divWarning"), "Export is complete.");
            }
            catch (Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                ((PrimaryTemplate)Page.Master).ShowWarning(ex);
            }
        }
        protected void btnProcess_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = "ddlCropYear_SelectedIndexChanged";

            try {
                DoProcessPayment();
            }
            catch (System.Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                ((PrimaryTemplate)Page.Master).ShowWarning(ex);
            }
        }
Beispiel #13
0
        protected void btnAddFactor_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = "btnAddFactor_Click";

            try {

            }
            catch (System.Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                ((PrimaryTemplate)Page.Master).ShowWarning(ex);
            }
        }
        private void DoCropYearChange(object sender, CommandEventArgs e)
        {
            const string METHOD_NAME = "DoPrintReady";

            try {

            }
            catch (System.Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                ((MasterReportTemplate)Page.Master).ShowWarning(ex);
            }
        }
        protected void ddlEquityType_SelectedIndexChanged(object sender, EventArgs e)
        {
            const string METHOD_NAME = "ddlEquityType_SelectedIndexChanged";

            try {
                FillControls();
            }
            catch (System.Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                ((MasterReportTemplate)Page.Master).ShowWarning(ex);
            }
        }
Beispiel #16
0
        protected void Page_Load(object sender, EventArgs e)
        {
            const string METHOD_NAME = "Page_Load";
            string filePath = "";

            try {

                using (DataSet dsForms = new DataSet()) {
                    filePath = MapPath(@"~/ZHost/XML/AlertForms.xml");
                    dlResults.Visible = false;

                    if (File.Exists(filePath)) {

                        dsForms.ReadXml(filePath);

                        // Condition the data as needed.
                        if (dsForms.Tables["AlertItem"].Rows.Count > 0) {

                            foreach (DataRow row in dsForms.Tables["AlertItem"].Rows) {

                                if (row["UpdateDate"].ToString().Length == 0) {
                                    string url = row["Url"].ToString();
                                    FileInfo fi = new FileInfo(MapPath(url));
                                    DateTime updateDate = fi.LastWriteTime;
                                    row["UpdateDate"] = updateDate.ToString("MMMM dd, yyyy");
                                }

                                row["Url"] = Page.ResolveUrl(row["Url"].ToString());
                            }

                            DataView dvForms = dsForms.Tables["AlertItem"].DefaultView;
                            dvForms.RowFilter = "IsActive = 1";

                            if (dvForms.Count > 0) {
                                dlResults.DataSource = dvForms;
                                dlResults.DataBind();
                                dlResults.Visible = true;
                            }
                        }
                    }

                    if (dlResults.Visible == false) {
                        divResults.Attributes.Add("style", "text-align: center;");
                        divResults.InnerHtml = "<br /><br /><br /><br /><br />Sorry, there are no current Announcements.<br /><br /><br /><br /><br /><br /><br /><br /><br />" +
                            "<br /><br /><br /><br />";
                    }
                }
            }
            catch (System.Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                ((PrimaryTemplate)Page.Master).ShowWarning(ex);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            const string METHOD_NAME = "Page_Load";

            try {

                Common.AppHelper.HideWarning((HtmlGenericControl)Master.FindControl("divWarning"));
            }
            catch (System.Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                ((PrimaryTemplate)Page.Master).ShowWarning(ex);
            }
        }
        protected void lstLlStation_SelectedIndexChanged(object sender, EventArgs e)
        {
            const string METHOD_NAME = "lstLlStation_SelectedIndexChanged";

            try {
                FillContract();
                uplCriteria.Update();
            }
            catch (System.Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                ((MasterReportTemplate)Page.Master).ShowWarning(ex, "Unable to load page correctly at this time.", divAjaxWarning);
            }
        }
Beispiel #19
0
        protected void ddlDescription_SelectedIndexChanged(object sender, EventArgs e)
        {
            const string METHOD_NAME = "ddlDescription_SelectedIndexChanged";

            try {

                FillDescriptionDetails();
            }
            catch (Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                ((PrimaryTemplate)Page.Master).ShowWarning(ex);
            }
        }
 protected void btnNew_Click(object sender, EventArgs e)
 {
     const string METHOD_NAME = "btnNew_Click";
     try {
         ClearBankDetail();
         NewBankAlertOn();
         chkIsActive.Checked = true;
     }
     catch (System.Exception ex) {
         Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
         ((PrimaryTemplate)Page.Master).ShowWarning(ex);
     }
 }
Beispiel #21
0
        protected void ddlFactory_SelectedIndexChanged(object sender, EventArgs e)
        {
            const string METHOD_NAME = "ddlFactory_SelectedIndexChanged";

            try {

                string rehaulDate = txtDate.Text;
                HandleFactorySelection(Common.UILib.GetDropDownValue(ddlFactory), Convert.ToDateTime(rehaulDate));
            }
            catch (System.Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                ((PrimaryTemplate)Page.Master).ShowWarning(ex);
            }
        }
        protected void btnDelete_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = "btnDelete_Click";

            try {

                DeletePlantPopulation();
                FillRowWidth();
                FillRowWidthDetails();
            }
            catch (System.Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                ((PrimaryTemplate)Page.Master).ShowWarning(ex);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            const string METHOD_NAME = "Page_Load";

            try {

                Common.AppHelper.HideWarning(divFFWarning);

                ShowFieldResults();
            }
            catch (System.Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                ((PrimaryTemplate)Page.Master).ShowWarning(ex);
            }
        }
Beispiel #24
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = "btnSave_Click";

            try {

                SaveLookup();
                FillDescriptions();
                FillDescriptionDetails();
            }
            catch (Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                ((PrimaryTemplate)Page.Master).ShowWarning(ex);
            }
        }
Beispiel #25
0
        protected void btnPrevReportDate_Click(object sender, ImageClickEventArgs e)
        {
            const string METHOD_NAME = "btnPrevReportDate_Click";

            try {

                DateTime rehaulDate = Convert.ToDateTime(txtDate.Text).AddDays(-1);
                string factoryNumber = Common.UILib.GetDropDownValue(ddlFactory);
                HandleDateChange(factoryNumber, rehaulDate);
            }
            catch (System.Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                ((PrimaryTemplate)Page.Master).ShowWarning(ex);
            }
        }
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = "btnAdd_Click";

            try {

                //----------------------------------------------------------------------
                // Use the constructor to clean up state values, especially from grid.
                //----------------------------------------------------------------------
                ListEquityDeductionItem state = new ListEquityDeductionItem(
                    "",
                    txtEDedNumber.Text,
                    txtEDedDescription.Text,
                    (chkEDedIsActive.Checked ? "Y" : "N"),
                    "");

                string tmpNum = state.DeductionNumber;
                int deductionNumber = 0;
                try {
                    deductionNumber = Convert.ToInt32(tmpNum);
                }
                catch {
                    Common.CWarning warn = new WSCIEMP.Common.CWarning("Please enter a positive number for Deduction Number.");
                    throw (warn);
                }
                if (deductionNumber == 0) {
                    Common.CWarning warn = new WSCIEMP.Common.CWarning("Please enter a Deduction Number to a number greater than zero.");
                    throw (warn);
                }

                if (state.DeductionDescription.Length == 0) {
                    Common.CWarning warn = new WSCIEMP.Common.CWarning("Please enter a Deduction Description.");
                    throw (warn);
                }

                string userName = Common.AppHelper.GetIdentityName();

                BeetEquityDeduction.EquityDeductionSave(Convert.ToInt32(state.EquityDeductionID), Convert.ToInt32(state.DeductionNumber),
                    state.DeductionDescription, state.IsActiveAsBool(), state.RowVersion, userName);

                ResetEquityDeductionEdit();
                FillEqDeductionGrid();
            }
            catch (System.Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                ((PrimaryTemplate)Page.Master).ShowWarning(ex);
            }
        }
        protected void btnNew_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = "btnNew_Click";

            try {

                grdResults.SelectedIndex = -1;
                txtBPAFactor.Text = "";
                txtRowWidth.Text = "";
                txtStandFactor.Text = "";
            }
            catch (System.Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                ((PrimaryTemplate)Page.Master).ShowWarning(ex);
            }
        }
        private void FillEqDeductionGrid()
        {
            const string METHOD_NAME = "FillEqDeductionGrid";

            try {
                List <ListEquityDeductionItem> stateList = BeetEquityDeduction.EquityDeductionGetAll();

                grdEqDeduction.SelectedIndex = -1;
                grdEqDeduction.DataSource    = stateList;
                grdEqDeduction.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"));
                ((HarvestReportTemplate)Master).LocPDF = "";

                // Sink the Master page events...
                ((HarvestReportTemplate)Master).PrintReady += new CommandEventHandler(DoPrintReady);
            }
            catch (System.Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                ((HarvestReportTemplate)Page.Master).ShowWarning(ex);
            }
        }
Beispiel #30
0
 private void ClearEditArea()
 {
     try {
         if (grdUserResults.Rows.Count > 0)
         {
             grdUserResults.SelectedIndex = -1;
         }
         chkUserEditIsActive.Checked     = false;
         lstUserEditRegion.SelectedIndex = -1;
         lstUserEditRole.SelectedIndex   = -1;
     }
     catch (Exception ex) {
         Common.CException wex = new Common.CException("Security.FillEditArea", ex);
         throw (wex);
     }
 }
Beispiel #31
0
        protected void Page_Load(object sender, EventArgs e)
        {
            const string METHOD_NAME = "Page_Load";

            try {
                Common.AppHelper.HideWarning((HtmlGenericControl)Master.FindControl("divWarning"));
                ((MasterReportTemplate)Master).LocPDF = "";

                // Sink the Master page event, PrintReady
                ((MasterReportTemplate)Page.Master).PrintReady += new CommandEventHandler(DoPrintReady);
            }
            catch (System.Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                ((MasterReportTemplate)Page.Master).ShowWarning(ex);
            }
        }
Beispiel #32
0
        private void FillPaymentDesc()
        {
            const string METHOD_NAME = "FillPaymentDesc";

            try {
                ddlTxPaymentDesc.Items.Clear();
                ddlTxStatementDate.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 transmitted payments.
                    if (state.TransmittalDate.Length > 0)
                    {
                        int    paymentNumber = Convert.ToInt32(state.PaymentNumber);
                        string paymentDesc   = state.PaymentDesc;

                        ListItem liDesc = new ListItem(paymentDesc, paymentNumber.ToString());
                        ddlTxPaymentDesc.Items.Add(liDesc);

                        ddlTxStatementDate.Items.Add(state.TransmittalDate);
                    }
                }

                // Handle empty controls.
                if (ddlTxPaymentDesc.Items.Count == 0)
                {
                    ddlTxPaymentDesc.Items.Add("None Available");
                    ddlTxStatementDate.Items.Add(" ");
                    txtStatementDate.Text = " ";
                }

                if (ddlTxPaymentDesc.Items.Count > 0)
                {
                    ddlTxPaymentDesc.SelectedIndex   = 0;
                    ddlTxStatementDate.SelectedIndex = 0;
                    txtStatementDate.Text            = Common.UILib.GetDropDownText(ddlTxStatementDate);
                }
            }
            catch (Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                throw (wex);
            }
        }
Beispiel #33
0
        protected void btnAddLab_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = "btnAddLab_Click";

            try {
                if (grdFieldResults.SelectedRow == null)
                {
                    Common.CWarning warn = new Common.CWarning("You must first select a field in the Contract Fields grid.");
                    throw (warn);
                }

                ArrayList selectedIDs = GetSelectedIDs(grdOtherLabResults, "chkAllLabsSelection", "lblAllLabsSoilSampleLabID");
                if (selectedIDs.Count == 0)
                {
                    Common.CWarning warn = new Common.CWarning("You must select a lab result in the All Lab Results grid.");
                    throw (warn);
                }
                if (selectedIDs.Count > 1)
                {
                    Common.CWarning warn = new Common.CWarning("Please select only one All Lab Results lab to add to the Field.");
                    throw (warn);
                }

                string fieldName = grdOtherLabResults.SelectedRow.Cells[3].Text.Replace(BLANK_CELL, "");
                if (fieldName.Length > 0)
                {
                    string          contract = grdOtherLabResults.SelectedRow.Cells[2].Text.Replace(BLANK_CELL, "");
                    Common.CWarning warn     = new Common.CWarning("This lab already belongs to contract " + contract + " and field " + fieldName + ".");
                    throw (warn);
                }

                int cropYear        = CropYear;
                int fieldID         = Convert.ToInt32(grdFieldResults.SelectedRow.Cells[0].Text.Replace(BLANK_CELL, ""));
                int soilSampleLabID = Convert.ToInt32(grdOtherLabResults.SelectedRow.Cells[1].Text.Replace(BLANK_CELL, ""));

                using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["BeetConn"].ToString())) {
                    WSCField.FieldSampleLabSave(conn, fieldID, cropYear, soilSampleLabID);
                }

                FillFieldLabResults();
                FillOtherLabResults();
            }
            catch (System.Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                ((PrimaryTemplate)Page.Master).ShowWarning(ex);
            }
        }
Beispiel #34
0
        protected void btnPost_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = "btnPost_Click";

            /*
             *  <?xml version="1.0" standalone="yes" ?>
             *  <NewDataSet>
             *      <Table>
             *          <Contract>10018</Contract>
             *          <Amount>43.22</Amount>
             *          <Deduction>1,2</Deduction>
             *      </Table>
             *  </NewDataSet>
             */
            try {
                string xmlData = "";

                // Retrieve the xml document of deductions: contract, amount, and deduction.
                string selectedPath = lblOrigPath.Text;
                if (selectedPath.StartsWith(FILE_LABEL))
                {
                    selectedPath = selectedPath.Substring(FILE_LABEL.Length);
                }

                string fileName = System.IO.Path.GetFileName(selectedPath);
                string filePath = Server.MapPath(@"~/PDF") + @"\" + fileName;

                string xmlFilePath = filePath.Replace(System.IO.Path.GetExtension(filePath), ".xml");
                using (System.IO.StreamReader reader = new StreamReader(xmlFilePath)) {
                    xmlData = reader.ReadToEnd().Replace("\r\n", "");
                }

                int cropYear = Convert.ToInt32(Common.UILib.GetDropDownText(ddlCropYear));

                // Send this xml document, the crop year, and user name to the database.
                WSCSecurity auth = Globals.SecurityState;
                WSCAdmin.ContractDeductionSave(cropYear, auth.UserName, xmlData);

                // We only get here if everything works.
                lblOrigPath.Visible = true;
                lblOrigPath.Text    = "Successfully Posted Deductions for: " + fileName;
            }
            catch (Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                ((PrimaryTemplate)Page.Master).ShowWarning(ex);
            }
        }
Beispiel #35
0
        protected void btnAddDeduction_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = "btnAddDeduction_Click";

            try {
                GridViewRow row = grdPayment.SelectedRow;
                if (row == null)
                {
                    Common.CWarning warn = new WSCIEMP.Common.CWarning("Before pressing Add, please select a Payment from the Available Equity Payments grid.");
                    throw (warn);
                }

                //--------------------------------------------------
                // Marry a Member to a Deduction and a payment.
                //--------------------------------------------------
                int    equityCropYear    = Convert.ToInt32(row.Cells[(int)PaymentGridCols.colEquityCropYear].Text);
                string equityType        = row.Cells[(int)PaymentGridCols.colEquityType].Text;
                int    sequence          = Convert.ToInt32(row.Cells[(int)PaymentGridCols.colSequence].Text);
                string paymentDesc       = row.Cells[(int)PaymentGridCols.colPaymentDesc].Text;
                int    equityDeductionID = Convert.ToInt32(Common.UILib.GetDropDownValue(ddlEquityDeductions));
                int    memberID          = Convert.ToInt32(MyMemberID);
                int    cropYear          = Convert.ToInt32(Common.UILib.GetDropDownText(ddlCropYear));

                string  amountText      = txtDeductionAmount.Text.TrimEnd().Replace(BLANK_CELL, "");
                decimal deductionAmount = 0;
                try {
                    deductionAmount = Convert.ToDecimal(amountText);
                }
                catch {
                    Common.CWarning warn = new WSCIEMP.Common.CWarning("Please enter a positive number for Deduction Amount.");
                    throw (warn);
                }

                string   userName      = Common.AppHelper.GetIdentityName();
                DateTime deductionDate = Convert.ToDateTime(DateTime.Now.ToShortDateString());

                BeetEquityDeduction.EquityDeductionMemberSave(0, memberID, equityDeductionID,
                                                              equityCropYear, cropYear, equityType, sequence, paymentDesc, deductionAmount, deductionDate, "", userName);

                ClearEdit();
                FillGridEqDeduction(MySHID, cropYear);
            }
            catch (Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                ((PrimaryTemplate)Page.Master).ShowWarning(ex);
            }
        }
        private void ShowBankEquityList(int memberID, int cropYear)
        {
            ClearBankEquityList();

            try {
                using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["BeetConn"].ToString())) {
                    using (SqlDataReader dr = WSCBank.BankEquityGetList(conn, memberID, cropYear)) {
                        grdEquityResults.DataSource = dr;
                        grdEquityResults.DataBind();
                    }
                }
            }
            catch (Exception ex) {
                Common.CException wex = new Common.CException("BankMaintenance.ShowBankEquityList", ex);
                throw (wex);
            }
        }
Beispiel #37
0
        private void FindAddress(string shid)
        {
            const string METHOD_NAME = "FindAddress";

            if (!Common.CodeLib.IsValidSHID(shid))
            {
                ResetShareholder();
                Common.AppHelper.ShowWarning((HtmlGenericControl)Master.FindControl("divWarning"), "Please enter a valid SHID.");
                return;
            }

            try {
                ResetMemberInfo(shid);

                txtSHID.Text    = SHID.ToString();
                lblBusName.Text = _busName;
                txtEmail.Text   = _emailAddress;
                txtFax.Text     = _fax;

                if (txtEmail.Text.Length == 0)
                {
                    lblEmail.CssClass = "WarningOn";
                    lblEmail.Text     = "* Missing *";
                }
                else
                {
                    lblEmail.CssClass = "WarningOff";
                    lblEmail.Text     = "";
                }

                if (txtFax.Text.Length == 0)
                {
                    lblFax.CssClass = "WarningOn";
                    lblFax.Text     = "* Missing *";
                }
                else
                {
                    lblFax.CssClass = "WarningOff";
                    lblFax.Text     = "";
                }
            }
            catch (System.Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                throw (wex);
            }
        }
Beispiel #38
0
        protected void btnUpload_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = "btnUpload_Click";

            try {
                if (uploadFile.PostedFile != null)
                {
                    string filePath = uploadFile.PostedFile.FileName;

                    lblOrigPath.Visible = true;
                    lblOrigPath.Text    = FILE_LABEL + filePath;

                    if (!filePath.ToUpper().EndsWith("XLS"))
                    {
                        WSCIEMP.Common.CWarning warn = new WSCIEMP.Common.CWarning("You must selet an Excel workbook to upload.");
                        throw (warn);
                    }

                    string fileName         = System.IO.Path.GetFileName(filePath);
                    string saveFileFullName = Server.MapPath(@"~/PDF") + @"\" + fileName;
                    uploadFile.PostedFile.SaveAs(saveFileFullName);

                    // We only get here if everything works.
                    lblOrigPath.Visible = true;
                    lblOrigPath.Text    = FILE_LABEL + fileName;

                    // Now process the saveFileFullName
                    FillResults(saveFileFullName);

                    if (grdResults.Rows.Count > 0)
                    {
                        btnDelete.Enabled = true;
                        btnPost.Enabled   = true;
                    }
                    else
                    {
                        btnDelete.Enabled = false;
                        btnPost.Enabled   = false;
                    }
                }
            }
            catch (Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                ((PrimaryTemplate)Page.Master).ShowWarning(ex);
            }
        }
Beispiel #39
0
        protected void btnResolveShid_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = "btnResolveShid_Click";

            try {
                string shid = txtSHID.Text;
                FindAddress(shid);

                int cropYear = Convert.ToInt32(Common.UILib.GetDropDownText(ddlCropYear));
                FillGridEqDeduction(shid, cropYear);
                FillGridEqPayment(shid, _paymentDate);
            }
            catch (System.Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                ((PrimaryTemplate)Page.Master).ShowWarning(ex);
            }
        }
Beispiel #40
0
        private void FillDescriptionDetails()
        {
            const string METHOD_NAME = "FillDescriptionDetails";

            try {
                string   itemData = ddlDescription.SelectedItem.Value;
                string[] vals     = itemData.Split(new char[] { '^' });
                bool     isActive = (vals[0] == "1");

                chkIsActive.Checked = isActive;
                txtDescription.Text = vals[1];
            }
            catch (Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                throw (wex);
            }
        }
Beispiel #41
0
        protected void Page_Load(object sender, EventArgs e)
        {
            const string METHOD_NAME = "Page_Load";

            try {
                Common.AppHelper.HideWarning((HtmlGenericControl)Master.FindControl("divWarning"));

                if (!Page.IsPostBack)
                {
                    string lastArea   = "";
                    bool   isAddOk    = false;
                    bool   isDeleteOk = false;
                    try { isDeleteOk = bool.Parse(Request["DeleteOk"].ToString()); }
                    catch {}

                    if (isDeleteOk)
                    {
                        Common.AppHelper.ShowConfirmation((HtmlGenericControl)Master.FindControl("divWarning"), "Record was Deleted");
                    }
                    else
                    {
                        try { isAddOk = bool.Parse(Request["AddOk"].ToString()); }
                        catch {}

                        if (isAddOk)
                        {
                            Common.AppHelper.ShowConfirmation((HtmlGenericControl)Master.FindControl("divWarning"), "Record was Added");
                        }
                    }


                    if (isDeleteOk || isAddOk)
                    {
                        try { lastArea = Request["lastArea"].ToString(); }
                        catch { }
                    }

                    FillFactoryArea(lastArea);
                    FillSeedVarietyGrid();
                }
            }
            catch (System.Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                ((PrimaryTemplate)Page.Master).ShowWarning(ex);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            const string METHOD_NAME = "Page_Load";

            Common.AppHelper.HideWarning((HtmlGenericControl)Master.FindControl("divWarning"));
            ((HarvestReportTemplate)Master).LocPDF = "";

            ((HarvestReportTemplate)Master).PrintReady += new CommandEventHandler(DoPrintReady);

            try {
                // Hide Master page Crop Year control
                DropDownList ddlMasterCropYear = (DropDownList)((HarvestReportTemplate)Master).FindControl("ddlCropYear");
                ddlMasterCropYear.CssClass = "DisplayOff";

                HtmlGenericControl lblMasterCropYear = (HtmlGenericControl)((HarvestReportTemplate)Master).FindControl("lblCropYear");
                lblMasterCropYear.Attributes.Add("class", "DisplayOff");

                if (!Page.IsPostBack)
                {
                    radCalYear.Checked = true;
                    WSCField.FillCropYear(ddlYear, DateTime.Now.Year.ToString());

                    // Only allow years from 2010 forward.
                    for (int i = ddlYear.Items.Count - 1; i >= 0; i--)
                    {
                        if (Convert.ToInt32(ddlYear.Items[i].Value) < 2010)
                        {
                            ddlYear.Items.Remove(ddlYear.Items[i]);
                        }
                    }
                }
                _shs = Globals.ShsData;
            }
            catch (System.Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                if (Common.AppHelper.IsDebugBuild())
                {
                    Common.AppHelper.ShowWarning((HtmlGenericControl)Master.FindControl("divWarning"), wex);
                }
                else
                {
                    Common.AppHelper.ShowWarning((HtmlGenericControl)Master.FindControl("divWarning"), "Unable to load page correctly at this time.", wex);
                    Common.AppHelper.LogException(wex, HttpContext.Current);
                }
            }
        }
        private void ShowFieldDescription(int contractID, int sequenceNumber)
        {
            try {
                ClearFieldDescription();

                using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["BeetConn"].ToString())) {
                    using (SqlDataReader dr = WSCField.CntLldGetDetail(conn, UsrCntSelector.ContractID, UsrCntSelector.SequenceNumber)) {
                        if (dr.Read())
                        {
                            UsrCntSelector.CntLLDID  = dr.GetInt32(dr.GetOrdinal("cntlld_cntlld_id"));
                            UsrCntSelector.LldID     = dr.GetInt32(dr.GetOrdinal("cntlld_lld_id"));
                            UsrCntSelector.FieldName = dr.GetString(dr.GetOrdinal("cntlld_field_name"));

                            UsrCntSelector.FsaNumber  = dr.GetString(dr.GetOrdinal("cntlld_fsa_number"));
                            UsrCntSelector.FieldState = dr.GetString(dr.GetOrdinal("cntlld_state"));

                            lblFieldName.Text       = dr.GetString(dr.GetOrdinal("cntlld_field_name"));
                            lblFsaNumber.Text       = dr.GetString(dr.GetOrdinal("cntlld_fsa_number"));
                            lblState.Text           = dr.GetString(dr.GetOrdinal("cntlld_state"));
                            lblCounty.Text          = dr.GetString(dr.GetOrdinal("cntlld_county"));
                            lblTownship.Text        = dr.GetString(dr.GetOrdinal("cntlld_township"));
                            lblRange.Text           = dr.GetString(dr.GetOrdinal("cntlld_range"));
                            lblSection.Text         = dr.GetString(dr.GetOrdinal("cntlld_section"));
                            lblQuadrant.Text        = dr.GetString(dr.GetOrdinal("cntlld_quadrant"));
                            lblQuarterQuadrant.Text = dr.GetString(dr.GetOrdinal("cntlld_quarter_quadrant"));
                            lblLongitude.Text       = (dr.GetDecimal(dr.GetOrdinal("cntlld_latitude"))).ToString();
                            lblLatitude.Text        = (dr.GetDecimal(dr.GetOrdinal("cntlld_longitude"))).ToString();
                            lblFsaOfficial.Text     = (dr.GetBoolean(dr.GetOrdinal("cntlld_fsa_official")) ? "Yes" : "No");
                            lblAcres.Text           = dr.GetInt32(dr.GetOrdinal("cntlld_acres")).ToString();
                            lblDescription.Text     = dr.GetString(dr.GetOrdinal("cntlld_description"));

                            lblFsaState.Text     = dr.GetString(dr.GetOrdinal("cntlld_fsa_state"));
                            lblFsaCounty.Text    = dr.GetString(dr.GetOrdinal("cntlld_fsa_county"));
                            lblFarmNo.Text       = dr.GetString(dr.GetOrdinal("cntlld_farm_number"));
                            lblTractNo.Text      = dr.GetString(dr.GetOrdinal("cntlld_tract_number"));
                            lblFieldNo.Text      = dr.GetString(dr.GetOrdinal("cntlld_field_number"));
                            lblQuarterField.Text = dr.GetString(dr.GetOrdinal("cntlld_quarter_field"));
                        }
                    }
                }
            }
            catch (Exception ex) {
                Common.CException wex = new Common.CException("FieldContracting.ShowFieldDescription", ex);
                throw (wex);
            }
        }
Beispiel #44
0
        private void DoPrintReady(object sender, CommandEventArgs e)
        {
            const string METHOD_NAME = "DoPrintReady";

            try {
                WSCSecurity auth          = Globals.SecurityState;
                string      logoUrl       = Page.MapPath(WSCReportsExec.GetReportLogo());
                string      pdfTempFolder = Page.MapPath(WSCReportsExec.GetPDFFolderPath());
                string      fileName      = auth.UserID + "_" + ((MasterReportTemplate)Master).ReportName.Replace(" ", "");
                string      cropYear      = ((MasterReportTemplate)Master).CropYear;

                string   letterDate   = txtLlLetterDate.Text;
                DateTime dtLetterDate = DateTime.Now;
                try {
                    dtLetterDate = Convert.ToDateTime(letterDate);
                }
                catch {
                    Common.CWarning warn = new WSCIEMP.Common.CWarning("Please enter a valid Leter Date.");
                    throw(warn);
                }
                string   deadlineDate   = txtLlDeadlineDate.Text;
                DateTime dtDeadlineDate = DateTime.Now;
                try {
                    dtDeadlineDate = Convert.ToDateTime(deadlineDate);
                }
                catch {
                    Common.CWarning warn = new WSCIEMP.Common.CWarning("Please enter a valid Deadline Date.");
                    throw(warn);
                }

                string pdf = WSCReports.rptLandownerLetter.ReportPackager(Convert.ToInt32(cropYear), dtLetterDate, dtDeadlineDate,
                                                                          _factoryList, _stationList, _contractList, fileName, logoUrl, pdfTempFolder);

                if (pdf.Length > 0)
                {
                    // convert file system path to virtual path
                    pdf = pdf.Replace(Common.AppHelper.AppPath(), Page.ResolveUrl("~")).Replace(@"\", @"/");
                }

                ((MasterReportTemplate)sender).LocPDF = pdf;
            }
            catch (System.Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                ((MasterReportTemplate)Page.Master).ShowWarning(ex);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            const string METHOD_NAME = "Page_Load";

            try {
                Common.AppHelper.HideWarning((HtmlGenericControl)Master.FindControl("divWarning"));

                if (!Page.IsPostBack)
                {
                    FillEqDeductionGrid();
                }
            }
            catch (System.Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                ((PrimaryTemplate)Page.Master).ShowWarning(ex);
            }
        }
Beispiel #46
0
        private void FillEditSeverity()
        {
            const string METHOD_NAME = "FillEditSeverity";

            try {
                ddlEditSeverity.Items.Add("");
                ddlEditSeverity.Items.Add("Critical");
                ddlEditSeverity.Items.Add("High");
                ddlEditSeverity.Items.Add("Medium");
                ddlEditSeverity.Items.Add("Low");
                ddlEditSeverity.SelectedIndex = 0;
            }
            catch (Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                throw (wex);
            }
        }
Beispiel #47
0
        protected void Page_Load(object sender, EventArgs e)
        {
            const string METHOD_NAME = "Page_Load";

            try {

                Common.AppHelper.HideWarning((HtmlGenericControl)Master.FindControl("divWarning"));

                if (!Page.IsPostBack) {
                    tvwBrowse.Nodes[0].Value = Server.MapPath(tvwBrowse.Nodes[0].NavigateUrl);
                }
            }
            catch (System.Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                ((PrimaryTemplate)Page.Master).ShowWarning(ex);
            }
        }
Beispiel #48
0
        protected void Page_Load(object sender, EventArgs e)
        {
            const string METHOD_NAME = "Page_Load";

            try {
                Common.AppHelper.HideWarning((HtmlGenericControl)Master.FindControl("divWarning"));

                if (!Page.IsPostBack)
                {
                    tvwBrowse.Nodes[0].Value = Server.MapPath(tvwBrowse.Nodes[0].NavigateUrl);
                }
            }
            catch (System.Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                ((PrimaryTemplate)Page.Master).ShowWarning(ex);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            const string METHOD_NAME = "Page_Load";

            try {
                Common.AppHelper.HideWarning((HtmlGenericControl)Master.FindControl("divWarning"));

                if (!Page.IsPostBack)
                {
                    WSCField.FillCropYear(ddlCropYear, DateTime.Now.Year.ToString());
                }
            }
            catch (System.Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                ((PrimaryTemplate)Page.Master).ShowWarning(ex);
            }
        }
Beispiel #50
0
        protected void btnResolveToShid_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = "btnResolveToShid_Click";

            try {
                string shid     = txtToSHID.Text;
                int    cropYear = Convert.ToInt32(Common.UILib.GetDropDownText(ddlCropYear));
                FindToAddress(shid, cropYear);
                FillGridToSummary(Convert.ToInt32(MyToMemberID), cropYear);
                ResetTransferEdit();
                FillTransferGrid(Convert.ToInt32(MyToMemberID), cropYear);
            }
            catch (System.Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                ((PrimaryTemplate)Page.Master).ShowWarning(ex);
            }
        }
Beispiel #51
0
        protected void btnFind_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = "btnFind_Click";

            string shid = txtSHID.Text;

            try {
                if (((HtmlGenericControl)Master.FindControl("divWarning")).InnerHtml.Length == 0)
                {
                    FindAddress(shid);
                }
            }
            catch (Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                ((PrimaryTemplate)Page.Master).ShowWarning(ex);
            }
        }
Beispiel #52
0
        protected void btnCYOk_Click(object sender, EventArgs e)
        {
            const string METHOD_NAME = "btnCYOk_Click";

            try {
                string pdfFile  = "";
                int    cropYear = Convert.ToInt32(Common.UILib.GetDropDownText(ddlCropYear)); // txtCYFirstCropYear
                string lastcy   = txtLastCropYear.Text;
                if (lastcy == "")
                {
                    lastcy = cropYear.ToString();
                }
                int lastCropYear = Convert.ToInt32(lastcy);     // if we didn't capture the last crop year, let the guy print using from/to cy equal
                                                                // the current crop year.  Then user can print and report this as a bug.

                GridViewRow row = grdTransfers.SelectedRow;
                if (row == null)
                {
                    Common.CWarning warn = new WSCIEMP.Common.CWarning("Before printing, please select a transfer from the Transferee -- Temp Transfer listing.");
                    throw (warn);
                }

                int shareTransferID = Convert.ToInt32(row.Cells[(int)TempTransferCols.colShareTransferID].Text);

                WSCSecurity auth = Globals.SecurityState;
                pdfFile = ConfigurationManager.AppSettings["appControl.rptServer"].ToString() +
                          "?RPTSEL=TEMPTRANSFER" +
                          "&USR="******"&PRMS=" + Common.CodeLib.EncodeString(ConfigurationManager.ConnectionStrings["BeetConn"].ToString()) +
                          "^" + cropYear.ToString() +        // int first crop year: actual crop year.
                          "^" + lastCropYear.ToString() +    // int last crop year
                          "^-1" +                            // int contractID; -1 when no contract
                          "^" + shareTransferID.ToString() + // int shareTransferID
                          "^";                               // string save path

                locPDF.Text = pdfFile.Replace("localhost", System.Environment.MachineName);
                //uplCropYearFinder.Update();

                //CloseAndPrint();
            }
            catch (System.Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                ((PrimaryTemplate)Page.Master).ShowWarning(ex);
            }
        }
Beispiel #53
0
        protected void grdEqDeduction_SelectedIndexChanged(object sender, EventArgs e)
        {
            const string METHOD_NAME = "grdEqDeduction_SelectedIndexChanged";

            GridViewRow row = grdEqDeduction.SelectedRow;

            try {
                ListMemberEquityDeductionItem state = new ListMemberEquityDeductionItem(row.Cells[(int)EqDedGridCols.colMemberEquityDeductionID].Text,
                                                                                        row.Cells[(int)EqDedGridCols.colEquityDeductionID].Text, row.Cells[(int)EqDedGridCols.colRowVersion].Text,
                                                                                        row.Cells[(int)EqDedGridCols.colEquityCropYear].Text, row.Cells[(int)EqDedGridCols.colEquityType].Text,
                                                                                        row.Cells[(int)EqDedGridCols.colSequence].Text,
                                                                                        row.Cells[(int)EqDedGridCols.colPayDesc].Text, row.Cells[(int)EqDedGridCols.colDeductionDesc].Text,
                                                                                        row.Cells[(int)EqDedGridCols.colDeductionAmount].Text);

                // Populate edit controls
                txtDeductionAmount.Text = state.DeductionAmount;
                Common.UILib.SelectDropDownValue(ddlEquityDeductions, state.EquityDeductionID);
                string equityCropYear = state.EquityCropYear;

                foreach (GridViewRow payRow in grdPayment.Rows)
                {
                    if (payRow.Cells[(int)PaymentGridCols.colEquityCropYear].Text == equityCropYear &&
                        payRow.Cells[(int)PaymentGridCols.colEquityType].Text == state.EquityType &&
                        payRow.Cells[(int)PaymentGridCols.colSequence].Text == state.PaySequence)
                    {
                        //---------------------------------------------------------------------------------------
                        // given a match on equity crop year + equity type + payment desc, highlight the row
                        //---------------------------------------------------------------------------------------
                        grdPayment.SelectedIndex = payRow.DataItemIndex;
                        break;
                    }
                }

                //----------------------------------------------------------
                // With a selected row, you can only add, update, & delete
                //----------------------------------------------------------
                btnAddDeduction.Enabled    = true;
                btnUpdateDeduction.Enabled = true;
                btnDeleteDeduction.Enabled = true;
            }
            catch (System.Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                ((PrimaryTemplate)Page.Master).ShowWarning(ex);
            }
        }
Beispiel #54
0
        private void DoPrintReady(object sender, CommandEventArgs e)
        {
            const string METHOD_NAME = "DoPrintReady";

            try {
                WSCSecurity auth          = Globals.SecurityState;
                string      logoUrl       = Page.MapPath(WSCReportsExec.GetReportLogo());
                string      pdfTempFolder = Page.MapPath(WSCReportsExec.GetPDFFolderPath());
                string      fileName      = txtCcFileName.Text;

                // Check required fields: crop year, start #, stop #, file name.
                string contractNumberStart = txtCcContractNumberStart.Text;
                if (contractNumberStart.Length == 0)
                {
                    Common.CWarning warn = new Common.CWarning("Please enter the First Contract Number.");
                    throw (warn);
                }
                string contractNumberStop = txtCcContractNumberStop.Text;
                if (contractNumberStop.Length == 0)
                {
                    Common.CWarning warn = new Common.CWarning("Please enter the Last Contract Number.");
                    throw (warn);
                }
                if (fileName.Length == 0)
                {
                    Common.CWarning warn = new Common.CWarning("Please enter a file name.");
                    throw (warn);
                }

                string cropYear = ((MasterReportTemplate)Master).CropYear;
                string pdf      = WSCReports.rptContractCards.ReportPackager(cropYear, contractNumberStart, contractNumberStop, fileName, logoUrl, pdfTempFolder);

                if (pdf.Length > 0)
                {
                    // convert file system path to virtual path
                    pdf = pdf.Replace(Common.AppHelper.AppPath(), Page.ResolveUrl("~")).Replace(@"\", @"/");
                }

                ((MasterReportTemplate)sender).LocPDF = pdf;
            }
            catch (System.Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                ((MasterReportTemplate)Page.Master).ShowWarning(ex);
            }
        }
Beispiel #55
0
        private void SelectTransferGridItem(string shareTransferID)
        {
            const string METHOD_NAME = "SelectTransferGridItem";

            try {
                foreach (GridViewRow row in grdTransfers.Rows)
                {
                    if (row.Cells[(int)TempTransferCols.colShareTransferID].Text == shareTransferID)
                    {
                        grdTransfers.SelectedIndex = row.RowIndex;
                    }
                }
            }
            catch (Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                throw (wex);
            }
        }
Beispiel #56
0
        private void FillGridToSummary(int memberID, int cropYear)
        {
            const string METHOD_NAME = "FillGridToSummary";

            try {
                List <ListMemberStockSummaryItem> itemList = BeetDataMember.MemberStockGetSummary(memberID, cropYear);

                grdToSummary.DataSource = itemList;
                grdToSummary.DataBind();

                grdToSummary2.DataSource = itemList;
                grdToSummary2.DataBind();
            }
            catch (Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                throw (wex);
            }
        }
Beispiel #57
0
        protected void grdDirectDelivery_SelectedIndexChanged(object sender, EventArgs e)
        {
            const string METHOD_NAME = "grdDirectDelivery_SelectedIndexChanged";

            try {
                ResetContractEdit();
                PopDirectDeliveryEdit();
                FillContractList();
                FillGridContract();
                PopContractEdit();

                //grdDirectDelivery.SelectedRow.Focus();
            }
            catch (System.Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                ((PrimaryTemplate)Page.Master).ShowWarning(ex);
            }
        }
Beispiel #58
0
        private void GetShareholder(int shid, int cropYear)
        {
            try {
                int    memberID = 0, addressID = 0;
                string phone = "", email = "", fax = "";

                WSCMember.GetInfo(shid.ToString(), ref memberID, ref addressID, ref _busName, ref phone, ref email, ref fax);

                SHID      = shid;
                CropYear  = cropYear;
                MemberID  = memberID;
                AddressID = addressID;
            }
            catch (Exception ex) {
                Common.CException wex = new Common.CException("UserContractSelector.GetShareholder", ex);
                throw (wex);
            }
        }
Beispiel #59
0
        private ArrayList GetAllGridIDs(GridView grd, string labelName)
        {
            const string METHOD_NAME = "GetAllGridIDs";

            try {
                ArrayList rtn = new ArrayList();
                foreach (GridViewRow dgi in grd.Rows)
                {
                    rtn.Add(((Label)dgi.FindControl(labelName)).Text);
                }

                return(rtn);
            }
            catch (Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                throw (wex);
            }
        }
Beispiel #60
0
        private void DoPrintReady(object sender, CommandEventArgs e)
        {
            const string METHOD_NAME = "DoPrintReady";

            try {

                WSCSecurity auth = Globals.SecurityState;
                string logoUrl = Page.MapPath(WSCReportsExec.GetReportLogo());
                string pdfTempFolder = Page.MapPath(WSCReportsExec.GetPDFFolderPath());
                string fileName = txtCcFileName.Text;

                // Check required fields: crop year, start #, stop #, file name.
                string contractNumberStart = txtCcContractNumberStart.Text;
                if (contractNumberStart.Length == 0) {
                    Common.CWarning warn = new Common.CWarning("Please enter the First Contract Number.");
                    throw (warn);
                }
                string contractNumberStop = txtCcContractNumberStop.Text;
                if (contractNumberStop.Length == 0) {
                    Common.CWarning warn = new Common.CWarning("Please enter the Last Contract Number.");
                    throw (warn);
                }
                if (fileName.Length == 0) {
                    Common.CWarning warn = new Common.CWarning("Please enter a file name.");
                    throw (warn);
                }

                string cropYear = ((MasterReportTemplate)Master).CropYear;
                string pdf = WSCReports.rptContractCards.ReportPackager(cropYear, contractNumberStart, contractNumberStop, fileName, logoUrl, pdfTempFolder);

                if (pdf.Length > 0) {
                    // convert file system path to virtual path
                    pdf = pdf.Replace(Common.AppHelper.AppPath(), Page.ResolveUrl("~")).Replace(@"\", @"/");
                }

                ((MasterReportTemplate)sender).LocPDF = pdf;
            }
            catch (System.Exception ex) {
                Common.CException wex = new Common.CException(MOD_NAME + METHOD_NAME, ex);
                ((MasterReportTemplate)Page.Master).ShowWarning(ex);
            }
        }