protected void Page_Load(object sender, EventArgs e) { if (!(null == Session["totleAuthority"])) { AuthAttributes usrAuthAttr = (AuthAttributes)Session["totleAuthority"]; bool flag = usrAuthAttr.HasOneFlag(AuthAttributes.productCheck); if (!flag) { Response.Redirect("~/Main/NoAuthority.aspx"); } } else { string url = Request.FilePath; Session["backUrl"] = url; Response.Redirect("~/Account/Login.aspx"); } if (!IsPostBack) { int usrId = int.Parse(Session["usrId"] as string); #region productStockGV DataSet myDst = new DataSet(); ProductStockProcess pspView = new ProductStockProcess(myDst); pspView.RealProductStockCheckManView(); DataTable taskTable = pspView.MyDst.Tables["view_productStockCheckMan"].DefaultView.ToTable(); string strFilter = " usrId = " + usrId;// + //" and productCheck = " + "'" + "unChecked".ToString() + "'"; dt_modify(taskTable, strFilter); Session["ProductStockProcess"] = pspView; Session["dtSources"] = taskTable; productStockGV.DataSource = Session["dtSources"]; productStockGV.DataBind(); #endregion } }
protected void Page_Load(object sender, EventArgs e) { if (!(null == Session["totleAuthority"])) { AuthAttributes usrAuthAttr = (AuthAttributes)Session["totleAuthority"]; bool flag = usrAuthAttr.HasOneFlag(AuthAttributes.sellProductRelation); 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 <> " + "'" + "forSell".ToString() + "'"; productStockRelationTable.DefaultView.RowFilter = strFilter; Session["view_productStockRelation"] = productStockRelationTable.DefaultView.ToTable(); returnProductGV.DataSource = Session["view_productStockRelation"]; returnProductGV.DataBind(); #endregion } }
protected void Page_Load(object sender, EventArgs e) { if (!(null == Session["totleAuthority"])) { AuthAttributes usrAuthAttr = (AuthAttributes)Session["totleAuthority"]; bool flag = usrAuthAttr.HasOneFlag(AuthAttributes.custManager); if (!flag) { Response.Redirect("~/Main/NoAuthority.aspx"); } } else { string url = Request.FilePath; Session["backUrl"] = url; Response.Redirect("~/Account/Login.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { if (!(null == Session["totleAuthority"])) { AuthAttributes usrAuthAttr = (AuthAttributes)Session["totleAuthority"]; bool flag = usrAuthAttr.HasOneFlag(AuthAttributes.systemManager); if (!flag) { Response.Redirect("~/Main/NoAuthority.aspx"); } } else { string url = Request.FilePath; Session["backUrl"] = url; Response.Redirect("~/Account/Login.aspx"); } if (!IsPostBack) { Xm_db xmDataCont = Xm_db.GetInstance(); var usrAuthView = from usrAuth in xmDataCont.View_usr where usrAuth.UsrEd > DateTime.Now select new { usrAuth.UsrId, usrAuth.UsrName, usrAuth.RealName, usrAuth.DepartmentName, usrAuth.TitleName, usrAuth.TotleAuthority }; DataTable taskTable = usrAuthView.Distinct().ToDataTable(); var authView = from authInfo in xmDataCont.Tbl_authority select authInfo; DataTable auTable = authView.ToDataTable(); Session["dtSources"] = taskTable; Session["auTable"] = auTable; usrGV.DataSource = Session["dtSources"];//["dtSources"] as DataTable; usrGV.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!(null == Session["totleAuthority"])) { AuthAttributes usrAuthAttr = (AuthAttributes)Session["totleAuthority"]; bool flag = usrAuthAttr.HasOneFlag(AuthAttributes.productCheck); if (!flag) { Response.Redirect("~/Main/NoAuthority.aspx"); } } else { string url = Request.FilePath; Session["backUrl"] = url; Response.Redirect("~/Account/Login.aspx"); } if (!IsPostBack) { DataRow sessionDr = Session["seldProductStock"] as DataRow; #region context_input lblProductName.Text = sessionDr["productName"].ToString(); lblProductTag.Text = sessionDr["productTag"].ToString(); #endregion //string strCheck = sessionDr["productCheck"].ToString(); //if (strCheck.Equals(bool.FalseString)) //{ // btnNo.Visible = false; //} //else if (strCheck.Equals(bool.TrueString)) //{ // btnOK.Visible = false; //} } }
protected void Page_Load(object sender, EventArgs e) { if (!(null == Session["totleAuthority"])) { AuthAttributes usrAuthAttr = (AuthAttributes)Session["totleAuthority"]; bool flag = usrAuthAttr.HasOneFlag(AuthAttributes.sellProductRelation); if (!flag) { Response.Redirect("~/Main/NoAuthority.aspx"); } } else { string url = Request.FilePath; Session["backUrl"] = url; Response.Redirect("~/Account/Login.aspx"); } if (!IsPostBack) { Xm_db xmDataCont = Xm_db.GetInstance(); var businessProd = from busiProd in xmDataCont.View_businessProduct where busiProd.BusinessProductEd > DateTime.Now && busiProd.ProjectDetail == "sell" select busiProd; DataTable dtSource = businessProd.ToDataTable(); Session["dtSources"] = dtSource; businessProductGV.DataSource = Session["dtSources"]; businessProductGV.DataBind(); } }
void Clear_Response(string urlTarget) { //string strUsrAuth = dt.Rows[0]["totleAuthority"].ToString(); //AuthAttributes usrAuthAttr; //Enum.TryParse<AuthAttributes>(strUsrAuth, out usrAuthAttr); AuthAttributes usrAuthAttr = (AuthAttributes)Session["totleAuthority"]; //Session["totleAuthority"] = // dt.Rows[0]["totleAuthority"].ToString(); //Session["totleAuthority"] = // usrAuthAttr; //string strUsrAuth = Session["totleAuthority"] as string; string usrId = Session["usrId"] as string; Session.Clear(); Session["totleAuthority"] = usrAuthAttr; Session["usrId"] = usrId; string strUrl = string.Empty; switch (urlTarget) { case ("projectTagInfo"): strUrl = "~/Main/PublicInformation/projectTagInfo.aspx"; break; case ("departEdit"): strUrl = "~/Main/self_depart_title/selfDep/SelfDepartment.aspx"; break; case ("titleEdit"): strUrl = "~/Main/self_depart_title/selfTitle/SelfTitle.aspx"; break; case ("usrInfoModify"): strUrl = "~/Main/usrManagerment/usrInfoManagerment.aspx"; break; case ("usrAuth"): strUrl = "~/Main/usrManagerment/usrAuthManagerment.aspx"; break; case ("usrDepartTitle"): strUrl = "~/Main/usrManagerment/usrDepartTitleManagerment.aspx"; break; case ("selfPwdModify"): strUrl = "~/Main/usrSelfModify/usrSelfPwdModify.aspx"; break; case ("selfContectModify"): strUrl = "~/Main/usrSelfModify/usrSelfContactModify.aspx"; break; case ("userSelfEmailModify"): strUrl = "~/Main/usrSelfModify/userSelfEmailModify.aspx"; break; //case ("custCompAdd"): // strUrl = "~/Main/custInfoManager/custCompManager/custCompAdd.aspx"; // break; //case ("custManAdd"): //strUrl = "~/Main/custInfoManager/custCompManager/custManAdd.aspx"; //break; case ("custCompEdit"): strUrl = "~/Main/custInfoManager/custCompManager/custCompEdit.aspx"; break; case ("supplierEdit"): strUrl = "~/Main/custInfoManager/supplierManager/supplierEdit.aspx"; break; case ("projectSearch"): strUrl = "~/Main/projectTagInfoManager/projectSearch.aspx"; break; case ("projectStepSearch"): strUrl = "~/Main/projectTagInfoManager/projectStepSearch.aspx"; break; //case ("newProject"): // strUrl = "~/Main/projectTagInfoManager/projectTagAdd.aspx"; // break; case ("returnedSearch"): strUrl = "~/Main/projectTagInfoManager/returned/returnSearch.aspx"; break; case ("returnOk"): strUrl = "~/Main/projectTagInfoManager/returned/returnOk.aspx"; break; //case ("newReturn"): // strUrl = "~/Main/projectTagInfoManager/returned/newReturn.aspx"; // break; case ("borrowedSearch"): strUrl = "~/Main/projectTagInfoManager/borrowed/borrowSearch.aspx"; break; case ("borrowOk"): strUrl = "~/Main/projectTagInfoManager/borrowed/borrowOk.aspx"; break; //case ("newBorrow"): // strUrl = "~/Main/projectTagInfoManager/borrowed/newBorrow.aspx"; // break; case ("productView"): strUrl = "~/Main/stockInfoManager/productInfoManager/productView.aspx"; break; case ("productIn"): strUrl = "~/Main/stockInfoManager/productIn.aspx"; break; case ("productCheckView"): strUrl = "~/Main/stockInfoManager/productCheckView.aspx"; break; case ("productStockDetail"): strUrl = "~/Main/stockInfoManager/productStockView/productStockDetail.aspx"; break; case ("productStockView"): strUrl = "~/Main/stockInfoManager/productStockView/productStockView.aspx"; break; case ("sellProductStockOutList"): strUrl = "~/Main/stockInfoManager/productOutManager/productOutRelationManager/sellProductStockOutList.aspx"; break; case ("returnProductStockOutList"): strUrl = "~/Main/stockInfoManager/productOutManager/productOutRelationManager/returnProductStockOutList.aspx"; break; case ("productStockOutAccept"): strUrl = "~/Main/stockInfoManager/productOutManager/productStockOutAccept.aspx"; break; //case ("contractView"): // strUrl = "~/Main/contractManager/contractView.aspx"; // break; //case ("addContract"): // strUrl = "~/Main/contractManager/addContract.aspx"; // break; case ("subContractEdit"): strUrl = "~/Main/contractManager/subContractEdit.aspx"; break; case ("mainContractReceiptView"): strUrl = "~/Main/paymentReceiptManager/mainContractReceiptView.aspx"; break; case ("paymentOk"): strUrl = "~/Main/paymentReceiptManager/paymentOk.aspx"; break; case ("receiptOk"): strUrl = "~/Main/paymentReceiptManager/receiptOk.aspx"; break; case ("receiptView"): strUrl = "~/Main/infoViewManager/receiptView.aspx"; break; case ("paymentView"): strUrl = "~/Main/infoViewManager/paymentInfo/paymentView.aspx"; break; default: break; } if (!string.IsNullOrEmpty(strUrl)) { Response.Redirect(strUrl); } }
protected void Page_Load(object sender, EventArgs e) { if (!(null == Session["totleAuthority"])) { AuthAttributes usrAuthAttr = (AuthAttributes)Session["totleAuthority"]; bool flag = usrAuthAttr.HasOneFlag(AuthAttributes.projectStepView); if (!flag) { Response.Redirect("~/Main/NoAuthority.aspx"); } } else { string url = Request.FilePath; Session["backUrl"] = url; Response.Redirect("~/Account/Login.aspx"); } if (null == Session["projectTagId"]) { Response.Redirect("~/Main/projectTagInfoManager/projectStepSearch.aspx"); } if (!IsPostBack) { int projectTagId = int.Parse(Session["projectTagId"] as string); Xm_db xmDataCont = Xm_db.GetInstance(); DateTime today = DateTime.Now; var projectStepEdit = from projectStep in xmDataCont.View_project_step where projectStep.ProjectTagId == projectTagId && (projectStep.MainContractEd.HasValue ? projectStep.MainContractEd > today : true) && (projectStep.SubContractEd.HasValue ? projectStep.SubContractEd > today : true) && (projectStep.ToOutProductEd.HasValue ? projectStep.ToOutProductEd > today : true) select projectStep; //string strSplite = "%"; var projectStepEditElement = projectStepEdit.First(); lblProjectSt.Text = projectStepEditElement.ProjectSt.ToString(); lblProjectTag.Text = projectStepEditElement.ProjectTag; lblProjectSynopsis.Text = projectStepEditElement.ProjectSynopsis; lblReceiptPercent.Text = projectStepEditElement.ReceiptPercent.HasValue ? projectStepEditElement.ReceiptPercent.Value.ToString("p") : string.Empty; lblSelfReceiptPercent.Text = projectStepEditElement.SelfReceiptPercent.HasValue ? projectStepEditElement.SelfReceiptPercent.Value.ToString("p") : string.Empty; lblReceivingPercent.Text = projectStepEditElement.ReceivingPercent.HasValue ? projectStepEditElement.ReceivingPercent.Value.ToString("p") : string.Empty; lblSelfReceivingPercent.Text = projectStepEditElement.SelfReceivingPercent.HasValue ? projectStepEditElement.SelfReceivingPercent.Value.ToString("p") : string.Empty; var projProdEdit = from projProd in projectStepEdit let oweProductNum = projProd.ProductNum - projProd.HasSupplied let toOutProductNum = projectStepEdit.Count(elementTemp => elementTemp.ToOutProductId == elementTemp.ContractProductId) select new { projProd.ContractProductName, projProd.HasSupplied, oweProductNum, toOutProductNum }; Session["dtSources"] = projProdEdit.Distinct().ToDataTable(); projProdInfoGV.DataSource = Session["dtSources"]; projProdInfoGV.DataBind(); } }
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 } }
protected void Page_Load(object sender, EventArgs e) { // txtName.ContinueDestinationPageUrl = Request.QueryString["ReturnUrl"]; if (!(null == Session["totleAuthority"])) { AuthAttributes usrAuthAttr = (AuthAttributes)Session["totleAuthority"]; bool flag = usrAuthAttr.HasOneFlag(AuthAttributes.projectTagApply); if (!flag) { Response.Redirect("~/Main/NoAuthority.aspx"); } } else { string url = Request.FilePath; Session["backUrl"] = url; Response.Redirect("~/Account/Login.aspx"); } if (!IsPostBack) { DataSet dst = new DataSet(); DataRow dr = null; #region ddlSelfDepartView SelfDepartProcess ddlSelfDepartView = new SelfDepartProcess(dst); ddlSelfDepartView.SelDepView(); DataTable ddlSelfDepartTable = ddlSelfDepartView.MyDst.Tables["tbl_department"].DefaultView.ToTable(); dr = ddlSelfDepartTable.NewRow(); dr["departmentId"] = -1; dr["departmentName"] = string.Empty; dr["endTime"] = "9999-12-31"; ddlSelfDepartTable.Rows.Add(dr); ddlDepart.DataValueField = "departmentId"; ddlDepart.DataTextField = "departmentName"; ddlDepart.DataSource = ddlSelfDepartTable; ddlDepart.DataBind(); ddlDepart.SelectedValue = "-1"; #endregion #region ddlSelfTitleView SelfTitleProcess ddlSelfTitleView = new SelfTitleProcess(dst); ddlSelfTitleView.SelfTitleView(); DataTable ddlSelfTitleTable = ddlSelfTitleView.MyDst.Tables["tbl_title"].DefaultView.ToTable(); dr = ddlSelfTitleTable.NewRow(); dr["titleId"] = -1; dr["titleName"] = string.Empty; dr["endTime"] = "9999-12-31"; ddlSelfTitleTable.Rows.Add(dr); ddlTitle.DataValueField = "titleId"; ddlTitle.DataTextField = "titleName"; ddlTitle.DataSource = ddlSelfTitleTable; ddlTitle.DataBind(); ddlTitle.SelectedValue = "-1"; #endregion } }
protected void Page_Load(object sender, EventArgs e) { if (!(null == Session["totleAuthority"])) { AuthAttributes usrAuthAttr = (AuthAttributes)Session["totleAuthority"]; bool flag = usrAuthAttr.HasOneFlag(AuthAttributes.newContract); if (!flag) { Response.Redirect("~/Main/NoAuthority.aspx"); } } else { string url = Request.FilePath; Session["backUrl"] = url; Response.Redirect("~/Account/Login.aspx"); } if (null == Session["selMainContractDr"]) { Response.Redirect("~/Main/contractManager/subContractEdit.aspx"); } if (!IsPostBack) { #region selMainContract DataRow sessionDr = Session["selMainContractDr"] as DataRow; lblMainContractTag.Text = sessionDr["mainContractTag"].ToString(); lblProjectTag.Text = sessionDr["projectTag"].ToString(); lblCust.Text = sessionDr["custCompName"].ToString(); lblMainContractMoney.Text = sessionDr["cash"].ToString(); lblMainContractDateLine.Text = sessionDr["dateLine"].ToString(); lblMainContractPayment.Text = sessionDr["paymentMode"].ToString(); DataTable dtMainContractProduct = (Session["mainContractProductDtSources"] as DataTable).DefaultView.ToTable(); string mainContractId = sessionDr["mainContractId"].ToString(); string strFilter = " mainContractId = " + "'" + mainContractId + "'"; dtMainContractProduct.DefaultView.RowFilter = strFilter; contractProductLsB.Rows = dtMainContractProduct.DefaultView.Count; contractProductLsB.DataSource = dtMainContractProduct; contractProductLsB.DataTextField = "productAndNum".ToString(); contractProductLsB.DataValueField = "mainContractProductId".ToString(); contractProductLsB.DataBind(); #endregion #region dllProductTable DataSet scpDst = new DataSet(); SubContractProductProcess scpView = new SubContractProductProcess(scpDst); scpView.RealSubContractProductView(); DataTable dllProductTable = scpView.MyDst.Tables["view_subContractProduct"].DefaultView.ToTable(); DataColumn colproductAndNum = new DataColumn("productAndNum", System.Type.GetType("System.String")); dllProductTable.Columns.Add(colproductAndNum); string strSplit = " , ".ToString(); foreach (DataRow dr in dllProductTable.Rows) { dr["productAndNum"] = dr["productName"].ToString() + strSplit + dr["productNum"].ToString(); } Session["dllProductTable"] = dllProductTable; #endregion #region subContractGV DataSet vscsDst = new DataSet(); subContractProcess vscsView = new subContractProcess(vscsDst); vscsView.RealSubContractSupplierView(); DataTable taskTable = vscsView.MyDst.Tables["view_subContract_supplier"].DefaultView.ToTable(); taskTable.DefaultView.RowFilter = strFilter; Session["subContractProcess"] = vscsView; Session["dtSources"] = taskTable; subContractGV.DataSource = Session["dtSources"]; subContractGV.DataBind(); #endregion } }
protected void Page_Load(object sender, EventArgs e) { if (!(null == Session["totleAuthority"])) { AuthAttributes usrAuthAttr = (AuthAttributes)Session["totleAuthority"]; bool flag = usrAuthAttr.HasOneFlag(AuthAttributes.newContract); if (!flag) { Response.Redirect("~/Main/NoAuthority.aspx"); } } else { string url = Request.FilePath; Session["backUrl"] = url; Response.Redirect("~/Account/Login.aspx"); } if (!IsPostBack) { #region subContractTable DataTable subContractTable = null; if (null == Session["subContractTable"]) { DataRow subContractRow = null; DataColumn colMainContractId = new DataColumn("mainContractId", System.Type.GetType("System.String")); DataColumn colSupplierIdName = new DataColumn("supplierId", System.Type.GetType("System.String")); DataColumn colSubContractTag = new DataColumn("subContractTag", System.Type.GetType("System.String")); DataColumn colCash = new DataColumn("cash", System.Type.GetType("System.String")); DataColumn colDateLine = new DataColumn("dateLine", System.Type.GetType("System.String")); DataColumn colPaymentMode = new DataColumn("paymentMode", System.Type.GetType("System.String")); subContractTable = new DataTable("tbl_subContract"); subContractTable.Columns.Add(colMainContractId); subContractTable.Columns.Add(colSupplierIdName); subContractTable.Columns.Add(colSubContractTag); subContractTable.Columns.Add(colCash); subContractTable.Columns.Add(colDateLine); subContractTable.Columns.Add(colPaymentMode); DataRow sessionDr = Session["selMainContractDr"] as DataRow; string mainContractId = sessionDr["mainContractId"].ToString(); subContractRow = subContractTable.NewRow(); subContractRow["mainContractId"] = mainContractId; subContractRow["supplierId"] = -1; subContractRow["subContractTag"] = string.Empty; subContractRow["cash"] = string.Empty; subContractRow["dateLine"] = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss.fff"); subContractRow["paymentMode"] = string.Empty; subContractTable.Rows.Add(subContractRow); Session["subContractTable"] = subContractTable; } else { subContractTable = Session["subContractTable"] as DataTable; } txtSubContractTag.Text = subContractTable.Rows[0]["subContractTag"].ToString(); txtMoney.Text = subContractTable.Rows[0]["cash"].ToString(); btnDate.Text = subContractTable.Rows[0]["dateLine"].ToString(); txtPayment.Text = subContractTable.Rows[0]["paymentMode"].ToString(); #endregion #region subProductGV if (null == Session["subProductSelDs"]) { } else { DataTable dt = Session["subProductSelDs"] as DataTable; string strFilter = " checkOrNot = " + "'" + bool.TrueString + "'"; dt.DefaultView.RowFilter = strFilter; subProductGV.DataSource = dt; subProductGV.DataBind(); } #endregion #region ddlSupplierTable DataSet projectDst = new DataSet(); SupplierProcess ddlSupplierView = new SupplierProcess(projectDst); ddlSupplierView.RealSupplierView(); DataTable ddlSupplierTable = ddlSupplierView.MyDst.Tables["tbl_supplier_company"]; //DataColumn[] projectKey = new DataColumn[1]; //projectKey[0] = ddlProjectTable.Columns["projectTagId"]; //ddlProjectTable.PrimaryKey = projectKey; Session["ddlProjectDtS"] = ddlSupplierTable; DataRow dr = ddlSupplierTable.NewRow(); dr["supplierId"] = -1; dr["supplierName"] = string.Empty; dr["endTime"] = "9999-12-31"; ddlSupplierTable.Rows.Add(dr); ddlSupplier.DataValueField = "supplierId"; ddlSupplier.DataTextField = "supplierName"; ddlSupplier.DataSource = ddlSupplierTable; ddlSupplier.DataBind(); ddlSupplier.SelectedValue = subContractTable.Rows[0]["supplierId"].ToString();; #endregion } }
protected void Page_Load(object sender, EventArgs e) { if (!(null == Session["totleAuthority"])) { AuthAttributes usrAuthAttr = (AuthAttributes)Session["totleAuthority"]; bool flag = usrAuthAttr.HasOneFlag(AuthAttributes.newContract); if (!flag) { Response.Redirect("~/Main/NoAuthority.aspx"); } } else { string url = Request.FilePath; Session["backUrl"] = url; Response.Redirect("~/Account/Login.aspx"); } if (!IsPostBack) { int subContractId = int.Parse(Session["seldSubContractId"] as string); Xm_db xmDataCont = Xm_db.GetInstance(); var subContractEdit = (from subContract in xmDataCont.Tbl_subContract where subContract.MainContractId == subContractId && subContract.EndTime > DateTime.Now select subContract).First(); txtSubContractTag.Text = subContractEdit.SubContractTag; txtMoney.Text = subContractEdit.Cash.ToString(); btnDate.Text = subContractEdit.DateLine.ToString(); txtPayment.Text = subContractEdit.PaymentMode; #region subProductGV var subProductSelDs = from subContrctProduct in subContractEdit.Tbl_subContrctProduct join product in xmDataCont.Tbl_product on subContrctProduct.ProductId equals product.ProductId select new { product.ProductName, subContrctProduct.ProductNum }; DataTable dt = subProductSelDs.ToDataTable(); if (dt.Rows.Count > 0) { subProductGV.DataSource = dt; subProductGV.DataBind(); } #endregion #region ddlSupplierTable DataSet projectDst = new DataSet(); SupplierProcess ddlSupplierView = new SupplierProcess(projectDst); ddlSupplierView.RealSupplierView(); DataTable ddlSupplierTable = ddlSupplierView.MyDst.Tables["tbl_supplier_company"]; Session["ddlProjectDtS"] = ddlSupplierTable; DataRow dr = ddlSupplierTable.NewRow(); dr["supplierId"] = -1; dr["supplierName"] = string.Empty; dr["endTime"] = "9999-12-31"; ddlSupplierTable.Rows.Add(dr); ddlSupplier.DataValueField = "supplierId"; ddlSupplier.DataTextField = "supplierName"; ddlSupplier.DataSource = ddlSupplierTable; ddlSupplier.DataBind(); ddlSupplier.SelectedValue = subContractEdit.SupplierId.ToString(); #endregion } }
protected void Page_Load(object sender, EventArgs e) { if (!(null == Session["totleAuthority"])) { AuthAttributes usrAuthAttr = (AuthAttributes)Session["totleAuthority"]; bool flag = usrAuthAttr.HasOneFlag(AuthAttributes.newContract); if (!flag) { Response.Redirect("~/Main/NoAuthority.aspx"); } } else { string url = Request.FilePath; Session["backUrl"] = url; Response.Redirect("~/Account/Login.aspx"); } if (!IsPostBack) { #region ddlCustComp DataSet dst = new DataSet(); custCompProcess ddlCustCompView = new custCompProcess(dst); ddlCustCompView.RealCompView(); DataTable ddlCustCompTable = ddlCustCompView.MyDst.Tables["tbl_customer_company"].DefaultView.ToTable(); DataRow dr = ddlCustCompTable.NewRow(); dr["custCompyId"] = -1; dr["custCompName"] = string.Empty; dr["endTime"] = "9999-12-31"; ddlCustCompTable.Rows.Add(dr); Session["ddlProjectDtS"] = ddlCustCompTable; ddlCustComp.DataValueField = "custCompyId"; ddlCustComp.DataTextField = "custCompName"; ddlCustComp.DataSource = Session["ddlProjectDtS"]; ddlCustComp.DataBind(); #endregion int mainContractId = int.Parse(Session["seldMainContractId"] as string); //Xm_db xmDataCont = new Xm_db(System.Configuration.ConfigurationManager.ConnectionStrings["xm_dbConnectionString"].ConnectionString); Xm_db xmDataCont = Xm_db.GetInstance(); var mainContractEdit = (from mainContract in xmDataCont.Tbl_mainContract where mainContract.MainContractId == mainContractId && mainContract.EndTime > DateTime.Now select mainContract).First(); ddlCustComp.SelectedValue = mainContractEdit.CustCompyId.ToString(); txtMainContractTag.Text = mainContractEdit.MainContractTag; txtMoney.Text = mainContractEdit.Cash.ToString(); btnDate.Text = mainContractEdit.DateLine.ToString(); txtPayment.Text = mainContractEdit.PaymentMode; txtProjAddr.Text = mainContractEdit.Tbl_projectTagInfo.ProjectOutAddress; #region mainProductGV var mainProductSelDs = from mainProduct in mainContractEdit.Tbl_mainContrctProduct join product in xmDataCont.Tbl_product on mainProduct.ProductId equals product.ProductId select new { product.ProductName, mainProduct.ProductNum }; DataTable dt = mainProductSelDs.ToDataTable(); if (dt.Rows.Count > 0) { mainProductGV.DataSource = dt; mainProductGV.DataBind(); } #endregion } }
protected void Page_Load(object sender, EventArgs e) { if (!(null == Session["totleAuthority"])) { AuthAttributes usrAuthAttr = (AuthAttributes)Session["totleAuthority"]; bool flag = usrAuthAttr.HasOneFlag(AuthAttributes.pay_receiptApply); if (!flag) { Response.Redirect("~/Main/NoAuthority.aspx"); } } else { string url = Request.FilePath; Session["backUrl"] = url; Response.Redirect("~/Account/Login.aspx"); } if (null == Session["seldSubContract"]) { Response.Redirect("~/Main/paymentReceiptManager/subContractPaymentView.aspx"); } if (!IsPostBack) { //DataRow sessionDr = Session["seldSubContract"] as DataRow; //System.Nullable<int> mainContractId = int.Parse(sessionDr["mainContractId"] as string); //string subContractId = sessionDr["subContractId"].ToString(); //string selfReceiving = sessionDr["receivingPercent"].ToString(); int paymentId = int.Parse(Session["seldPaymentId"] as string); Xm_db xmDataCont = Xm_db.GetInstance(); //var paymentApplyEdit = // (from paymentApply in xmDataCont.Tbl_paymentApply // where paymentApply.PaymentId == paymentId // select paymentApply).First(); //string selfReceiving = paymentApplyEdit.Tbl_subContract.Tbl_mainContract.SelfReceivingPercent.ToString(); //System.Nullable<int> mainContractId = paymentApplyEdit.Tbl_subContract.MainContractId; //System.Nullable<int> maxRtn = 0; //string maxPay = xmDataCont.MainContract_MaxPay(mainContractId, ref maxRtn).ToString(); //lblMainContractPay.Text = maxPay + "%"; //lblSubContractPay.Text = selfReceiving + "%"; //#region ddlSelfReceipt //ListItemCollection licNomal = new ListItemCollection(); //int num = 0; //int max = int.Parse(maxPay) - int.Parse(selfReceiving) + 5; //string strValue = string.Empty; //string strPercent = "%"; //string strText = string.Empty; //for (int i = num; i < max; i = i + 5) //{ // strValue = i.ToString(); // strText = strValue + strPercent; // licNomal.Add(strText); //} //ListItemCollection licSpecial = new ListItemCollection(); //num = max; //max = 110 - max; //strValue = string.Empty; //strText = string.Empty; //for (int i = max; i < max; i = i + 5) //{ // strValue = i.ToString(); // strText = strValue + strPercent; // licSpecial.Add(strText); //} //Session["licNomal"] = licNomal; //Session["licSpecial"] = licSpecial; //#endregion var paymentApplyEdit = (from paymentApply in xmDataCont.Tbl_paymentApply where paymentApply.PaymentId == paymentId select paymentApply).First(); float selfReceiving = paymentApplyEdit.HasPayPercent; System.Nullable <int> mainContractId = paymentApplyEdit.Tbl_subContract.MainContractId; System.Nullable <float> maxRtn = 0; string maxPay = xmDataCont.MainContract_MaxPay(mainContractId, ref maxRtn).ToString(); lblMainContractPay.Text = maxRtn.Value.ToString("p"); lblSubContractPay.Text = selfReceiving.ToString("p"); Session["maxPay"] = maxRtn.Value; #region ddlSelfReceipt DataTable dtNomal = new DataTable(); dtNomal.Columns.Add("DataTextField", Type.GetType("System.String")); dtNomal.Columns.Add("DataValueField", Type.GetType("System.Single")); float num = 0; float max = maxRtn.Value - selfReceiving + 0.05f; max = max <= 0.05f ? 0.05f : max; DataRow dr = null; for (float i = num; i < max; i = i + 0.05f) { dr = dtNomal.NewRow(); dr["DataTextField"] = i.ToString("p"); dr["DataValueField"] = i; dtNomal.Rows.Add(dr); } DataTable dtSpecial = new DataTable(); dtSpecial.Columns.Add("DataTextField", Type.GetType("System.String")); dtSpecial.Columns.Add("DataValueField", Type.GetType("System.Single")); num = 0; max = 1.05f - selfReceiving; dr = null; for (float i = num; i < max; i = i + 0.05f) { dr = dtSpecial.NewRow(); dr["DataTextField"] = i.ToString("p"); dr["DataValueField"] = i; dtSpecial.Rows.Add(dr); //licNomal.Add(new ListItem(i.ToString("p"), i.ToString())); } Session["dtNomal"] = dtNomal; Session["dtSpecial"] = dtSpecial; #endregion ddlSelfPay.DataSource = Session["dtNomal"]; ddlSelfPay.DataValueField = "DataValueField"; ddlSelfPay.DataTextField = "DataTextField"; ddlSelfPay.DataBind(); ddlSelfPay.SelectedIndex = 0; txtPayExplication.Text = paymentApplyEdit.PaymentExplication; } }
protected void Page_Load(object sender, EventArgs e) { if (!(null == Session["totleAuthority"])) { AuthAttributes usrAuthAttr = (AuthAttributes)Session["totleAuthority"]; bool flag = usrAuthAttr.HasOneFlag(AuthAttributes.newContract); 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; DataSet MyDst = new DataSet(); #region productList MainContractProductProcess mcppView = new MainContractProductProcess(MyDst); mcppView.RealMainContractProductView(); DataTable mcppTable = mcppView.MyDst.Tables["view_mainContractProduct"]; DataColumn colproductAndNum = new DataColumn("productAndNum", System.Type.GetType("System.String")); mcppTable.Columns.Add(colproductAndNum); string strSplit = " , ".ToString(); foreach (DataRow dr in mcppTable.Rows) { dr["productAndNum"] = dr["productName"].ToString() + strSplit + dr["productNum"].ToString(); } Session["mainContractProductDtSources"] = mcppTable; #endregion #region mainContractGV MainContractProcess mainContractView = new MainContractProcess(MyDst); mainContractView.UsrId = usrId; mainContractView.RealmainContractProjectUsrView(); DataTable taskTable = mainContractView.MyDst.Tables["view_mainContract_project_usr"]; Session["ProjectTagProcess"] = mainContractView; Session["dtSources"] = taskTable; mainContractGV.DataSource = Session["dtSources"]; mainContractGV.DataBind(); #endregion //Xm_db xmDataCont = Xm_db.GetInstance(); //int uId = int.Parse(usrId); //var a = // from mainContract_project_usr in xmDataCont.View_mainContract_project_usr // where mainContract_project_usr.EndTime > DateTime.Now && // mainContract_project_usr.UsrId == uId // orderby mainContract_project_usr.HasSupplier descending, mainContract_project_usr.ReceiptEd descending // select new { mainContract_project_usr, ok = mainContract_project_usr. }; //System.Type t = a.GetType(); //DataTable dba = a.AsEnumerable().Distinct<t.>(new MainIdComparer<t>("BusinessProductId")).ToDataTable(); } }
protected void Page_Load(object sender, EventArgs e) { if (!(null == Session["totleAuthority"])) { AuthAttributes usrAuthAttr = (AuthAttributes)Session["totleAuthority"]; bool flag = usrAuthAttr.HasOneFlag(AuthAttributes.selfCompany); if (!flag) { Response.Redirect("~/Main/NoAuthority.aspx"); } } else { string url = Request.FilePath; Session["backUrl"] = url; Response.Redirect("~/Account/Login.aspx"); } //DataSet MyDst = new DataSet(); //SelfDepartProcess myView = new SelfDepartProcess(MyDst); if (!IsPostBack) { DataSet upDst = new DataSet(); DataSet sdDst = new DataSet(); DataSet stDst = new DataSet(); UserProcess upView = new UserProcess(upDst); SelfDepartProcess sdView = new SelfDepartProcess(sdDst); SelfTitleProcess stView = new SelfTitleProcess(stDst); upView.UsrSelfDepartTitleView(); sdView.RealDepView(); stView.RealTitleView(); DataTable upTable = upView.MyDst.Tables["view_usr_department_title"]; DataTable sdTable = sdView.MyDst.Tables["tbl_department"]; DataTable stTable = stView.MyDst.Tables["tbl_title"]; //DataColumn[] sdKey = new DataColumn[1]; //DataColumn[] stKey = new DataColumn[1]; //sdKey[0] = sdTable.Columns[1]; //stKey[0] = stTable.Columns[1]; //sdTable.PrimaryKey = sdKey; //stTable.PrimaryKey = stKey; //object findVals = new object(); //findVals = "无"; Session["UserProcess"] = upView; Session["upDtSources"] = upTable; Session["sdDtSources"] = sdTable; Session["stDtSources"] = stTable; //if (Session["PAGESIZE"] != null) //{ // SelfDepartGV.DataSource = Session["dtSources"];//["dtSources"] as DataTable; // SelfDepartGV.DataBind(); //} //else //{ //} usrGV.DataSource = Session["upDtSources"];//["dtSources"] as DataTable; //string[] strKeyNames = new string[1]; //strKeyNames[0] = "departmentName"; //SelfDepartGV.DataKeyNames = strKeyNames; usrGV.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!(null == Session["totleAuthority"])) { AuthAttributes usrAuthAttr = (AuthAttributes)Session["totleAuthority"]; bool flag = usrAuthAttr.HasOneFlag(AuthAttributes.pay_receiptApply); if (!flag) { Response.Redirect("~/Main/NoAuthority.aspx"); } } else { string url = Request.FilePath; Session["backUrl"] = url; Response.Redirect("~/Account/Login.aspx"); } if (Session["seldMainContract"] == null) { Response.Redirect("~/Main/paymentReceiptManager/mainContractReceiptView.aspx"); } if (!IsPostBack) { DataRow sessionDr = Session["seldMainContract"] as DataRow; string strMainContractId = sessionDr["mainContractId"].ToString(); //DataSet MyDst = new DataSet(); #region selfReceiptGV //ReceiptApplyProcess receiptApplyView = new ReceiptApplyProcess(MyDst); //receiptApplyView.RealSelfReceiptView(); //DataTable dt = receiptApplyView.MyDst.Tables["view_mainReceipt"]; //string strFilter = // " mainContractId = " + "'" + mainContractId + "'"; //dt.DefaultView.RowFilter = strFilter; //DataTable taskTable = dt.DefaultView.ToTable(); Xm_db xmDataCont = Xm_db.GetInstance(); int mainContractId = int.Parse(strMainContractId); var mainReceiptView = from mainReceipt in xmDataCont.View_mainReceipt where mainReceipt.EndTime > DateTime.Now && mainReceipt.MainContractId == mainContractId select mainReceipt; DataTable taskTable = mainReceiptView.ToDataTable(); dt_modify(taskTable, string.Empty); //Session["ReceiptApplyProcess"] = receiptApplyView; Session["dtSources"] = taskTable; btnVisible_Init(taskTable); selfReceiptGV.DataSource = Session["dtSources"]; selfReceiptGV.DataBind(); #endregion } }
protected void Page_Load(object sender, EventArgs e) { if (!(null == Session["totleAuthority"])) { AuthAttributes usrAuthAttr = (AuthAttributes)Session["totleAuthority"]; bool flag = usrAuthAttr.HasOneFlag(AuthAttributes.productDetail); 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(); ProductPurposeRelationProcess pprpView = new ProductPurposeRelationProcess(myDst); Session["ProductPurposeRelationProcess"] = pprpView; #region productStockGV pprpView.AllProductPurposeRelationView(); DataTable productStockGVTable = pprpView.MyDst.Tables["productStockRelation_view"].DefaultView.ToTable("productStockGVTable"); string productCheck = "unDo"; string strFilter = " productCheck <> " + "'" + productCheck + "'"; dt_modify(productStockGVTable, strFilter); productStockGVTable = productStockGVTable.DefaultView.ToTable("productStockGVTable"); Session["productStockGVTable"] = productStockGVTable; #endregion //#region productStockRelationTable //pprpView.RealProductPurposeRelationView(); //DataTable productStockRelationTable = pprpView.MyDst.Tables["view_productStockRelation"].DefaultView.ToTable(); //Session["productStockRelationTable"] = productStockRelationTable; //#endregion #region productPurposeTable pprpView.RealProductPurposeView(); DataTable productPurposeTable = pprpView.MyDst.Tables["tbl_productPurpose"].DefaultView.ToTable(); Session["productPurposeTable"] = productPurposeTable; #endregion productStockGV.DataSource = Session["productStockGVTable"]; productStockGV.DataBind(); } }
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 } }
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 selfPaymentGV BusinessProductProcess businessProductView = new BusinessProductProcess(MyDst); //businessProductView.RealBusinessProductView(); //DataTable taskTable = businessProductView.MyDst.Tables["view_businessProductOut"].DefaultView.ToTable(); //string strFilter = string.Empty; //dt_modify(taskTable, strFilter); ////dt.DefaultView.RowFilter = strFilter; ////DataTable taskTable = dt.DefaultView.ToTable(); ////dt.Clear(); //Session["BusinessProductProcess"] = businessProductView; //Session["dtSources"] = taskTable.DefaultView.ToTable(); //taskTable.Clear(); Xm_db xmDbDateContext = Xm_db.GetInstance(); var taskDs = from view_businessProductOut in xmDbDateContext.View_businessProductOut //where view_businessProductOut.Approve == null || // view_businessProductOut.Approve == bool.TrueString && // view_businessProductOut.EndTime > DateTime.Now //select view_businessProductOut; where (view_businessProductOut.Approve == null ? true : view_businessProductOut.Approve.Equals(bool.TrueString)) && view_businessProductOut.EndTime > DateTime.Now select view_businessProductOut; DataTable dt = taskDs.ToDataTable(); string strFilter = string.Empty; dt_modify(dt, strFilter); Session["BusinessProductProcess"] = businessProductView; Session["dtSources"] = dt.DefaultView.ToTable(); dt.Clear(); businessProductGV.DataSource = Session["dtSources"]; businessProductGV.DataBind(); #endregion } }
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; //DataSet MyDst = new DataSet(); //ProjectTagProcess myView = new ProjectTagProcess(MyDst); string projectDetail = "borrow"; //myView.RealProjTagList(projectDetail); Xm_db xmDataCont = Xm_db.GetInstance(); var projectEdit = from project in xmDataCont.View_project_tag where project.EndTime > DateTime.Now && project.ProjectDetail == projectDetail select new { project.ProjectTag, project.ProjectSynopsis, project.ProductName, project.ProductTag, project.CustCompName, project.ApplymentUsrName, project.ApproveUsrName, project.Approve, project.ApproveResult, project.StartTime, project.DoneTime }; DataTable taskTable = projectEdit.Distinct().ToDataTable(); dt_modify(taskTable, string.Empty); //Session["ProjectTagProcess"] = taskTable; Session["dtSources"] = taskTable; projectInfoGV.DataSource = Session["dtSources"]; projectInfoGV.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!(null == Session["totleAuthority"])) { AuthAttributes usrAuthAttr = (AuthAttributes)Session["totleAuthority"]; bool flag = usrAuthAttr.HasOneFlag(AuthAttributes.pay_receiptApply); if (!flag) { Response.Redirect("~/Main/NoAuthority.aspx"); } } else { string url = Request.FilePath; Session["backUrl"] = url; Response.Redirect("~/Account/Login.aspx"); } if (null == Session["seldSubContract"]) { Response.Redirect("~/Main/paymentReceiptManager/subContractPaymentView.aspx"); } if (!IsPostBack) { DataRow sessionDr = Session["seldSubContract"] as DataRow; string mainContractId = sessionDr["mainContractId"].ToString(); string subContractId = sessionDr["subContractId"].ToString(); DataTable paymentApplyTable = null; if (null == Session["payApplyTable"]) { DataRow receiptApplyRow = null; DataColumn colSubContractId = new DataColumn("subContractId", System.Type.GetType("System.String")); DataColumn colCustMaxPay = new DataColumn("custMaxPay", System.Type.GetType("System.String")); DataColumn colPayPercent = new DataColumn("payPercent", System.Type.GetType("System.String")); DataColumn colHasPayPercent = new DataColumn("selfHasPay", System.Type.GetType("System.String")); DataColumn colPayExplication = new DataColumn("paymentExplication", System.Type.GetType("System.String")); paymentApplyTable = new DataTable("tbl_paymentApply"); paymentApplyTable.Columns.Add(colSubContractId); paymentApplyTable.Columns.Add(colCustMaxPay); paymentApplyTable.Columns.Add(colPayPercent); paymentApplyTable.Columns.Add(colHasPayPercent); paymentApplyTable.Columns.Add(colPayExplication); receiptApplyRow = paymentApplyTable.NewRow(); receiptApplyRow["subContractId"] = subContractId; receiptApplyRow["payPercent"] = string.Empty; receiptApplyRow["paymentExplication"] = string.Empty; paymentApplyTable.Rows.Add(receiptApplyRow); Session["payApplyTable"] = paymentApplyTable; } else { paymentApplyTable = Session["payApplyTable"] as DataTable; } string selfReceiving = sessionDr["receivingPercent"].ToString(); DataSet MyDst = new DataSet(); #region lblContractPay PaymentApplyProcess payApplyView = new PaymentApplyProcess(MyDst); payApplyView.MainContractPayMax(mainContractId); string maxPay = payApplyView.StrRtn; //float m = float.Parse(maxPay); //paymentApplyTable.Rows[0]["custMaxPay"] = maxPay; //lblMainContractPay.Text = maxPay + "%"; //lblSubContractPay.Text = selfReceiving + "%"; //#endregion //#region ddlSelfReceipt //ListItemCollection licNomal = new ListItemCollection(); //int num = 0; //int max = int.Parse(maxPay) - int.Parse(selfReceiving) + 5; //string strValue = string.Empty; //string strPercent = "%"; //string strText = string.Empty; //for (int i = num; i < max; i = i + 5) //{ // strValue = i.ToString(); // strText = strValue + strPercent; // licNomal.Add(strText); //} //ListItemCollection licSpecial = new ListItemCollection(); //num = max; //max = 110 - max; //strValue = string.Empty; //strText = string.Empty; //for (int i = max; i < max; i = i + 5) //{ // strValue = i.ToString(); // strText = strValue + strPercent; // licSpecial.Add(strText); //} //Session["licNomal"] = licNomal; //Session["licSpecial"] = licSpecial; //#endregion //ddlSelfPay.DataSource = Session["licNomal"]; //ddlSelfPay.DataBind(); //ddlSelfPay.SelectedIndex = 0; //Session["PaymentApplyProcess"] = payApplyView; float m = float.Parse(maxPay); float s = float.Parse(selfReceiving); paymentApplyTable.Rows[0]["custMaxPay"] = maxPay; lblMainContractPay.Text = m.ToString("p"); lblSubContractPay.Text = s.ToString("p"); #endregion #region ddlSelfReceipt DataTable dtNomal = new DataTable(); dtNomal.Columns.Add("DataTextField", Type.GetType("System.String")); dtNomal.Columns.Add("DataValueField", Type.GetType("System.Single")); float num = 0; float max = m - s + 0.05f; max = max <= 0.05f ? 0.05f : max; DataRow dr = null; for (float i = num; i < max; i = i + 0.05f) { dr = dtNomal.NewRow(); dr["DataTextField"] = i.ToString("p"); dr["DataValueField"] = i; dtNomal.Rows.Add(dr); } DataTable dtSpecial = new DataTable(); dtSpecial.Columns.Add("DataTextField", Type.GetType("System.String")); dtSpecial.Columns.Add("DataValueField", Type.GetType("System.Single")); num = 0; max = 1.05f - s; dr = null; for (float i = num; i < max; i = i + 0.05f) { dr = dtSpecial.NewRow(); dr["DataTextField"] = i.ToString("p"); dr["DataValueField"] = i; dtSpecial.Rows.Add(dr); //licNomal.Add(new ListItem(i.ToString("p"), i.ToString())); } Session["dtNomal"] = dtNomal; Session["dtSpecial"] = dtSpecial; #endregion ddlSelfPay.DataSource = Session["dtNomal"]; ddlSelfPay.DataValueField = "DataValueField"; ddlSelfPay.DataTextField = "DataTextField"; ddlSelfPay.DataBind(); ddlSelfPay.SelectedIndex = 0; Session["PaymentApplyProcess"] = payApplyView; } }
protected void Page_Load(object sender, EventArgs e) { if (!(null == Session["totleAuthority"])) { //int usrAuth = 0; //string strUsrAuth = Session["totleAuthority"] as string; //usrAuth = int.Parse(strUsrAuth); //int flag = 0x1 << 3; //if ((usrAuth & flag) == 0) // Response.Redirect("~/Main/NoAuthority.aspx"); AuthAttributes usrAuthAttr = (AuthAttributes)Session["totleAuthority"]; bool flag = usrAuthAttr.HasOneFlag(AuthAttributes.projectTagApply); 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; string projectDetail = "sell"; Xm_db xmDataCont = Xm_db.GetInstance(); var projectTagEdit = from projectTag in xmDataCont.View_project_tag where projectTag.EndTime > DateTime.Now && projectTag.ProjectDetail.Equals(projectDetail) select new { projectTag.ProjectTag, projectTag.ProjectSynopsis, projectTag.CustCompName, projectTag.CustCompAddress, projectTag.CustManName, projectTag.CustManContact, projectTag.CustManEmail, projectTag.ApplymentUsrName, projectTag.ApplymentUsrMobile, projectTag.StartTime }; //DataSet MyDst = new DataSet(); //ProjectTagProcess myView = new ProjectTagProcess(MyDst); //string projectDetail = "sell"; //myView.RealProjTagList(projectDetail); //DataTable taskTable = myView.MyDst.Tables["view_project_tag"]; DataTable taskTable = projectTagEdit.Distinct().ToDataTable(); //Session["ProjectTagProcess"] = myView; Session["dtSources"] = taskTable; projectInfoGV.DataSource = Session["dtSources"]; projectInfoGV.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!(null == Session["totleAuthority"])) { AuthAttributes usrAuthAttr = (AuthAttributes)Session["totleAuthority"]; bool flag = usrAuthAttr.HasOneFlag(AuthAttributes.pay_receiptApply | AuthAttributes.pay_receiptOk); if (!flag) { Response.Redirect("~/Main/NoAuthority.aspx"); } } else { string url = Request.FilePath; Session["backUrl"] = url; Response.Redirect("~/Account/Login.aspx"); } if (null == Session["seldMainContract"]) { Response.Redirect("~/Main/paymentReceiptManager/mainContractReceiptView.aspx"); } if (!IsPostBack) { DataRow sessionDr = Session["seldMainContract"] as DataRow; string strMainContractId = sessionDr["mainContractId"].ToString(); string strFilter = " mainContractId = " + "'" + strMainContractId + "'"; #region selMainContract lblProjectTag.Text = sessionDr["projectTag"].ToString(); lblMainContractTag.Text = sessionDr["mainContractTag"].ToString(); lblCust.Text = sessionDr["custCompName"].ToString(); lblMainContractMoney.Text = sessionDr["cash"].ToString(); lblMainContractDateLine.Text = sessionDr["dateLine"].ToString(); lblMainContractPayment.Text = sessionDr["paymentMode"].ToString(); #endregion #region subContractGV //DataSet vscsDst = new DataSet(); //subContractProcess vscsView = new subContractProcess(vscsDst); //vscsView.RealSubContractSupplierView(); //DataTable taskTable = vscsView.MyDst.Tables["view_subContract_supplier"].DefaultView.ToTable(); Xm_db xmDataCont = Xm_db.GetInstance(); int mainContractId = int.Parse(strMainContractId); reflash(mainContractId, xmDataCont); //taskTable.DefaultView.RowFilter = strFilter; //dt_modify(taskTable, strFilter); //Session["subContractProcess"] = vscsView; //Session["dtSources"] = taskTable; subContractGV.DataSource = Session["dtSources"]; subContractGV.DataBind(); #endregion AuthAttributes usrAuthAttr = (AuthAttributes)Session["totleAuthority"]; //bool flag = usrAuthAttr.hasOneFlag(AuthAttributes.pay_receiptApply | AuthAttributes.projectTagApply); if (usrAuthAttr.HasOneFlag(AuthAttributes.pay_receiptApply)) { subContractGV.Columns[6].Visible = false; } else if (usrAuthAttr.HasOneFlag(AuthAttributes.pay_receiptOk)) { subContractGV.Columns[8].Visible = false; } } }
public static bool HasOneFlag(this AuthAttributes falgs, AuthAttributes processFlag) { bool rtn = (falgs & processFlag) != 0; return(rtn); }
protected void Page_Load(object sender, EventArgs e) { if (!(null == Session["totleAuthority"])) { AuthAttributes usrAuthAttr = (AuthAttributes)Session["totleAuthority"]; bool flag = usrAuthAttr.HasOneFlag(AuthAttributes.bor_retExamine); 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; //DataSet MyDst = new DataSet(); //ProjectTagProcess myView = new ProjectTagProcess(MyDst); //string projectDetail = "borrow"; //myView.RealProjTagList(projectDetail); //DataTable taskTable = myView.MyDst.Tables["view_project_tag"].DefaultView.ToTable(); //dt_modify(taskTable, string.Empty); //Session["ProjectTagProcess"] = myView; //Session["dtSources"] = taskTable; //projectInfoGV.DataSource = Session["dtSources"]; //projectInfoGV.DataBind(); Xm_db xmDataContext = Xm_db.GetInstance(); var projectBorrow = from project in xmDataContext.View_project_tag where project.DoneTime > DateTime.Now && project.EndTime > DateTime.Now && project.ProjectDetail == "borrow" && project.ApproveUsrId == int.Parse(usrId) && project.Approve.Equals("unDo") select project; //List<view_project_tag> temp = query1.ToList<view_project_tag>(); //DataTable dt = new DataTable(); //temp[0].GetType().GetProperties()[0].Name //foreach (var t in temp) //{ // if (string.IsNullOrWhiteSpace(t.approveUsrName)) // { // t.approveUsrName = t.custCompName; // } //} //dt.BeginLoadData(); //dt.LoadDataRow(temp.ToArray<view_project_tag>(), true); //dt.EndLoadData(); DataTable dt = projectBorrow.ToDataTable(); Session["dtSources"] = dt; projectInfoGV.DataSource = dt; projectInfoGV.DataBind(); } }
public static AuthAttributes Set(this AuthAttributes falgs, AuthAttributes processFlag) { AuthAttributes authAttr = falgs | processFlag; return(authAttr); }
protected void Page_Load(object sender, EventArgs e) { if (!(null == Session["totleAuthority"])) { AuthAttributes usrAuthAttr = (AuthAttributes)Session["totleAuthority"]; bool flag = usrAuthAttr.HasOneFlag(AuthAttributes.pay_receiptExamine); if (!flag) { Response.Redirect("~/Main/NoAuthority.aspx"); } } else { string url = Request.FilePath; Session["backUrl"] = url; Response.Redirect("~/Account/Login.aspx"); } if (!IsPostBack) { DataRow sessionDr = Session["seldSelfPayment"] as DataRow; string strSubContractId = sessionDr["subContractId"].ToString(); #region dr DataSet MyDst = new DataSet(); subContractProcess subContractView = new subContractProcess(MyDst); subContractView.FullSubContractInfo(); DataTable taskTable = subContractView.MyDst.Tables["view_full_subContractInfo"].DefaultView.ToTable(); string strFilter = " subContractId = " + "'" + strSubContractId + "'"; taskTable.DefaultView.RowFilter = strFilter; DataRow dr = taskTable.DefaultView.ToTable().Rows[0]; #endregion #region context_input lblProjectTag.Text = dr["projectTag"].ToString(); lblSubContractTag.Text = dr["subContractTag"].ToString(); lblSupplier.Text = dr["supplierName"].ToString(); lblSubContractMoney.Text = dr["cash"].ToString(); lblSubContractDateLine.Text = dr["dateLine"].ToString(); lblSubContractPayment.Text = dr["paymentMode"].ToString(); lblCustPayMax.Text = float.Parse(sessionDr["custMaxPay"].ToString()).ToString("p"); lblSelfToPay.Text = float.Parse(sessionDr["toPayCash"].ToString()).ToString("c"); lblSelfHasPay.Text = float.Parse(sessionDr["hasPayPercent"].ToString()).ToString("p"); lblSelfTotlePay.Text = float.Parse(sessionDr["payPercent"].ToString()).ToString("p"); txtPayExplication.Text = sessionDr["paymentExplication"].ToString(); string strDone = sessionDr["Done"].ToString(); lblDone.Text = strDone; txtPayComment.Text = sessionDr["paymentComment"].ToString(); DateTime doneTime = (DateTime)dr["doneTime"]; if (doneTime > DateTime.Now) { btnOK.Visible = true; btnNo.Visible = true; } #endregion } }
protected void btnAccept_Click(object sender, EventArgs e) { int index = usrGV.SelectedIndex; Label lblUsrId = usrGV.Rows[index].FindControl("lblUsrId") as Label; CheckBoxList cbl = usrGV.Rows[index].FindControl("cblUsrAuth") as CheckBoxList; AuthAttributes authAttr = AuthAttributes.unKnow; AuthAttributes authAttrTemp; foreach (ListItem li in cbl.Items) { if (li.Selected) { Enum.TryParse <AuthAttributes>(li.Value, out authAttrTemp); authAttr = authAttr.Set(authAttrTemp); } else { } } int usrId = int.Parse(lblUsrId.Text); Xm_db xmDataCont = Xm_db.GetInstance(); var usrAuthInfo = from usr in xmDataCont.Tbl_usr where usr.EndTime > DateTime.Now && usr.UsrId == usrId select usr; usrAuthInfo.First().TotleAuthority = (Int32)authAttr; try { xmDataCont.SubmitChanges(System.Data.Linq.ConflictMode.ContinueOnConflict); } catch (System.Data.Linq.ChangeConflictException cce) { string strEx = cce.Message; foreach (System.Data.Linq.ObjectChangeConflict occ in xmDataCont.ChangeConflicts) { occ.Resolve(System.Data.Linq.RefreshMode.KeepChanges); } xmDataCont.SubmitChanges(); } var usrAuthView = from usrAuth in xmDataCont.View_usr where usrAuth.UsrEd > DateTime.Now select new { usrAuth.UsrId, usrAuth.UsrName, usrAuth.RealName, usrAuth.DepartmentName, usrAuth.TitleName, usrAuth.TotleAuthority }; DataTable taskTable = usrAuthView.Distinct().ToDataTable(); Session["dtSources"] = taskTable; usrGV.DataSource = Session["dtSources"]; usrGV.DataBind(); usrGV.SelectedIndex = -1; cbl.Visible = false; LinkButton lkb = usrGV.Rows[index].FindControl("toEdit") as LinkButton; lkb.Visible = true; btnAccept.Visible = false; btnCancel.Visible = false; usrGV.Columns[7].Visible = true; usrGV.Columns[6].Visible = false; }