예제 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!(null == Session["totleAuthority"]))
            {
                AuthAttributes usrAuthAttr = (AuthAttributes)Session["totleAuthority"];

                bool flag = usrAuthAttr.HasOneFlag(AuthAttributes.bor_retApply);
                if (!flag)
                {
                    Response.Redirect("~/Main/NoAuthority.aspx");
                }
            }
            else
            {
                string url = Request.FilePath;
                Session["backUrl"] = url;
                Response.Redirect("~/Account/Login.aspx");
            }

            if (!IsPostBack)
            {
                string usrId = Session["usrId"] as string;

                #region productStockRelationTable

                DataSet myDst = new DataSet();
                ProductPurposeRelationProcess pprpView = new ProductPurposeRelationProcess(myDst);

                Session["ProductPurposeRelationProcess"] = pprpView;
                pprpView.RealProductPurposeRelationView();

                DataTable productStockRelationTable = pprpView.MyDst.Tables["view_productStockRelation"].DefaultView.ToTable();

                string strFilter =
                    " productPurpose = " + "'" + "forBorrow".ToString() + "'";
                productStockRelationTable.DefaultView.RowFilter = strFilter;
                Session["view_productStockRelation"]            = productStockRelationTable.DefaultView.ToTable();

                borrowProductGV.DataSource = Session["view_productStockRelation"];
                borrowProductGV.DataBind();

                btnIn.CommandArgument  = bool.TrueString;
                btnOut.CommandArgument = bool.FalseString;
                #endregion

                #region ddlApproveUsr

                UsrAuthProcess usrAuthView = new UsrAuthProcess(myDst);

                usrAuthView.View();
                DataTable ddlEngineerTable = usrAuthView.MyDst.Tables["view_usr_autority"].DefaultView.ToTable();

                string  authorityName   = "送修/借用审批";
                DataRow ddlApproveUsrDr = ddlEngineerTable.NewRow();
                ddlApproveUsrDr["realName"]      = string.Empty;
                ddlApproveUsrDr["usrId"]         = -1;
                ddlApproveUsrDr["authorityName"] = authorityName;
                ddlEngineerTable.Rows.Add(ddlApproveUsrDr);

                strFilter =
                    " authorityName = " + "'" + authorityName + "'";
                ddlEngineerTable.DefaultView.RowFilter = strFilter;

                ddlApproveUsr.DataSource     = ddlEngineerTable;
                ddlApproveUsr.DataTextField  = "realName";
                ddlApproveUsr.DataValueField = "usrId";
                ddlApproveUsr.DataBind();
                ddlApproveUsr.SelectedValue = "-1";

                #endregion
            }
        }
예제 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!(null == Session["totleAuthority"]))
            {
                AuthAttributes usrAuthAttr = (AuthAttributes)Session["totleAuthority"];

                bool flag = usrAuthAttr.HasOneFlag(AuthAttributes.stockManager);
                if (!flag)
                {
                    Response.Redirect("~/Main/NoAuthority.aspx");
                }
            }
            else
            {
                string url = Request.FilePath;
                Session["backUrl"] = url;
                Response.Redirect("~/Account/Login.aspx");
            }

            if (!IsPostBack)
            {
                DataSet MyDst = new DataSet();
                #region ddlProduct

                ProductProcess productView = new ProductProcess(MyDst);

                productView.RealProductView();
                DataTable ddlProductTable = productView.MyDst.Tables["tbl_product"].DefaultView.ToTable();

                DataRow ddlProductDr = ddlProductTable.NewRow();
                ddlProductDr["productName"] = string.Empty;
                ddlProductDr["productId"]   = -1;
                ddlProductTable.Rows.Add(ddlProductDr);

                ddlProduct.DataSource     = ddlProductTable;
                ddlProduct.DataTextField  = "productName";
                ddlProduct.DataValueField = "productId";
                ddlProduct.DataBind();
                ddlProduct.SelectedValue = "-1";

                #endregion

                #region ddlEngineer

                UsrAuthProcess usrAuthView = new UsrAuthProcess(MyDst);

                usrAuthView.View();
                DataTable ddlEngineerTable = usrAuthView.MyDst.Tables["view_usr_autority"].DefaultView.ToTable();

                string  authorityName = "货物检验";
                DataRow ddlEngigeerDr = ddlEngineerTable.NewRow();
                ddlEngigeerDr["realName"]      = string.Empty;
                ddlEngigeerDr["usrId"]         = -1;
                ddlEngigeerDr["authorityName"] = authorityName;
                ddlEngineerTable.Rows.Add(ddlEngigeerDr);

                string strFilter =
                    " authorityName = " + "'" + authorityName + "'";
                ddlEngineerTable.DefaultView.RowFilter = strFilter;

                ddlEngineer.DataSource     = ddlEngineerTable;
                ddlEngineer.DataTextField  = "realName";
                ddlEngineer.DataValueField = "usrId";
                ddlEngineer.DataBind();
                ddlEngineer.SelectedValue = "-1";

                #endregion

                #region ddlSupplier

                SupplierProcess supplierView = new SupplierProcess(MyDst);

                supplierView.RealSupplierView();
                DataTable ddlSupplierTable = supplierView.MyDst.Tables["tbl_supplier_company"].DefaultView.ToTable();

                DataRow ddlSupplierDr = ddlSupplierTable.NewRow();
                ddlSupplierDr["supplierName"] = string.Empty;
                ddlSupplierDr["supplierId"]   = -1;
                ddlSupplierTable.Rows.Add(ddlSupplierDr);

                ddlSupplier.DataSource     = ddlSupplierTable;
                ddlSupplier.DataTextField  = "supplierName";
                ddlSupplier.DataValueField = "supplierId";
                ddlSupplier.DataBind();
                ddlSupplier.SelectedValue = "-1";

                #endregion
            }
        }