public ActionResult _AjaxIpLocationDetailList(GridCommand command, IpDetailSearchModel searchModel) { if (string.IsNullOrEmpty(searchModel.IpNo)) { return PartialView(new GridModel(new List<IpLocationDetail>())); } else { SearchStatementModel searchStatementModel = PrepareLocationDetailSearchStatement(command, searchModel); return PartialView(GetAjaxPageData<IpLocationDetail>(searchStatementModel, command)); } }
public ActionResult IpDetail(GridCommand command, IpDetailSearchModel searchModel, string ipNo) { searchModel.IpNo = ipNo; TempData["IpDetailSearchModel"] = searchModel; ViewBag.PageSize = base.ProcessPageSize(command.PageSize); return PartialView(); }
public ActionResult IpDetailList(GridCommand command, IpDetailSearchModel searchModel) { TempData["IpDetailSearchModel"] = searchModel; ViewBag.PageSize = base.ProcessPageSize(command.PageSize); if (string.IsNullOrEmpty(searchModel.IpNo)) { SaveWarningMessage(Resources.EXT.ControllerLan.Con_ShipOrderSearchConditionIsNeeded); } return PartialView(); }
public ActionResult _AjaxIpDetailList(GridCommand command, IpDetailSearchModel searchModel) { try { if (string.IsNullOrEmpty(searchModel.IpNo)) { throw new BusinessException(Resources.EXT.ControllerLan.Con_ShipOrderNumberNotExits); } else { var ipmaster = genericMgr.FindById<IpMaster>(searchModel.IpNo); if (!Utility.SecurityHelper.HasPermission(ipmaster)) { throw new BusinessException(Resources.EXT.ControllerLan.Con_LackTheShipOrderNumberPermission, searchModel.IpNo); } SearchStatementModel searchStatementModel = PrepareIpDetailSearchStatement(command, searchModel); GridModel<IpDetail> List = GetAjaxPageData<IpDetail>(searchStatementModel, command); foreach (IpDetail ipDetail in List.Data) { ipDetail.ManufactureParty = ipmaster.PartyFrom; ipDetail.LotNo = LotNoHelper.GenerateLotNo(); ipDetail.HuQty = ipDetail.Qty; if (!ipDetail.IsChangeUnitCount) { ipDetail.HuQty = Math.Ceiling(ipDetail.HuQty / ipDetail.UnitCount) * ipDetail.UnitCount; } } return PartialView(List); } } catch (Exception ex) { SaveErrorMessage(ex); return PartialView(new GridModel(new List<IpDetail>())); } }
private SearchStatementModel PrepareSearchDetailUnitPriceStatement(GridCommand command, IpDetailSearchModel searchModel, string whereStatement) { IList<object> param = new List<object>(); SecurityHelper.AddPartyFromAndPartyToPermissionStatement(ref whereStatement, "i", "OrderType", "i", "PartyFrom", "i", "PartyTo", com.Sconit.CodeMaster.OrderType.Procurement, false); HqlStatementHelper.AddLikeStatement("IpNo", searchModel.IpNo, HqlStatementHelper.LikeMatchMode.Start, "i", ref whereStatement, param); HqlStatementHelper.AddEqStatement("Item", searchModel.Item, "i", ref whereStatement, param); string sortingStatement = HqlStatementHelper.GetSortingStatement(command.SortDescriptors); if (command.SortDescriptors.Count == 0) { sortingStatement = " order by i.CreateDate desc"; } SearchStatementModel searchStatementModel = new SearchStatementModel(); searchStatementModel.SelectCountStatement = selectIpDetailCountStatement; searchStatementModel.SelectStatement = selectIpDetailStatement; searchStatementModel.WhereStatement = whereStatement; searchStatementModel.SortingStatement = sortingStatement; searchStatementModel.Parameters = param.ToArray<object>(); return searchStatementModel; }
private SearchStatementModel PrepareLocationDetailSearchStatement(GridCommand command, IpDetailSearchModel searchModel) { string whereStatement = string.Empty; IList<object> param = new List<object>(); HqlStatementHelper.AddEqStatement("Item", searchModel.Item, "h", ref whereStatement, param); HqlStatementHelper.AddEqStatement("IpNo", searchModel.IpNo, "h", ref whereStatement, param); string sortingStatement = HqlStatementHelper.GetSortingStatement(command.SortDescriptors); SearchStatementModel searchStatementModel = new SearchStatementModel(); searchStatementModel.SelectCountStatement = selectLocationCountStatement; searchStatementModel.SelectStatement = selectLocationStatement; searchStatementModel.WhereStatement = whereStatement; searchStatementModel.SortingStatement = sortingStatement; searchStatementModel.Parameters = param.ToArray<object>(); return searchStatementModel; }
public ActionResult DetailUnitPriceList(GridCommand command, IpDetailSearchModel searchModel) { SearchCacheModel searchCacheModel = this.ProcessSearchModel(command, searchModel); ViewBag.PageSize = base.ProcessPageSize(command.PageSize); if (string.IsNullOrEmpty(searchModel.IpNo)) { SaveWarningMessage(Resources.EXT.ControllerLan.Con_ShipOrderCanNotBeEmpty); return View(); } IList<IpMaster> ipMasterList = genericMgr.FindAll<IpMaster>(" from IpMaster i where i.IpNo=?", searchModel.IpNo); if (ipMasterList.Count < 1) { SaveWarningMessage(Resources.EXT.ControllerLan.Con_ShipOrderNotExits); return View(); } else { if (ipMasterList[0].Status == com.Sconit.CodeMaster.IpStatus.Cancel || ipMasterList[0].Status == com.Sconit.CodeMaster.IpStatus.Close) { SaveWarningMessage(Resources.EXT.ControllerLan.Con_TheShipOrderAlreadyCanNotModificate); return View(); } if (ipMasterList[0].OrderType != Sconit.CodeMaster.OrderType.Procurement && ipMasterList[0].OrderType != Sconit.CodeMaster.OrderType.SubContract) { SaveWarningMessage(Resources.EXT.ControllerLan.Con_IsNotPurchaseConsignmentShipOrderCanNotModifyPrice); return View(); } if (!Utility.SecurityHelper.HasPermission(ipMasterList[0])) { SaveWarningMessage(Resources.EXT.ControllerLan.Con_LackModificateTheShipOrderPermission); return View(); } } if (this.CheckSearchModelIsNull(searchCacheModel.SearchObject)) { TempData["_AjaxMessage"] = ""; } else { SaveWarningMessage(Resources.SYS.ErrorMessage.Errors_NoConditions); } ViewBag.Item = searchModel.Item; ViewBag.IpNo = searchModel.IpNo; return View(); }
public ActionResult _IpDetailList(GridCommand command, IpDetailSearchModel searchModel, string ipNo) { ViewBag.DetailHassConfirm2 = false; IpMaster ipMaster = base.genericMgr.FindById<IpMaster>(ipNo); if ((ipMaster.Status == com.Sconit.CodeMaster.IpStatus.Submit || ipMaster.Status == com.Sconit.CodeMaster.IpStatus.InProcess) // && ipMaster.IsReceiveScanHu == false && CurrentUser.Permissions.Where(p => p.PermissionCode == "Url_ProcurementIpMaster_UpdateLocTo").Count() > 0) { ViewBag.IsHassUpdate = true; } else { ViewBag.IsHassUpdate = false; } ViewBag.IsCancel = ((ipMaster.Status == com.Sconit.CodeMaster.IpStatus.Cancel || ipMaster.Status == com.Sconit.CodeMaster.IpStatus.Close) ? false : true) && ipMaster.OrderType == com.Sconit.CodeMaster.OrderType.ScheduleLine && !ipMaster.IsAsnUniqueReceive; searchModel.IpNo = ipNo; TempData["IpDetailSearchModel"] = searchModel; ViewBag.PageSize = base.ProcessPageSize(command.PageSize); return PartialView(); }
public ActionResult IpDetail(GridCommand command, IpDetailSearchModel searchModel, string ipNo) { IpMaster ipMaster = base.genericMgr.FindById<IpMaster>(ipNo); ViewBag.IsCancel = ((ipMaster.Status == com.Sconit.CodeMaster.IpStatus.Cancel || ipMaster.Status == com.Sconit.CodeMaster.IpStatus.Close) ? false : true) && ipMaster.OrderType == com.Sconit.CodeMaster.OrderType.ScheduleLine && !ipMaster.IsAsnUniqueReceive; searchModel.IpNo = ipNo; TempData["IpDetailSearchModel"] = searchModel; ViewBag.PageSize = base.ProcessPageSize(command.PageSize); return PartialView(); }
public ActionResult _AjaxIpDetailList(GridCommand command, IpDetailSearchModel searchModel, string ipNo) { //SearchStatementModel searchStatementModel = this.IpDetailPrepareSearchStatement(command, searchModel, ipNo); //return PartialView(GetAjaxPageData<IpDetail>(searchStatementModel, command)); SearchStatementModel searchStatementModel = this.IpDetailPrepareSearchStatement(command, searchModel, ipNo); GridModel<IpDetail> gridList = GetAjaxPageData<IpDetail>(searchStatementModel, command); int i = 0; foreach (IpDetail ipDetail in gridList.Data) { if (i > command.PageSize) { break; } if (!string.IsNullOrEmpty(ipDetail.LocationTo)) { ipDetail.SAPLocationTo = base.genericMgr.FindById<Location>(ipDetail.LocationTo).SAPLocation; } } gridList.Data = gridList.Data.Where(o => o.Type == com.Sconit.CodeMaster.IpDetailType.Normal); return PartialView(gridList); }
public ActionResult _AjaxIpDetailList(GridCommand command, IpDetailSearchModel searchModel) { if (string.IsNullOrEmpty(searchModel.IpNo)) { return PartialView(new GridModel(new List<IpDetail>())); } else { SearchStatementModel searchStatementModel = PrepareIpDetailSearchStatement(command, searchModel); GridModel<IpDetail> List = GetAjaxPageData<IpDetail>(searchStatementModel, command); foreach (IpDetail ipDetail in List.Data) { IpMaster item = base.genericMgr.FindById<IpMaster>(ipDetail.IpNo); ipDetail.ManufactureParty = item.PartyFrom; ipDetail.LotNo = LotNoHelper.GenerateLotNo(); ipDetail.HuQty = ipDetail.Qty; } return PartialView(List); } }
public ActionResult IpDetailList(GridCommand command, IpDetailSearchModel searchModel) { IpMaster Ipmaster = null; TempData["IpDetailSearchModel"] = searchModel; ViewBag.PageSize = base.ProcessPageSize(command.PageSize); if (string.IsNullOrEmpty(searchModel.IpNo)) { SaveWarningMessage("请根据送货单查询"); } else { TempData["_AjaxMessage"] = ""; try { Ipmaster = base.genericMgr.FindById<IpMaster>(searchModel.IpNo); } catch (System.Exception) { SaveWarningMessage("送货单号不存在,请重新输入!"); return PartialView(); } if (Ipmaster.IsShipScanHu) { return PartialView("IpLocationDetailList"); } } return PartialView(); }
public ActionResult _AjaxIpDetailList(GridCommand command, IpDetailSearchModel searchModel, string ipNo) { SearchStatementModel searchStatementModel = this.IpDetailPrepareSearchStatement(command, searchModel, ipNo); GridModel<IpDetail> gridList = GetAjaxPageData<IpDetail>(searchStatementModel, command); int i = 0; ViewBag.DetailHassConfirm1 = false; ViewBag.DetailHassConfirm = false; foreach (IpDetail ipDetail in gridList.Data) { if (ipDetail.IsIncludeTax) { ViewBag.DetailHassConfirm = true; } if (i > command.PageSize) { break; } ipDetail.SAPLocationTo = base.genericMgr.FindById<Location>(ipDetail.LocationTo).SAPLocation; } //gridList.Data = gridList.Data.Where(o => o.Type == com.Sconit.CodeMaster.IpDetailType.Normal); //gridList.Total = gridList.Data.Count(); return PartialView(gridList); }
public ActionResult _AjaxIpDetList(GridCommand command, IpDetailSearchModel searchModel, string ipNo) { SearchStatementModel searchStatementModel = this.IpDetailPrepareSearchStatement(command, searchModel, ipNo); GridModel<IpDetail> ipDetailData = GetAjaxPageData<IpDetail>(searchStatementModel, command); var list = ipDetailData.Data.Where(o => o.Type == Sconit.CodeMaster.IpDetailType.Normal); foreach (var IpDetail in list) { var IpDetailGapData = ipDetailData.Data.Where(o => o.GapIpDetailId == IpDetail.Id).FirstOrDefault() ?? new IpDetail(); IpDetail.GapQty = IpDetailGapData.Qty; } ipDetailData.Data = list; return PartialView(ipDetailData); }
public ActionResult _DetailUnitPriceAjaxList(GridCommand command, IpDetailSearchModel searchModel) { if (string.IsNullOrEmpty(searchModel.IpNo)) { return PartialView(new GridModel(new List<IpDetail>())); } IList<IpMaster> ipMasterList = genericMgr.FindAll<IpMaster>(" from IpMaster i where i.IpNo=?", searchModel.IpNo); if (ipMasterList.Count < 1) { return PartialView(new GridModel(new List<IpDetail>())); } else { if (ipMasterList[0].Status == com.Sconit.CodeMaster.IpStatus.Cancel || ipMasterList[0].Status == com.Sconit.CodeMaster.IpStatus.Close) { return PartialView(new GridModel(new List<IpDetail>())); } if (ipMasterList[0].OrderType != Sconit.CodeMaster.OrderType.Procurement && ipMasterList[0].OrderType != Sconit.CodeMaster.OrderType.SubContract) { return PartialView(new GridModel(new List<IpDetail>())); } if (!Utility.SecurityHelper.HasPermission(ipMasterList[0])) { return PartialView(new GridModel(new List<IpDetail>())); } } if (!this.CheckSearchModelIsNull(searchModel)) { return PartialView(new GridModel(new List<IpDetail>())); } string whereStatement = " where i.OrderType in (" + (int)com.Sconit.CodeMaster.OrderType.Procurement + "," + (int)com.Sconit.CodeMaster.OrderType.SubContract + ")"; SearchStatementModel searchStatementModel = this.PrepareSearchDetailUnitPriceStatement(command, searchModel, whereStatement); return PartialView(GetAjaxPageData<IpDetail>(searchStatementModel, command)); }
private SearchStatementModel IpDetailPrepareSearchStatement(GridCommand command, IpDetailSearchModel searchModel, string ipNo) { string whereStatement = " where i.IpNo='" + ipNo + "'"; IList<object> param = new List<object>(); string sortingStatement = HqlStatementHelper.GetSortingStatement(command.SortDescriptors); SearchStatementModel searchStatementModel = new SearchStatementModel(); searchStatementModel.SelectCountStatement = selectIpDetailCountStatement; searchStatementModel.SelectStatement = selectIpDetailStatement; searchStatementModel.WhereStatement = whereStatement; searchStatementModel.SortingStatement = sortingStatement; searchStatementModel.Parameters = param.ToArray<object>(); return searchStatementModel; }
public ActionResult IpDetailList(GridCommand command, IpDetailSearchModel searchModel) { TempData["IpDetailSearchModel"] = searchModel; ViewBag.PageSize = base.ProcessPageSize(command.PageSize); return PartialView(); }