protected void Page_Load(object sender, EventArgs e) { user = (User)Session["user"]; permission(); //获取供应商 dsSupplier = bookbll.selectSupplier(); //getData(); //获取组织 dsRegion = regionBll.select(); string op = Request["op"]; if (op == "paging") { getData(); } if (op == "logout") { //删除身份凭证 FormsAuthentication.SignOut(); //设置Cookie的值为空 Response.Cookies[FormsAuthentication.FormsCookieName].Value = null; //设置Cookie的过期时间为上个月今天 Response.Cookies[FormsAuthentication.FormsCookieName].Expires = DateTime.Now.AddMonths(-1); } }
protected void Page_Load(object sender, EventArgs e) { User user = (User)Session["user"]; userName = user.UserName; regionName = user.ReginId.RegionName; string op = Request["op"]; if (op == "paging") { getData(); } if (op == "exportAll") { //export(); exportAll(); } if (op == "exportDe") { //exportDe(); exportDetail(); } else { permission(); //获取供应商 dsSupplier = bookBll.selectSupplier(); //获取组织 dsRegion = regionBll.select(); //获取客户 dsCustom = customBll.select(); } if (op == "logout") { //删除身份凭证 FormsAuthentication.SignOut(); //设置Cookie的值为空 Response.Cookies[FormsAuthentication.FormsCookieName].Value = null; //设置Cookie的过期时间为上个月今天 Response.Cookies[FormsAuthentication.FormsCookieName].Expires = DateTime.Now.AddMonths(-1); } if (op == "print") { Response.Write(print()); Response.End(); } }
protected void Page_Load(object sender, EventArgs e) { string tjType = Request["type"]; string tjRegion = Request["region"]; string tjHeadId = Request["singleHeadId"]; string tjuserName = Request["userName"]; string tjtime = Request["time"]; string defaultWhere = ""; if (tjRegion != "null" && tjRegion != "" && tjRegion != null) { if (defaultWhere == "") { defaultWhere += "regionName='" + tjRegion + "'"; } else { defaultWhere += " and regionName='" + tjRegion + "'"; } } if (tjHeadId != "null" && tjHeadId != "" && tjHeadId != null) { if (defaultWhere == "") { defaultWhere += "singleHeadId='" + tjHeadId + "'"; } else { defaultWhere += " and singleHeadId='" + tjHeadId + "'"; } } if (tjuserName != "null" && tjuserName != "" && tjuserName != null) { if (defaultWhere == "") { defaultWhere += "userName='******'"; } else { defaultWhere += " and userName='******'"; } } if (tjtime != "null" && tjtime != "" && tjtime != null) { if (defaultWhere == "") { string[] sArray = tjtime.Split('至'); string startTime = sArray[0]; string endTime = sArray[1]; defaultWhere += "time BETWEEN '" + startTime + "' and '" + endTime + "'"; } else { string[] sArray = tjtime.Split('至'); string startTime = sArray[0]; string endTime = sArray[1]; defaultWhere += " and time BETWEEN '" + startTime + "' and '" + endTime + "'"; } } int type = 0; if (tjType == "CK") { type = 0; title = "接收组织"; } if (tjType == "RK") { type = 1; title = "入库来源"; } if (tjType == "TH") { type = 2; title = "接收组织"; } User user = (User)Session["user"]; string userId = user.UserId; DataSet ds = roleBll.selectRole(userId); string roleName = ds.Tables[0].Rows[0]["roleName"].ToString(); DataSet dataSet = warehousingBll.getKinds(type, defaultWhere); sjNum = dataSet.Tables[0].Rows[0]["pz"].ToString(); sbNum = dataSet.Tables[0].Rows[0]["sl"].ToString(); total = dataSet.Tables[0].Rows[0]["my"].ToString(); real = dataSet.Tables[0].Rows[0]["sy"].ToString(); //string time = "2018-10-10"; int region = user.ReginId.RegionId; if (roleName == "超级管理员") { isAdmin = true; } //getData(); //获取供应商 dsSupplier = bookbll.selectSupplier(); //获取组织 dsRegion = regionBll.select(); //获取制单员 dsUser = bookbll.selectZdy(); //获取来源组织/收货组织 dsSource = bookbll.selectSource(); string op = Request["op"]; if (op == "paging") { getData(); } }
protected void Page_Load(object sender, EventArgs e) { permission(); dsSupplier = bookbll.selectSupplier(); //获取书号 BookBasicData bookId = bookbll.getBookNum(); if (!IsPostBack) { if (bookId.NewBookNum == "0" || bookId.NewBookNum == null || bookId.NewBookNum.Length < 8) { num = "0"; } else { num = bookId.NewBookNum; } ViewState["i"] = num; } //getData(); string op = Request["op"]; if (op == "paging") { getData(); } if (op == "del") { string bookNum = Request["bookNum"].ToString(); Result row = isDelete(); if (row == Result.记录不存在) { Result result = bookbll.Delete(bookNum); if (result == Result.除成功) { Response.Write("删除成功"); Response.End(); } else { Response.Write("删除失败"); Response.End(); } } else { Response.Write("此资料已有关联订单,无法删除!"); Response.End(); } } if (op == "check") { test(); } if (op == "export") { excelBook(); } string action = Request["action"]; if (action == "import") { differentDt(); //DataTable dtInsert = new DataTable(); //System.Diagnostics.Stopwatch watch = new System.Diagnostics.Stopwatch(); //watch.Start(); //differentDt(); //except.Columns.Remove("id"); //移除匹配列 //dtInsert = except; //赋给新table //TimeSpan ts = watch.Elapsed; //dtInsert.TableName = "T_BookBasicData"; //导入的表名 //int a = userBll.BulkInsert(dtInsert); //watch.Stop(); //double minute = ts.TotalMinutes; //计时 //string m = minute.ToString("0.00"); //if (a > 0) //{ // int cf = row - a; // BookBasicData bookNum = bookbll.getBookNum(); // Result result = bookbll.updateBookNum(last); //更新书号 // //Response.Write("导入成功,总数据有" + row + "条,共导入" + a + "条数据" + ",共用时:" + m + "分钟"); // Response.Write("导入成功,共导入数据"+a+"条数据,共有重复数据"+cf+"条"); // Response.End(); //} //else //{ // Response.Write("导入失败,可能重复导入"); // Response.End(); //} } if (op == "logout") { //删除身份凭证 FormsAuthentication.SignOut(); //设置Cookie的值为空 Response.Cookies[FormsAuthentication.FormsCookieName].Value = null; //设置Cookie的过期时间为上个月今天 Response.Cookies[FormsAuthentication.FormsCookieName].Expires = DateTime.Now.AddMonths(-1); } }