public ActionResult List(GridCommand command, InspectResultSearchModel searchModel)
 {
     SearchCacheModel searchCacheModel = this.ProcessSearchModel(command, searchModel);
     if (!string.IsNullOrEmpty(((InspectResultSearchModel)(searchCacheModel.SearchObject)).IpNo))
     {
         TempData["_AjaxMessage"] = "";
     }
     else
     {
         SaveWarningMessage(Resources.EXT.ControllerLan.Con_NeedInputShipOrderToSearch);
     }
     ViewBag.PageSize = base.ProcessPageSize(command.PageSize);
     return View();
 }
 public ActionResult List(GridCommand command, InspectResultSearchModel searchModel)
 {
     SearchCacheModel searchCacheModel = this.ProcessSearchModel(command, searchModel);
     if (!string.IsNullOrEmpty(((InspectResultSearchModel)(searchCacheModel.SearchObject)).IpNo))
     {
         TempData["_AjaxMessage"] = "";
     }
     else
     {
         SaveWarningMessage("请根据送货单进行查询!");
     }
     ViewBag.PageSize = base.ProcessPageSize(command.PageSize);
     return View();
 }
Пример #3
0
        private SearchStatementModel NewPrepareSearchStatement(GridCommand command, InspectResultSearchModel searchModel)
        {
            string whereStatement = " where i.JudgeQty > i.HandleQty and i.JudgeResult= " + (int)com.Sconit.CodeMaster.JudgeResult.Rejected;
            if (searchModel.InspectType != null && searchModel.InspectType.Value == (int)com.Sconit.CodeMaster.InspectType.Barcode)
            {
                whereStatement += " and i.HuId is not null";
            }
            else
            {
                whereStatement += " and i.HuId is null";
            }
            return InspectResultPrepareSearchStatement(command, searchModel, whereStatement);
            //IList<object> param = new List<object>();

            //HqlStatementHelper.AddLikeStatement("InspectNo", searchModel.InspectNo, HqlStatementHelper.LikeMatchMode.Start, "i", ref whereStatement, param);
            //HqlStatementHelper.AddEqStatement("Item", searchModel.Item, "i", ref whereStatement, param);
            //HqlStatementHelper.AddLikeStatement("IpNo", searchModel.IpNo, HqlStatementHelper.LikeMatchMode.Start, "i", ref whereStatement, param);
            //HqlStatementHelper.AddLikeStatement("ReceiptNo", searchModel.ReceiptNo, HqlStatementHelper.LikeMatchMode.Start, "i", ref whereStatement, param);
            //HqlStatementHelper.AddLikeStatement("WMSNo", searchModel.WMSNo, HqlStatementHelper.LikeMatchMode.Start, "i", ref whereStatement, param);
            //HqlStatementHelper.AddEqStatement("CreateUserName", searchModel.CreateUserName,"i", ref whereStatement, param);
            //HqlStatementHelper.AddEqStatement("CurrentLocation", searchModel.CurrentLocation, "i", ref whereStatement, param);

            //if (searchModel.StartDate != null && searchModel.EndDate != null)
            //{
            //    HqlStatementHelper.AddBetweenStatement("CreateDate", searchModel.StartDate, searchModel.EndDate, "i", ref whereStatement, param);

            //}
            //else if (searchModel.StartDate != null && searchModel.EndDate == null)
            //{
            //    HqlStatementHelper.AddGeStatement("CreateDate", searchModel.StartDate, "i", ref whereStatement, param);
            //}
            //else if (searchModel.StartDate == null && searchModel.EndDate != null)
            //{
            //    HqlStatementHelper.AddLeStatement("CreateDate", searchModel.EndDate, "i", ref whereStatement, param);
            //}

            //if (command.SortDescriptors.Count > 0)
            //{
            //    if (command.SortDescriptors[0].Member == "DefectDescription")
            //    {
            //        command.SortDescriptors[0].Member = "Defect";
            //    }
            //}
            //string sortingStatement = HqlStatementHelper.GetSortingStatement(command.SortDescriptors);

            //SearchStatementModel searchStatementModel = new SearchStatementModel();
            //searchStatementModel.SelectCountStatement = inspectResultSelectCountStatement;
            //searchStatementModel.SelectStatement = inspectResultSelectStatement;
            //searchStatementModel.WhereStatement = whereStatement;
            //searchStatementModel.SortingStatement = sortingStatement;
            //searchStatementModel.Parameters = param.ToArray<object>();

            //return searchStatementModel;
        }
