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 btnRtn_Click(object sender, EventArgs e) { int usrId = int.Parse(Session["usrId"] as string); DataSet myDst = new DataSet(); ProductStockProcess pspView = new ProductStockProcess(myDst); pspView.RealProductStockCheckManView(); DataTable taskTable = pspView.MyDst.Tables["view_productStockCheckMan"].DefaultView.ToTable(); string strFilter = " usrId = " + usrId; DataRow dr = (DataRow)taskTable.Rows[0]; Response.Buffer = true; Response.Clear(); Response.ContentType = dr["contentType"].ToString(); Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(dr["checkTextName"].ToString(), System.Text.Encoding.UTF8)); Response.BinaryWrite((Byte[])dr["productCheckText"]); Response.Flush(); Response.End(); }
protected void btnOk_Click(object sender, EventArgs e) { if (inputCheck()) { string strProductId = ddlProduct.SelectedValue; string strProductTag = txtProductTag.Text.Trim(); string strSupplierId = ddlSupplier.SelectedValue; string strUsrId = ddlEngineer.SelectedValue; DataRow productInRow = null; DataColumn colProductId = new DataColumn("productId", System.Type.GetType("System.String")); DataColumn colProductTag = new DataColumn("productTag", System.Type.GetType("System.String")); DataColumn colSupplierId = new DataColumn("supplierId", System.Type.GetType("System.String")); DataColumn colUsrId = new DataColumn("usrId", System.Type.GetType("System.String")); DataTable productInTable = new DataTable("addTable"); productInTable.Columns.Add(colProductId); productInTable.Columns.Add(colProductTag); productInTable.Columns.Add(colSupplierId); productInTable.Columns.Add(colUsrId); productInRow = productInTable.NewRow(); productInRow["productId"] = strProductId; productInRow["productTag"] = strProductTag; productInRow["supplierId"] = strSupplierId; productInRow["usrId"] = strUsrId; productInTable.Rows.Add(productInRow); #region dataset DataSet dataSet = new DataSet(); dataSet.Tables.Add(productInTable); #endregion ProductStockProcess psp = new ProductStockProcess(dataSet); //psp.DoCheckProductStock(); //int rowRtn = psp.IntRtn; string error = psp.Add_includeError(); if (string.IsNullOrEmpty(error)) { Xm_db xmDataCont = Xm_db.GetInstance(); int usrId = int.Parse(strUsrId); var usrInfo = from usr in xmDataCont.Tbl_usr where usr.UsrId == usrId && usr.EndTime > DateTime.Now select usr; string strProductName = ddlProduct.SelectedItem.Text; BeckSendMail.getMM().NewMail(usrInfo.First().UsrEmail, "mis系统入库通知", "编号为" + strProductTag + "的" + strProductName + "等待您的校验" + System.Environment.NewLine + Request.Url.toNewUrlForMail("/Main/stockInfoManager/productCheckView.aspx")); Response.Redirect("~/Main/DefaultMainSite.aspx"); } else { this.txtProductTag.Text = error; } } }