private string GetEncryptDencryptPortalUserName() { string supplierCode = string.Empty; try { com.Sconit.Entity.ACC.User user = SecurityContextHolder.Get(); Supplier supplier = base.genericMgr.FindById <Supplier>(user.Name); EncryptDencryptService.EncryptDencryptService encryptDencryptService = new EncryptDencryptService.EncryptDencryptService(); supplierCode = encryptDencryptService.EncryptDencrypt(supplier.ShortCode, true, "sih_dms"); } catch (Exception ex) { } return(Server.UrlEncode(supplierCode)); }
public ActionResult OrderDetailList(GridCommand command, string orderNo) { ViewBag.OrderNo = orderNo; ViewBag.PageSize = base.ProcessPageSize(command.PageSize); com.Sconit.Entity.ACC.User user = SecurityContextHolder.Get(); IList <OrderMaster> orderMasterList = null; if (user.Code.Trim().ToLower() != "su") { orderMasterList = base.genericMgr.FindAll <OrderMaster>("from OrderMaster as o where o.OrderNo=? and exists (select 1 from UserPermissionView as up where up.UserId =" + user.Id + " and up.PermissionCategoryType = " + (int)com.Sconit.CodeMaster.PermissionCategoryType.Supplier + " and up.PermissionCode = o.PartyFrom)", orderNo); if (orderMasterList.Count <= 0) { SaveErrorMessage("订单号不存在或您没有权限,请重新输入!"); } } return(PartialView()); }
private SearchStatementModel PrepareSearchStatement(GridCommand command, HuSearchModel searchModel) { string whereStatement = string.Empty; com.Sconit.Entity.ACC.User user = SecurityContextHolder.Get(); IList <object> param = new List <object>(); HqlStatementHelper.AddLikeStatement("HuId", searchModel.HuId, HqlStatementHelper.LikeMatchMode.Start, "h", ref whereStatement, param); HqlStatementHelper.AddEqStatement("Item", searchModel.Item, "h", ref whereStatement, param); HqlStatementHelper.AddLikeStatement("LotNo", searchModel.lotNo, HqlStatementHelper.LikeMatchMode.Start, "h", ref whereStatement, param); HqlStatementHelper.AddEqStatement("ManufactureParty", searchModel.ManufactureParty, "h", ref whereStatement, param); HqlStatementHelper.AddEqStatement("CreateUserId", user.Id, "h", ref whereStatement, param); if (searchModel.StartDate != null & searchModel.EndDate != null) { HqlStatementHelper.AddBetweenStatement("CreateDate", searchModel.StartDate, searchModel.EndDate, "h", ref whereStatement, param); } else if (searchModel.StartDate != null & searchModel.EndDate == null) { HqlStatementHelper.AddGeStatement("CreateDate", searchModel.StartDate, "h", ref whereStatement, param); } else if (searchModel.StartDate == null & searchModel.EndDate != null) { HqlStatementHelper.AddLeStatement("CreateDate", searchModel.EndDate, "h", ref whereStatement, param); } string sortingStatement = HqlStatementHelper.GetSortingStatement(command.SortDescriptors); if (command.SortDescriptors.Count == 0) { sortingStatement = " order by CreateDate desc"; } SearchStatementModel searchStatementModel = new SearchStatementModel(); searchStatementModel.SelectCountStatement = selectCountStatement; searchStatementModel.SelectStatement = selectStatement; searchStatementModel.WhereStatement = whereStatement; searchStatementModel.SortingStatement = sortingStatement; searchStatementModel.Parameters = param.ToArray <object>(); return(searchStatementModel); }
public ActionResult _AjaxOrderDetailList(GridCommand command, OrderMasterSearchModel searchModel) { com.Sconit.Entity.ACC.User user = SecurityContextHolder.Get(); IList <OrderMaster> orderMasterList = null; if (user.Code.Trim().ToLower() != "su") { orderMasterList = base.genericMgr.FindAll <OrderMaster>("from OrderMaster as o where o.OrderNo=? and exists (select 1 from UserPermissionView as up where up.UserId =" + user.Id + " and up.PermissionCategoryType = " + (int)com.Sconit.CodeMaster.PermissionCategoryType.Supplier + " and up.PermissionCode = o.PartyFrom)", searchModel.OrderNo); if (orderMasterList.Count <= 0) { return(PartialView(new GridModel(new List <OrderDetail>()))); } } SearchStatementModel searchStatementModel = PrepareOrderDetailSearchStatement(command, searchModel); GridModel <OrderDetail> List = GetAjaxPageData <OrderDetail>(searchStatementModel, command); try { foreach (OrderDetail orderDetail in List.Data) { orderDetail.LotNo = LotNoHelper.GenerateLotNo(); } OrderMaster order = base.genericMgr.FindById <OrderMaster>(searchModel.OrderNo); foreach (OrderDetail orderDetail in List.Data) { orderDetail.ManufactureParty = order.PartyFrom; orderDetail.HuQty = orderDetail.OrderedQty; } return(View(List)); } catch (Exception) { return(PartialView(new GridModel(new List <IpLocationDetail>()))); } }