Пример #4
0
        private SearchStatementModel PopPrepareSearchStatement(GridCommand command, InspectResultSearchModel searchModel)
        {
            string whereStatement = string.Empty;
            IList<RejectDetail> listRejectDetail = new List<RejectDetail>();
            listRejectDetail = base.genericMgr.FindAll<RejectDetail>("select r from RejectDetail as r where r.RejectNo=?", searchModel.RejectNo);
            string strInspResultId = string.Empty;
            for (int i = 0; i < listRejectDetail.Count; i++)
            {
                strInspResultId += "'" + listRejectDetail[i].InspectResultId + "',";
            }
            whereStatement = " where i.JudgeResult=" + (int)com.Sconit.CodeMaster.JudgeResult.Rejected + " and JudgeQty > HandleQty";
            if (strInspResultId != string.Empty)
            {
                strInspResultId = strInspResultId.Substring(0, strInspResultId.Length - 1);
                whereStatement += " and Id not in (" + strInspResultId + ")";
            }
            else
            {
                whereStatement = " where i.JudgeQty > i.HandleQty and i.JudgeResult= " + (int)com.Sconit.CodeMaster.JudgeResult.Rejected;
            }

            if (searchModel.InspectType == (int)com.Sconit.CodeMaster.InspectType.Barcode)
            {
                whereStatement += " and i.HuId is not null";
            }
            else
            {
                whereStatement += " and i.HuId is null";
            }

            return InspectResultPrepareSearchStatement(command, searchModel, whereStatement);
        }
