Exemple #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         imgWACLogo.ImageUrl = "~/App_Themes/" + Page.Theme + "/images/WAClogo.jpg";
         Utility_WACUT_AttachedDocumentViewer docView = WACUT_AttachedDocumentViewer;
         List <WACParameter> parms = new List <WACParameter>();
         docView.InitControl(parms);
         Response.Redirect("~/Ag/WACAgriculture.aspx");
     }
 }
Exemple #2
0
    private void BindAg_WFP3()
    {
        using (WACDataClassesDataContext wDataContext = new WACDataClassesDataContext())
        {
            ListView lv;

            var a = wDataContext.form_wfp3s.Where(w => w.pk_form_wfp3 == PK_FormWfp3).Select(s => s);
            fvAg_WFP3.DataKeyNames = new string[] { "pk_form_wfp3" };
            fvAg_WFP3.DataSource   = a;
            fvAg_WFP3.DataBind();

            //lvAg_WFP3_BMPs
            lv = pnlSubPanels.FindControl("lvAg_WFP3_BMPs") as ListView;
            var c = from b in wDataContext.vw_form_wfp3_BMPs.Where(w => w.pk_form_wfp3 == PK_FormWfp3) select b;
            lv.DataKeyNames = new string[] { "pk_form_wfp3_bmp" };
            lv.DataSource   = c;
            lv.DataBind();

            //lvAg_WFP3_Bids
            lv = pnlSubPanels.FindControl("lvAg_WFP3_Bids") as ListView;
            var d = from b in wDataContext.form_wfp3_bids.Where(w => w.fk_form_wfp3 == PK_FormWfp3) select b;
            lv.DataKeyNames = new string[] { "pk_form_wfp3_bid" };
            lv.DataSource   = d;
            lv.DataBind();

            //lvAg_WFP3_Encumbrances
            lv = pnlSubPanels.FindControl("lvAg_WFP3_Encumbrances") as ListView;
            var e = from b in wDataContext.form_wfp3_encumbrances.Where(w => w.fk_form_wfp3 == PK_FormWfp3) select b;
            lv.DataKeyNames = new string[] { "pk_form_wfp3_encumbrance" };
            lv.DataSource   = e;
            lv.DataBind();

            //lvAg_WFP3_Invoices
            lv = pnlSubPanels.FindControl("lvAg_WFP3_Invoices") as ListView;
            var i = from b in wDataContext.form_wfp3_invoices.Where(w => w.fk_form_wfp3 == PK_FormWfp3) select b;
            lv.DataKeyNames = new string[] { "pk_form_wfp3_invoice" };
            lv.DataSource   = i;
            lv.DataBind();

            //lvAg_WFP3_Payments
            lv = pnlSubPanels.FindControl("lvAg_WFP3_Payments") as ListView;
            var p = from b in wDataContext.form_wfp3_payments.Where(w => w.fk_form_wfp3 == PK_FormWfp3) select b;
            lv.DataKeyNames = new string[] { "pk_form_wfp3_payment" };
            lv.DataSource   = p;
            lv.DataBind();

            //lvAg_WFP3_Modifications
            lv = pnlSubPanels.FindControl("lvAg_WFP3_Modifications") as ListView;
            var m = from b in wDataContext.form_wfp3_modifications.Where(w => w.fk_form_wfp3 == PK_FormWfp3) select b;
            lv.DataKeyNames = new string[] { "pk_form_wfp3_modification" };
            lv.DataSource   = m;
            lv.DataBind();

            //lvAg_WFP3_Specifications"
            lv = pnlSubPanels.FindControl("lvAg_WFP3_Specifications") as ListView;
            var sp = from b in wDataContext.form_wfp3_specifications.Where(w => w.fk_form_wfp3 == PK_FormWfp3) select b;
            lv.DataKeyNames = new string[] { "pk_form_wfp3_specification" };
            lv.DataSource   = sp;
            lv.DataBind();

            //lvAg_WFP3_Techs
            lv = pnlSubPanels.FindControl("lvAg_WFP3_Techs") as ListView;
            var t = from b in wDataContext.form_wfp3_teches.Where(w => w.fk_form_wfp3 == PK_FormWfp3) select b;
            lv.DataKeyNames = new string[] { "pk_form_wfp3_tech" };
            lv.DataSource   = t;
            lv.DataBind();


            litAg_WFP3_Header.Text = WACGlobal_Methods.SpecialText_Agriculture_PopUpHeader(FK_FarmBusiness);
            string sWACRegion = WACGlobal_Methods.SpecialQuery_Agriculture_GetWACRegion_ByFarmBusinessPK(FK_FarmBusiness);

            Create_Agriculture_WFP3_Basic_Grid(PK_FormWfp3);
            Create_Agriculture_WFP3_Encumbrance_CurrentlyAssigned_Summary_Grid(PK_FormWfp3);
            Create_Agriculture_WFP3_Encumbrance_Possible_Summary_Grid(PK_FormWfp3);
            Create_Agriculture_WFP3_PaymentBMP_PaymentStatus_Grid(PK_FormWfp3);
            CreateAgWFP3PaymentBMPFundingOverviewGrid(PK_FormWfp3);

            if (fvAg_WFP3.CurrentMode == FormViewMode.ReadOnly && a.Count() == 1)
            {
                UpdatePanel up = (UpdatePanel)pnlAg_WFP3.FindControl("upAg_WFP3");
                Utility_WACUT_AttachedDocumentViewer docView = (Utility_WACUT_AttachedDocumentViewer)up.FindControl("WACUT_AttachedDocumentViewerWFP3");
                List <WACParameter> parms = new List <WACParameter>();
                parms.Add(new WACParameter("pk_farmBusiness", a.First().fk_farmBusiness, WACParameter.ParameterType.MasterKey));
                parms.Add(new WACParameter("pk_form_wfp2", a.First().pk_form_wfp3, WACParameter.ParameterType.PrimaryKey));
                docView.InitControl(parms);
            }

            if (fvAg_WFP3.CurrentMode == FormViewMode.Insert)
            {
                WACGlobal_Methods.PopulateControl_Generic_YesNoDDL(fvAg_WFP3, "ddlSpecialProvisions", "N");
                WACGlobal_Methods.PopulateControl_DatabaseLists_ProcurementType_DDL(fvAg_WFP3, "ddlProcurementType", "");
            }

            if (fvAg_WFP3.CurrentMode == FormViewMode.Edit)
            {
                WACGlobal_Methods.PopulateControl_Generic_YesNoDDL(fvAg_WFP3, "ddlSpecialProvisions", a.Single().specialProvisions);
                WACGlobal_Methods.PopulateControl_DatabaseLists_ProcurementType_DDL(fvAg_WFP3, "ddlProcurementType", a.Single().fk_procurementType_code);
            }
        }
    }