public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; NFMT.Common.ResultModel result = new NFMT.Common.ResultModel(); int stockMoveApplyId = 0; if (!string.IsNullOrEmpty(context.Request.Form["id"])) { if (!int.TryParse(context.Request.Form["id"], out stockMoveApplyId)) { result.Message = "参数错误"; context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result)); context.Response.End(); } } string memo = context.Request.Form["memo"]; NFMT.WareHouse.BLL.StockMoveBLL stockMoveBLL = new NFMT.WareHouse.BLL.StockMoveBLL(); result = stockMoveBLL.StockMoveCreateHandle(user, stockMoveApplyId, memo); if (result.ResultStatus == 0) result.Message = "新增成功"; context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result)); }
protected void Page_Load(object sender, EventArgs e) { NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; string redirectUrl = string.Format("{0}WareHouse/StockMoveList.aspx", NFMT.Common.DefaultValue.NftmSiteName); if (!IsPostBack) { Utility.VerificationUtility ver = new Utility.VerificationUtility(); ver.JudgeOperate(this.Page, 46, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.修改 }); this.navigation1.Routes.Add("移库", redirectUrl); this.navigation1.Routes.Add("移库修改", string.Empty); int stockMoveId = 0; if (string.IsNullOrEmpty(Request.QueryString["id"]) || !int.TryParse(Request.QueryString["id"], out stockMoveId) || stockMoveId <= 0) Response.Redirect(redirectUrl); this.hidid.Value = stockMoveId.ToString(); NFMT.WareHouse.BLL.StockMoveBLL stockMoveBLL = new NFMT.WareHouse.BLL.StockMoveBLL(); NFMT.Common.ResultModel result = stockMoveBLL.Get(user, stockMoveId); if (result.ResultStatus != 0) Response.Redirect(redirectUrl); NFMT.WareHouse.Model.StockMove stockMove = result.ReturnValue as NFMT.WareHouse.Model.StockMove; if (stockMove == null) Response.Redirect(redirectUrl); this.hidStockMoveApplyId.Value = stockMove.StockMoveApplyId.ToString(); //this.hidDPId.Value = stockMove.DeliverPlaceId.ToString(); this.txbMoveMemo.Value = stockMove.MoveMemo; } }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; NFMT.Common.ResultModel result = new NFMT.Common.ResultModel(); int stockMoveId = 0; if (!string.IsNullOrEmpty(context.Request.Form["id"])) { if (!int.TryParse(context.Request.Form["id"], out stockMoveId)) { result.Message = "参数错误"; context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result)); context.Response.End(); } } NFMT.WareHouse.Model.StockMove stockMove = new NFMT.WareHouse.Model.StockMove() { StockMoveId = stockMoveId }; NFMT.WareHouse.BLL.StockMoveBLL bll = new NFMT.WareHouse.BLL.StockMoveBLL(); result = bll.Invalid(user, stockMove); if (result.ResultStatus == 0) result.Message = "作废成功"; context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result)); }
public void ProcessRequest(HttpContext context) { NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; int pageIndex = 1, pageSize = 10; string orderStr = string.Empty, whereStr = string.Empty; int status = 0; if (!string.IsNullOrEmpty(context.Request.QueryString["s"])) { if (!int.TryParse(context.Request.QueryString["s"], out status)) status = 0; } int mover = 0; if (!string.IsNullOrEmpty(context.Request.QueryString["m"])) { if (!int.TryParse(context.Request.QueryString["m"], out mover)) mover = 0; } int deliverPlaceId = 0; if (!string.IsNullOrEmpty(context.Request.QueryString["d"])) { if (!int.TryParse(context.Request.QueryString["d"], out deliverPlaceId)) deliverPlaceId = 0; } if (!string.IsNullOrEmpty(context.Request.QueryString["pagenum"])) int.TryParse(context.Request.QueryString["pagenum"], out pageIndex); pageIndex++; if (!string.IsNullOrEmpty(context.Request.QueryString["pagesize"])) int.TryParse(context.Request.QueryString["pagesize"], out pageSize); if (!string.IsNullOrEmpty(context.Request.QueryString["sortdatafield"]) && !string.IsNullOrEmpty(context.Request.QueryString["sortorder"])) orderStr = string.Format("{0} {1}", context.Request.QueryString["sortdatafield"].Trim(), context.Request.QueryString["sortorder"].Trim()); NFMT.WareHouse.BLL.StockMoveBLL stockMoveBLL = new NFMT.WareHouse.BLL.StockMoveBLL(); NFMT.Common.SelectModel select = stockMoveBLL.GetSelectModel(pageIndex, pageSize, orderStr, status, mover, deliverPlaceId); NFMT.Common.ResultModel result = stockMoveBLL.Load(user, select); context.Response.ContentType = "application/json; charset=utf-8"; if (result.ResultStatus != 0) { context.Response.Write(result.Message); context.Response.End(); } System.Data.DataTable dt = result.ReturnValue as System.Data.DataTable; System.Collections.Generic.Dictionary<string, object> dic = new System.Collections.Generic.Dictionary<string, object>(); dic.Add("count", result.AffectCount); dic.Add("data", dt); string postData = Newtonsoft.Json.JsonConvert.SerializeObject(dic); context.Response.Write(postData); }
public void ProcessRequest(HttpContext context) { NFMT.Common.ResultModel result = new NFMT.Common.ResultModel(); context.Response.ContentType = "text/plain"; int stockMoveId = 0; int operateId = 0; if (!int.TryParse(context.Request.Form["id"], out stockMoveId) || stockMoveId <= 0) { result.Message = "报关序号错误"; context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result)); context.Response.End(); } if (!int.TryParse(context.Request.Form["oi"], out operateId) || operateId <= 0) { result.Message = "操作错误"; context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result)); context.Response.End(); } NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; NFMT.Common.OperateEnum operateEnum = (NFMT.Common.OperateEnum)operateId; NFMT.WareHouse.BLL.StockMoveBLL bll = new NFMT.WareHouse.BLL.StockMoveBLL(); switch (operateEnum) { case NFMT.Common.OperateEnum.撤返: result = bll.GoBack(user, stockMoveId); break; case NFMT.Common.OperateEnum.作废: result = bll.Invalid(user, stockMoveId); break; case NFMT.Common.OperateEnum.执行完成: result = bll.Complete(user, stockMoveId); break; case NFMT.Common.OperateEnum.执行完成撤销: result = bll.CompleteCancel(user, stockMoveId); break; case NFMT.Common.OperateEnum.关闭: result = bll.Close(user, stockMoveId); break; } if (result.ResultStatus == 0) result.Message = string.Format("{0}成功", operateEnum.ToString()); context.Response.Write(Newtonsoft.Json.JsonConvert.SerializeObject(result)); }
public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; NFMT.Common.ResultModel result = new NFMT.Common.ResultModel(); if (string.IsNullOrEmpty(context.Request.Form["source"])) { result.Message = "数据源为空"; result.ResultStatus = -1; context.Response.Write(serializer.Serialize(result)); context.Response.End(); } bool isPass = false; if (string.IsNullOrEmpty(context.Request.Form["ispass"]) || !bool.TryParse(context.Request.Form["ispass"], out isPass)) { result.Message = "审核结果错误"; result.ResultStatus = -1; context.Response.Write(serializer.Serialize(result)); context.Response.End(); } try { string jsonData = context.Request.Form["source"]; var obj = serializer.Deserialize<NFMT.WorkFlow.Model.DataSource>(jsonData); NFMT.WareHouse.BLL.StockMoveBLL bll = new NFMT.WareHouse.BLL.StockMoveBLL(); result = bll.Audit(user, obj, isPass); } catch (Exception ex) { result.Message = ex.Message; result.ResultStatus = -1; } context.Response.Write(serializer.Serialize(result)); context.Response.End(); }
protected void Page_Load(object sender, EventArgs e) { System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer(); NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; string redirectUrl = string.Format("{0}WareHouse/StockMoveList.aspx", NFMT.Common.DefaultValue.NftmSiteName); if (!IsPostBack) { Utility.VerificationUtility ver = new Utility.VerificationUtility(); ver.JudgeOperate(this.Page, 46, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.提交审核, NFMT.Common.OperateEnum.作废, NFMT.Common.OperateEnum.撤返, NFMT.Common.OperateEnum.执行完成 }); this.navigation1.Routes.Add("移库", redirectUrl); this.navigation1.Routes.Add("移库明细", string.Empty); if (string.IsNullOrEmpty(Request.QueryString["id"]) || !int.TryParse(Request.QueryString["id"], out stockMoveId) || stockMoveId <= 0) Response.Redirect(redirectUrl); this.hidid.Value = stockMoveId.ToString(); NFMT.WareHouse.BLL.StockMoveBLL stockMoveBLL = new NFMT.WareHouse.BLL.StockMoveBLL(); NFMT.Common.ResultModel result = stockMoveBLL.Get(user, stockMoveId); if (result.ResultStatus != 0) Response.Redirect(redirectUrl); stockMove = result.ReturnValue as NFMT.WareHouse.Model.StockMove; if (stockMove == null) Response.Redirect(redirectUrl); NFMT.WareHouse.BLL.StockMoveDetailBLL stockMoveDetailBLL = new NFMT.WareHouse.BLL.StockMoveDetailBLL(); NFMT.Common.StatusEnum getDetailStatus = NFMT.Common.StatusEnum.已生效; if (stockMove.MoveStatus == NFMT.Common.StatusEnum.已完成) getDetailStatus = NFMT.Common.StatusEnum.已完成; else if (stockMove.MoveStatus == NFMT.Common.StatusEnum.已关闭) getDetailStatus = NFMT.Common.StatusEnum.已关闭; result = stockMoveDetailBLL.Load(user, stockMoveId, getDetailStatus); if (result.ResultStatus != 0) Response.Redirect(redirectUrl); List<NFMT.WareHouse.Model.StockMoveDetail> stockMoveDetails = result.ReturnValue as List<NFMT.WareHouse.Model.StockMoveDetail>; if (stockMoveDetails == null || !stockMoveDetails.Any()) Response.Redirect(redirectUrl); foreach (NFMT.WareHouse.Model.StockMoveDetail detail in stockMoveDetails) { NFMT.WareHouse.BLL.StockBLL stockBLL = new NFMT.WareHouse.BLL.StockBLL(); result = stockBLL.Get(user, detail.StockId); if (result.ResultStatus != 0) Response.Redirect(redirectUrl); NFMT.WareHouse.Model.Stock stock = result.ReturnValue as NFMT.WareHouse.Model.Stock; if (stock == null) Response.Redirect(redirectUrl); NFMT.Data.Model.DeliverPlace deliverPlace = NFMT.Data.BasicDataProvider.DeliverPlaces.SingleOrDefault(a => a.DPId == stock.DeliverPlaceId); if (deliverPlace == null) Response.Redirect(redirectUrl); break; } this.hidStockMoveApplyId.Value = stockMove.StockMoveApplyId.ToString(); this.txbMoveMemo.InnerText = stockMove.MoveMemo; NFMT.Common.AuditModel auditModel = new NFMT.Common.AuditModel() { AssName = stockMove.AssName, DalName = stockMove.DalName, DataBaseName = stockMove.DataBaseName, Id = stockMove.Id, Status = stockMove.Status, TableName = stockMove.TableName }; string json = serializer.Serialize(auditModel); this.hidModel.Value = json; } }
protected void Page_Load(object sender, EventArgs e) { System.Web.Script.Serialization.JavaScriptSerializer serializer = new System.Web.Script.Serialization.JavaScriptSerializer(); string redirectURL = string.Format("{0}WareHouse/StockMoveApplyList.aspx", NFMT.Common.DefaultValue.NftmSiteName); if (!IsPostBack) { Utility.VerificationUtility ver = new Utility.VerificationUtility(); ver.JudgeOperate(this.Page, 45, new List<NFMT.Common.OperateEnum>() { NFMT.Common.OperateEnum.提交审核, NFMT.Common.OperateEnum.作废, NFMT.Common.OperateEnum.撤返, NFMT.Common.OperateEnum.确认完成 }); NFMT.Common.UserModel user = Utility.UserUtility.CurrentUser; NFMT.Common.ResultModel result = new NFMT.Common.ResultModel(); this.navigation1.Routes.Add("移库申请", redirectURL); this.navigation1.Routes.Add("移库申请明细", string.Empty); NFMT.WareHouse.BLL.StockMoveApplyBLL stockMoveApplyBLL = new NFMT.WareHouse.BLL.StockMoveApplyBLL(); if (!string.IsNullOrEmpty(Request.QueryString["aid"]) && int.TryParse(Request.QueryString["aid"], out applyId) && applyId > 0) { result = stockMoveApplyBLL.GetStockMoveApplyByApplyId(user, applyId); if (result.ResultStatus != 0) Response.Redirect(redirectURL); stockMoveApply = result.ReturnValue as NFMT.WareHouse.Model.StockMoveApply; if (stockMoveApply == null) Response.Redirect(redirectURL); } else { if (string.IsNullOrEmpty(Request.QueryString["id"]) || !int.TryParse(Request.QueryString["id"], out id)) Response.Redirect(redirectURL); //获取移库申请 result = stockMoveApplyBLL.Get(user, id); if (result.ResultStatus != 0) Response.Redirect(redirectURL); stockMoveApply = result.ReturnValue as NFMT.WareHouse.Model.StockMoveApply; if (stockMoveApply == null) Response.Redirect(redirectURL); } id = stockMoveApply.StockMoveApplyId; applyId = stockMoveApply.ApplyId; this.hidid.Value = id.ToString(); NFMT.WareHouse.BLL.StockMoveBLL stockMoveBLL = new NFMT.WareHouse.BLL.StockMoveBLL(); result = stockMoveBLL.GetStockMoveIdByApplyId(user, id); if (result.ResultStatus == 0) { this.hidStockMoveId.Value = result.ReturnValue.ToString(); } //获取申请信息 NFMT.Operate.BLL.ApplyBLL applyBLL = new NFMT.Operate.BLL.ApplyBLL(); result = applyBLL.Get(user, stockMoveApply.ApplyId); if (result.ResultStatus != 0) Response.Redirect(redirectURL); apply = result.ReturnValue as NFMT.Operate.Model.Apply; if (apply == null) Response.Redirect(redirectURL); NFMT.User.Model.Department dept = NFMT.User.UserProvider.Departments.SingleOrDefault(a => a.DeptId == apply.ApplyDept); if (dept == null) Response.Redirect(redirectURL); NFMT.User.Model.Corporation corp = NFMT.User.UserProvider.Corporations.SingleOrDefault(a => a.CorpId == apply.ApplyCorp); if (corp == null) Response.Redirect(redirectURL); NFMT.User.Model.Employee emp = NFMT.User.UserProvider.Employees.SingleOrDefault(a => a.EmpId == apply.EmpId); if (emp == null) Response.Redirect(redirectURL); this.txbApplyDept.InnerText = dept.DeptName; this.txbMemo.InnerText = apply.ApplyDesc; this.txbApplyCorp.InnerText = corp.CorpName; this.txbApplyPerson.InnerText = emp.Name; string json = serializer.Serialize(apply); this.hidmodel.Value = json; } }