Пример #5
0
        private SearchStatementModel InspectResultPrepareSearchStatement(GridCommand command, InspectResultSearchModel searchModel, string whereStatement)
        {
            IList<object> param = new List<object>();

            HqlStatementHelper.AddLikeStatement("InspectNo", searchModel.InspectNo, HqlStatementHelper.LikeMatchMode.Start, "i", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("Item", searchModel.Item, "i", ref whereStatement, param);
            HqlStatementHelper.AddLikeStatement("IpNo", searchModel.IpNo, HqlStatementHelper.LikeMatchMode.Start, "i", ref whereStatement, param);
            HqlStatementHelper.AddLikeStatement("ReceiptNo", searchModel.ReceiptNo, HqlStatementHelper.LikeMatchMode.Start, "i", ref whereStatement, param);
            HqlStatementHelper.AddLikeStatement("WMSNo", searchModel.WMSNo, HqlStatementHelper.LikeMatchMode.Start, "i", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("CreateUserName", searchModel.CreateUserName, "i", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("CurrentLocation", searchModel.CurrentLocation, "i", ref whereStatement, param);

            if (searchModel.StartDate != null && searchModel.EndDate != null)
            {
                HqlStatementHelper.AddBetweenStatement("CreateDate", searchModel.StartDate, searchModel.EndDate, "i", ref whereStatement, param);

            }
            else if (searchModel.StartDate != null && searchModel.EndDate == null)
            {
                HqlStatementHelper.AddGeStatement("CreateDate", searchModel.StartDate, "i", ref whereStatement, param);
            }
            else if (searchModel.StartDate == null && searchModel.EndDate != null)
            {
                HqlStatementHelper.AddLeStatement("CreateDate", searchModel.EndDate, "i", ref whereStatement, param);
            }

            if (command.SortDescriptors.Count > 0)
            {
                if (command.SortDescriptors[0].Member == "DefectDescription")
                {
                    command.SortDescriptors[0].Member = "Defect";
                }
            }
            string sortingStatement = HqlStatementHelper.GetSortingStatement(command.SortDescriptors);

            SearchStatementModel searchStatementModel = new SearchStatementModel();
            searchStatementModel.SelectCountStatement = inspectResultSelectCountStatement;
            searchStatementModel.SelectStatement = inspectResultSelectStatement;
            searchStatementModel.WhereStatement = whereStatement;
            searchStatementModel.SortingStatement = sortingStatement;
            searchStatementModel.Parameters = param.ToArray<object>();

            return searchStatementModel;
        }
Пример #6
0
 public ActionResult _AjaxInspectResultList(GridCommand command, InspectResultSearchModel searchModel)
 {
     SearchStatementModel searchStatementModel = this.PopPrepareSearchStatement(command, searchModel);
     return PartialView(GetAjaxPageData<InspectResult>(searchStatementModel, command));
 }
Пример #7
0
        public ActionResult ChooseInspectResult(GridCommand command, InspectResultSearchModel searchModel)
        {
            TempData["InspectResultSearchModel"] = searchModel;
            ViewBag.Status = searchModel.Status;
            ViewBag.InspectType = searchModel.InspectType;
            ViewBag.RejectNo = searchModel.RejectNo;

            ViewBag.PageSize = base.ProcessPageSize(command.PageSize);

            return PartialView();
        }
Пример #8
0
 public ActionResult New(GridCommand command, InspectResultSearchModel searchModel)
 {
     this.ProcessSearchModel(command,searchModel);
     ViewBag.InspectType = searchModel.InspectType == null ? (int)com.Sconit.CodeMaster.InspectType.Quantity : searchModel.InspectType.Value;
     ViewBag.PageSize = base.ProcessPageSize(command.PageSize);
     return View();
 }
 public ActionResult _AjaxInspectResultNewList(GridCommand command, InspectResultSearchModel searchModel)
 {
     if (!searchModel.isFromList.HasValue || !searchModel.isFromList.Value)
     {
         return PartialView(new GridModel(new List<InspectResult>()));
     }
     var failCodeDic = this.genericMgr.FindAll<FailCode>().ToDictionary(d => d.Code, d => d);
     SearchStatementModel searchStatementModel = NewPrepareSearchStatement(command, searchModel);
     var data = GetAjaxPageData<InspectResult>(searchStatementModel, command);
     foreach (var inspectResult in data.Data)
     {
         inspectResult.FailCodeDescription = failCodeDic[inspectResult.FailCode].CodeDescription;
     }
     return PartialView(data);
 }
 public ActionResult New(GridCommand command, InspectResultSearchModel searchModel)
 {
     if ((!searchModel.HandleResult.HasValue || searchModel.HandleResult.Value == 0)
         && (searchModel.isFromList.HasValue && searchModel.isFromList.Value))
     {
         SaveErrorMessage(Resources.EXT.ControllerLan.Con_PleaseChooseProcessMathod);
         searchModel.isFromList = false;
     }
     this.ProcessSearchModel(command, searchModel);
     ViewBag.InspectType = searchModel.InspectType == null ? (int)com.Sconit.CodeMaster.InspectType.Quantity : searchModel.InspectType.Value;
     ViewBag.PageSize = base.ProcessPageSize(command.PageSize);
     return View();
 }
 private SearchStatementModel InspectResultPrepareSearchStatement(GridCommand command, InspectResultSearchModel searchModel)
 {
     string whereStatement = "where i.InspectNo = '" + searchModel.InspectNo + "'";
     IList<object> param = new List<object>();
     HqlStatementHelper.AddLikeStatement("Item", searchModel.Item, HqlStatementHelper.LikeMatchMode.Start, "i", ref whereStatement, param);
     if (command.SortDescriptors.Count > 0)
     {
         if (command.SortDescriptors[0].Member == "JudgeResultDescription")
         {
             command.SortDescriptors[0].Member = "JudgeResult";
         }
         else if (command.SortDescriptors[0].Member == "DefectDescription")
         {
             command.SortDescriptors[0].Member = "Defect";
         }
     }
     string sortingStatement = HqlStatementHelper.GetSortingStatement(command.SortDescriptors);
     SearchStatementModel searchStatementModel = new SearchStatementModel();
     searchStatementModel.SelectCountStatement = InspectResultSelectCountStatement;
     searchStatementModel.SelectStatement = InspectResultSelectStatement;
     searchStatementModel.WhereStatement = whereStatement;
     searchStatementModel.SortingStatement = sortingStatement;
     searchStatementModel.Parameters = param.ToArray<object>();
     return searchStatementModel;
 }
        public ActionResult _AjaxInspectionResultList(GridCommand command, InspectResultSearchModel searchModel)
        {
            SearchStatementModel searchStatementModel = this.InspectResultPrepareSearchStatement(command, searchModel);
            GridModel<InspectResult> list = GetAjaxPageData<InspectResult>(searchStatementModel, command);
            IList<FailCode> failCodeList = genericMgr.FindAll<FailCode>();

            foreach (InspectResult inspectResult in list.Data)
            {
                foreach (FailCode failCode in failCodeList)
                {
                    if (inspectResult.FailCode == failCode.Code)
                    {
                        inspectResult.FailCodeDescription = failCode.CodeDescription;
                        inspectResult.CurrentFailCode = inspectResult.FailCode;
                        inspectResult.CurrentIsHandle = inspectResult.IsHandle;
                    }
                }
                if (!string.IsNullOrWhiteSpace(inspectResult.HuId))
                {
                    Hu huData = genericMgr.FindById<Hu>(inspectResult.HuId);
                    inspectResult.ExpireDate = huData.ExpireDate;
                    inspectResult.SupplierLotNo = huData.SupplierLotNo;
                }
            }
            return PartialView(list);
        }
 public ActionResult InspectionResult(GridCommand command, InspectResultSearchModel searchModel)
 {
     ViewBag.Item = searchModel.Item;
     TempData["InspectResultSearchModel"] = searchModel;
     ViewBag.PageSize = base.ProcessPageSize(command.PageSize);
     return PartialView();
 }