当前位置: 首页>>代码示例>>C#>>正文


C# Models.SearchStatementModel类代码示例

本文整理汇总了C#中com.Sconit.Web.Models.SearchStatementModel的典型用法代码示例。如果您正苦于以下问题:C# SearchStatementModel类的具体用法?C# SearchStatementModel怎么用?C# SearchStatementModel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SearchStatementModel类属于com.Sconit.Web.Models命名空间,在下文中一共展示了SearchStatementModel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: PrepareSearchStatement

        private SearchStatementModel PrepareSearchStatement(GridCommand command, SMSRecSearchModel searchModel)
        {
            string whereStatement = string.Empty;

            IList<object> param = new List<object>();

            HqlStatementHelper.AddLikeStatement("Issue", searchModel.Issue, HqlStatementHelper.LikeMatchMode.Start, "sms", ref whereStatement, param);
            HqlStatementHelper.AddLikeStatement("MsgID", searchModel.MsgID, HqlStatementHelper.LikeMatchMode.Start, "sms", ref whereStatement, param);
            HqlStatementHelper.AddLikeStatement("Content", searchModel.Content, HqlStatementHelper.LikeMatchMode.Start, "sms", ref whereStatement, param);
            HqlStatementHelper.AddLikeStatement("SrcID", searchModel.SrcID, HqlStatementHelper.LikeMatchMode.Start, "sms", ref whereStatement, param);
            if (searchModel.DateFrom != null & searchModel.DateTo != null)
            {
                HqlStatementHelper.AddBetweenStatement("CreateDate", searchModel.DateFrom, searchModel.DateTo, "sms", ref whereStatement, param);
            }
            else if (searchModel.DateFrom != null & searchModel.DateTo == null)
            {
                HqlStatementHelper.AddGeStatement("CreateDate", searchModel.DateFrom, "sms", ref whereStatement, param);
            }
            else if (searchModel.DateFrom == null & searchModel.DateTo != null)
            {
                HqlStatementHelper.AddLeStatement("CreateDate", searchModel.DateTo, "sms", ref whereStatement, param);
            }
            HqlStatementHelper.AddEqStatement("EventHandler", SMSStatus.SMSEventHeadler_MESSAGERECEIVEDINTERFACE, "sms", ref whereStatement, param);

            string sortingStatement = HqlStatementHelper.GetSortingStatement(command.SortDescriptors);

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

            return searchStatementModel;
        }
开发者ID:Novthirteen,项目名称:sih-les,代码行数:35,代码来源:SMSRecController.cs

示例2: PrepareSearchStatement

        private SearchStatementModel PrepareSearchStatement(GridCommand command, SearchModel searchModel)
        {
            string whereStatement = "";

            IList<object> param = new List<object>();
            HqlStatementHelper.AddEqStatement("OrderNo", searchModel.OrderNo, "t", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("ReceiptNo", searchModel.ReceiptNo, "t", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("Status", searchModel.Status, "t", ref whereStatement, param);

            if (searchModel.StartDate != null & searchModel.EndDate != null)
            {
                HqlStatementHelper.AddBetweenStatement("CreateDate", searchModel.StartDate, searchModel.EndDate, "t", ref whereStatement, param);
            }
            else if (searchModel.StartDate != null & searchModel.EndDate == null)
            {
                HqlStatementHelper.AddGeStatement("CreateDate", searchModel.StartDate, "t", ref whereStatement, param);
            }
            else if (searchModel.StartDate == null & searchModel.EndDate != null)
            {
                HqlStatementHelper.AddLeStatement("CreateDate", searchModel.EndDate, "t", ref whereStatement, param);
            }
            string sortingStatement = HqlStatementHelper.GetSortingStatement(command.SortDescriptors);
            if (command.SortDescriptors.Count == 0)
            {
                sortingStatement = " order by t.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;
        }
开发者ID:Novthirteen,项目名称:sih-les,代码行数:35,代码来源:PostDOController.cs

示例3: PrepareSearchStatement

        private SearchStatementModel PrepareSearchStatement(GridCommand command, PickTaskSearchModel searchModel)
        {
            string whereStatement = string.Empty;
            
            IList<object> param = new List<object>();
            HqlStatementHelper.AddEqStatement("PickId", searchModel.PickId, "c", ref whereStatement, param);

            string sortingStatement = HqlStatementHelper.GetSortingStatement(command.SortDescriptors);

            SearchStatementModel searchStatementModel = new SearchStatementModel();
            searchStatementModel.SelectCountStatement = "select count(*) from PickResult  c";
            searchStatementModel.SelectStatement = "select c from PickResult as c";
            searchStatementModel.WhereStatement = whereStatement;
            searchStatementModel.SortingStatement = sortingStatement;
            searchStatementModel.Parameters = param.ToArray<object>();

            return searchStatementModel;
        }
开发者ID:Novthirteen,项目名称:sih-les,代码行数:18,代码来源:PickResultController.cs

示例4: PrepareSearchStatement

        private SearchStatementModel PrepareSearchStatement(GridCommand command, GenVanProdOrderSearchModel searchModel)
        {
            string whereStatement = string.Empty;

            IList<object> param = new List<object>();

            HqlStatementHelper.AddLikeStatement("ZLINE", searchModel.SearchZLINE, HqlStatementHelper.LikeMatchMode.Start, "u", ref whereStatement, param);

            string sortingStatement = HqlStatementHelper.GetSortingStatement(command.SortDescriptors);

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

            return searchStatementModel;
        }
开发者ID:Novthirteen,项目名称:sih-les,代码行数:19,代码来源:GenVanProdOrderController.cs

示例5: PrepareSearchStatement

        private SearchStatementModel PrepareSearchStatement(GridCommand command, OrderMasterSearchModel searchModel )
        {
            string whereStatement = string.Empty;

            IList<object> param = new List<object>();
            if (!string.IsNullOrWhiteSpace(searchModel.TraceCode))
            {
                searchModel.TraceCode = searchModel.TraceCode.PadLeft(10, '0').Substring(2);
            }
            HqlStatementHelper.AddLikeStatement("VanCode", searchModel.TraceCode,HqlStatementHelper.LikeMatchMode.End, "p", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("OrderNo", searchModel.OrderNo, "p", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("ProdLine", searchModel.ProdLine, "p", ref whereStatement, param);

            string sortingStatement = HqlStatementHelper.GetSortingStatement(command.SortDescriptors);

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

            return searchStatementModel;
        }
开发者ID:Novthirteen,项目名称:sih-les,代码行数:24,代码来源:ProdOrderPauseResumeController.cs

示例6: PrepareSearchStatement

        private SearchStatementModel PrepareSearchStatement(GridCommand command, FlowSearchModel searchModel)
        {
            string whereStatement = " where f.Type=2 ";

            IList<object> param = new List<object>();

            HqlStatementHelper.AddLikeStatement("Code", searchModel.Code, HqlStatementHelper.LikeMatchMode.Anywhere, "f", ref whereStatement, param);
            HqlStatementHelper.AddLikeStatement("Description", searchModel.Description, HqlStatementHelper.LikeMatchMode.Anywhere, "f", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("LocationTo", searchModel.LocationTo,  "f", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("LocationFrom", searchModel.LocationFrom,  "f", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("PartyFrom", searchModel.PartyFrom, "f", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("PartyTo", searchModel.PartyTo, "f", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("IsActive", searchModel.IsActive, "f", ref whereStatement, param);

            string sortingStatement = HqlStatementHelper.GetSortingStatement(command.SortDescriptors);

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

            return searchStatementModel;
        }
开发者ID:druidwang,项目名称:Les_parts,代码行数:25,代码来源:TransferFlowController.cs

示例7: PrepareDetailSearchStatement

        private SearchStatementModel PrepareDetailSearchStatement(GridCommand command, FlowDetailSearchModel searchModel, string flowCode)
        {
            string whereStatement = " where f.Flow='" + flowCode + "'";
            IList<object> param = new List<object>();
            HqlStatementHelper.AddLikeStatement("Item", searchModel.Item, HqlStatementHelper.LikeMatchMode.Start, "f", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("Flow", searchModel.Flow, "f", ref whereStatement, param);
            string sortingStatement = HqlStatementHelper.GetSortingStatement(command.SortDescriptors);
            if (command.SortDescriptors.Count == 0)
            {
                sortingStatement = " order by f.Sequence asc";
            }
            SearchStatementModel searchStatementModel = new SearchStatementModel();
            searchStatementModel.SelectCountStatement = selectCountDetailStatement;
            searchStatementModel.SelectStatement = selectDetailStatement;
            searchStatementModel.WhereStatement = whereStatement;
            searchStatementModel.SortingStatement = sortingStatement;
            searchStatementModel.Parameters = param.ToArray<object>();

            return searchStatementModel;
        }
开发者ID:druidwang,项目名称:Les_parts,代码行数:20,代码来源:TransferFlowController.cs

示例8: PrepareSearchShipAddressStatement

 private SearchStatementModel PrepareSearchShipAddressStatement(GridCommand command, PartyAddressSearchModel searchModel, string partyCode)
 {
     string whereStatement = "  where pa.Party='" + partyCode + "' and  pa.Type='0' ";
     IList<object> param = new List<object>();
     //HqlStatementHelper.AddLikeStatement("Party", searchModel.Party, HqlStatementHelper.LikeMatchMode.Start, "pa", ref whereStatement, param);
     HqlStatementHelper.AddLikeStatement("Address.Code", searchModel.AddressCode, HqlStatementHelper.LikeMatchMode.Start, "pa", ref whereStatement, param);
     HqlStatementHelper.AddLikeStatement("Address.AddressContent", searchModel.AddressContent, HqlStatementHelper.LikeMatchMode.Start, "pa", ref whereStatement, param);
     string sortingStatement = HqlStatementHelper.GetSortingStatement(command.SortDescriptors);
     SearchStatementModel searchStatementModel = new SearchStatementModel();
     searchStatementModel.SelectCountStatement = selectShipAddressCountStatement;
     searchStatementModel.SelectStatement = selectShipAddressStatement;
     searchStatementModel.WhereStatement = whereStatement;
     searchStatementModel.SortingStatement = sortingStatement;
     searchStatementModel.Parameters = param.ToArray<object>();
     return searchStatementModel;
 }
开发者ID:zhsh1241,项目名称:Sconit5_Shenya,代码行数:16,代码来源:RegionController.cs

示例9: PrepareSearchStatement

        private SearchStatementModel PrepareSearchStatement(GridCommand command, UserSearchModel searchModel)
        {
            string whereStatement = string.Empty;

            IList<object> param = new List<object>();

            HqlStatementHelper.AddLikeStatement("Code", searchModel.Code, HqlStatementHelper.LikeMatchMode.Anywhere, "u", ref whereStatement, param);
            HqlStatementHelper.AddLikeStatement("FirstName", searchModel.FirstName, HqlStatementHelper.LikeMatchMode.Anywhere, "u", ref whereStatement, param);
            HqlStatementHelper.AddLikeStatement("LastName", searchModel.LastName, HqlStatementHelper.LikeMatchMode.Anywhere, "u", ref whereStatement, param);
            HqlStatementHelper.AddLikeStatement("Position", searchModel.Position, HqlStatementHelper.LikeMatchMode.Anywhere, "u", ref whereStatement, param);
            HqlStatementHelper.AddLikeStatement("Depart", searchModel.Depart, HqlStatementHelper.LikeMatchMode.Anywhere, "u", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("IsActive", searchModel.IsActive, "u", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("Type", searchModel.Type, "u", ref whereStatement, param);

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

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

            return searchStatementModel;
        }
开发者ID:druidwang,项目名称:Les_parts,代码行数:32,代码来源:UserController.cs

示例10: _AjaxScheduleLineItem

        public ActionResult _AjaxScheduleLineItem(GridCommand command)
        {
           com.Sconit.Entity.ACC.User user = SecurityContextHolder.Get();
            string whereStatement = "where exists ("+
             " select 1 from UserPermissionView as p where p.UserId =" + user.Id + " and p.PermissionCode=s.Supplier)";
                
            IList<object> param = new List<object>();
            string sortingStatement = HqlStatementHelper.GetSortingStatement(command.SortDescriptors);
            SearchStatementModel searchStatementModel = new SearchStatementModel();
            searchStatementModel.SelectCountStatement = "select count(*) from ScheduleLineItem as s ";
            searchStatementModel.SelectStatement = "select s from ScheduleLineItem as s";
            searchStatementModel.WhereStatement = whereStatement;
            searchStatementModel.SortingStatement = sortingStatement;
            searchStatementModel.Parameters = param.ToArray<object>();
            GridModel<ScheduleLineItem> grid = GetAjaxPageData<ScheduleLineItem>(searchStatementModel, command);
            if (grid.Data != null && grid.Data.Count() > 0)
            {
                var items = grid.Data.Select(o => o.Item).ToArray();
                IList<Item> itemList = new List<Item>();

                string hql = string.Empty;
                IList<object> parm = new List<object>();

                foreach (string itemCode in items.Distinct())
                {
                    if (hql == string.Empty)
                    {
                        hql = "from Item where Code in (?";
                    }
                    else
                    {
                        hql += ", ?";
                    }
                    parm.Add(itemCode);
                }
                 itemList = this.genericMgr.FindAll<Item>(hql+")",parm.ToArray());
                 if (itemList != null && itemList.Count > 0)
                 {
                     foreach (ScheduleLineItem scheduleLineItem in grid.Data)
                     {
                         foreach (var item in itemList)
                         {
                             if (scheduleLineItem.Item==item.Code)
                             {
                                 scheduleLineItem.Description = item.Description;
                                 scheduleLineItem.Uom = item.Uom;
                                 scheduleLineItem.ReferenceCode = item.ReferenceCode;
                                 scheduleLineItem.UnitCount = item.UnitCount;
                             
                             }
                         }
                     }
                 }
            }
            return PartialView(grid);
        }
开发者ID:zhsh1241,项目名称:Sconit5_Shenya,代码行数:56,代码来源:SupplierSchedulingController.cs

示例11: PrepareSearchStatement

        private SearchStatementModel PrepareSearchStatement(GridCommand command, BillMasterSearchModel searchModel)
        {
            string whereStatement = string.Empty;
            IList<object> param = new List<object>();

            SecurityHelper.AddBillPermissionStatement(ref whereStatement, "b", "Party", com.Sconit.CodeMaster.BillType.Distribution);

            HqlStatementHelper.AddLikeStatement("ExternalBillNo", searchModel.ExternalBillNo, HqlStatementHelper.LikeMatchMode.Start, "b", ref whereStatement, param);
            HqlStatementHelper.AddLikeStatement("BillNo", searchModel.BillNo, HqlStatementHelper.LikeMatchMode.Start, "b", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("Party", searchModel.Party, "b", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("Status", searchModel.Status, "b", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("Type", (int)Sconit.CodeMaster.BillType.Distribution, "b", ref whereStatement, param);

            if (searchModel.StartTime != null & searchModel.EndTime != null)
            {
                HqlStatementHelper.AddBetweenStatement("CreateDate", searchModel.StartTime, searchModel.EndTime, "b", ref whereStatement, param);
            }
            else if (searchModel.StartTime != null & searchModel.EndTime == null)
            {
                HqlStatementHelper.AddGeStatement("CreateDate", searchModel.StartTime, "b", ref whereStatement, param);
            }
            else if (searchModel.StartTime == null & searchModel.EndTime != null)
            {
                HqlStatementHelper.AddLeStatement("CreateDate", searchModel.EndTime, "b", ref whereStatement, param);
            }
            string sortingStatement = HqlStatementHelper.GetSortingStatement(command.SortDescriptors);
            if (command.SortDescriptors.Count == 0)
            {
                sortingStatement = " order by b.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;
        }
开发者ID:zhsh1241,项目名称:Sconit5_Shenya,代码行数:39,代码来源:DistributionBillController.cs

示例12: PreparePickListSearchStatement

        private SearchStatementModel PreparePickListSearchStatement(GridCommand command, OrderMasterSearchModel searchModel)
        {
            string whereStatement = string.Empty;
            if (searchModel.Type.HasValue && searchModel.Type > 0)
            {
                whereStatement = " where o.Type =" + searchModel.Type
                    + " and o.IsShipScanHu = 1 and o.Status in (" + (int)com.Sconit.CodeMaster.OrderStatus.InProcess + "," + (int)com.Sconit.CodeMaster.OrderStatus.Submit + ")"
                    + " and exists (select 1 from OrderDetail as d where d.PickedQty < d.OrderedQty and d.OrderNo = o.OrderNo) ";
            }
            else
            {
                whereStatement = " where o.Type in (" + (int)com.Sconit.CodeMaster.OrderType.Distribution + ","
                   + (int)com.Sconit.CodeMaster.OrderType.Transfer + ","
                   + (int)com.Sconit.CodeMaster.OrderType.SubContractTransfer + ")"
                   + " and o.IsShipScanHu = 1 and o.Status in (" + (int)com.Sconit.CodeMaster.OrderStatus.InProcess + "," + (int)com.Sconit.CodeMaster.OrderStatus.Submit + ")"
                   + " and exists (select 1 from OrderDetail as d where d.PickedQty < d.OrderedQty and d.OrderNo = o.OrderNo) ";
            }
            IList<object> param = new List<object>();
            if (!string.IsNullOrEmpty(searchModel.OrderNo))
            {
                HqlStatementHelper.AddLikeStatement("OrderNo", searchModel.OrderNo, HqlStatementHelper.LikeMatchMode.Start, "o", ref whereStatement, param);
            }
            if (!string.IsNullOrEmpty(searchModel.Flow))
            {
                HqlStatementHelper.AddEqStatement("Flow", searchModel.Flow, "o", ref whereStatement, param);
            }
            if (!string.IsNullOrEmpty(searchModel.PartyFrom))
            {
                HqlStatementHelper.AddEqStatement("PartyFrom", searchModel.PartyFrom, "o", ref whereStatement, param);
            }
            if (!string.IsNullOrEmpty(searchModel.PartyTo))
            {
                HqlStatementHelper.AddEqStatement("PartyTo", searchModel.PartyTo, "o", ref whereStatement, param);
            }

            string sortingStatement = HqlStatementHelper.GetSortingStatement(command.SortDescriptors);
            if (command.SortDescriptors.Count == 0)
            {
                sortingStatement = " order by o.CreateDate desc";
            }
            SearchStatementModel searchStatementModel = new SearchStatementModel();
            searchStatementModel.SelectCountStatement = selectOrderCountStatement;
            searchStatementModel.SelectStatement = selectOrderStatement;
            searchStatementModel.WhereStatement = whereStatement;
            searchStatementModel.SortingStatement = sortingStatement;
            searchStatementModel.Parameters = param.ToArray<object>();
            return searchStatementModel;
        }
开发者ID:zhsh1241,项目名称:Sconit5_Shenya,代码行数:48,代码来源:PickListController.cs

示例13: PrepareSearchStatement

        private SearchStatementModel PrepareSearchStatement(GridCommand command, LocationDetailPrefSearchModel searchModel)
        {
            string whereStatement = string.Empty;
            IList<object> param = new List<object>();

            HqlStatementHelper.AddEqStatement("Item", searchModel.ItemCode, "f", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("Location", searchModel.LocationCode, "f", ref whereStatement, param);
           
            string sortingStatement = HqlStatementHelper.GetSortingStatement(command.SortDescriptors);

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

            return searchStatementModel;
        }
开发者ID:Novthirteen,项目名称:sih-les,代码行数:19,代码来源:LocationDetailPrefController.cs

示例14: PrepareSearchStatement

        private SearchStatementModel PrepareSearchStatement(GridCommand command, PickListSearchModel searchModel)
        {
            string whereStatement = string.Empty;

            IList<object> param = new List<object>();

            SecurityHelper.AddPartyFromAndPartyToPermissionStatement(ref whereStatement, "pl", "OrderType", "pl", "PartyFrom", "pl", "PartyTo", com.Sconit.CodeMaster.OrderType.Distribution, false);
            // It should be logic "and" between  checking pemission hql commands  and other search condition(PickListNo,Status...etc)
            //whereStatement = whereStatement.Insert(6, " (") + ")";
            HqlStatementHelper.AddLikeStatement("PickListNo", searchModel.PickListNo, HqlStatementHelper.LikeMatchMode.End, "pl", ref whereStatement, param);
            HqlStatementHelper.AddLikeStatement("IpNo", searchModel.IpNo, HqlStatementHelper.LikeMatchMode.End, "pl", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("Status", searchModel.Status, "pl", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("Flow", searchModel.Flow, "pl", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("PartyFrom", searchModel.PartyFrom, "pl", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("PartyTo", searchModel.PartyTo, "pl", ref whereStatement, param);

            if (searchModel.StartTime != null & searchModel.EndTime != null)
            {
                HqlStatementHelper.AddBetweenStatement("CreateDate", searchModel.StartTime, searchModel.EndTime, "pl", ref whereStatement, param);
            }
            else if (searchModel.StartTime != null & searchModel.EndTime == null)
            {
                HqlStatementHelper.AddGeStatement("CreateDate", searchModel.StartTime, "pl", ref whereStatement, param);
            }
            else if (searchModel.StartTime == null & searchModel.EndTime != null)
            {
                HqlStatementHelper.AddLeStatement("CreateDate", searchModel.EndTime, "pl", ref whereStatement, param);
            }

            if (command.SortDescriptors.Count > 0)
            {
                if (command.SortDescriptors[0].Member == "OrderTypeDescription")
                {
                    command.SortDescriptors[0].Member = "OrderType";
                }
                else if (command.SortDescriptors[0].Member == "OrderStatusDescription")
                {
                    command.SortDescriptors[0].Member = "Status";
                }
            }
            string sortingStatement = HqlStatementHelper.GetSortingStatement(command.SortDescriptors);
            if (command.SortDescriptors.Count == 0)
            {
                sortingStatement = " order by pl.CreateDate desc";
            }
            SearchStatementModel searchStatementModel = new SearchStatementModel();
            searchStatementModel.SelectCountStatement = "select count(*) from PickListMaster as pl";
            searchStatementModel.SelectStatement = "select pl from PickListMaster as pl";
            searchStatementModel.WhereStatement = whereStatement;
            searchStatementModel.SortingStatement = sortingStatement;
            searchStatementModel.Parameters = param.ToArray<object>();

            return searchStatementModel;
        }
开发者ID:zhsh1241,项目名称:Sconit5_Shenya,代码行数:54,代码来源:PickListController.cs

示例15: PrepareShipSearchStatement

        private SearchStatementModel PrepareShipSearchStatement(GridCommand command, PickListSearchModel searchModel)
        {
            string whereStatement = " where p.Status =" + (int)com.Sconit.CodeMaster.PickListStatus.InProcess;

            IList<object> param = new List<object>();

            HqlStatementHelper.AddLikeStatement("PickListNo", searchModel.PickListNo, HqlStatementHelper.LikeMatchMode.Start, "p", ref whereStatement, param);
            HqlStatementHelper.AddEqStatement("Flow", searchModel.Flow, "p", ref whereStatement, param);

            if (searchModel.StartTime != null & searchModel.EndTime != null)
            {
                HqlStatementHelper.AddBetweenStatement("CreateDate", searchModel.StartTime, searchModel.EndTime, "p", ref whereStatement, param);
            }
            else if (searchModel.StartTime != null & searchModel.EndTime == null)
            {
                HqlStatementHelper.AddGeStatement("CreateDate", searchModel.StartTime, "p", ref whereStatement, param);
            }
            else if (searchModel.StartTime == null & searchModel.EndTime != null)
            {
                HqlStatementHelper.AddLeStatement("CreateDate", searchModel.EndTime, "p", ref whereStatement, param);
            }

            if (command.SortDescriptors.Count > 0)
            {
                if (command.SortDescriptors[0].Member == "OrderTypeDescription")
                {
                    command.SortDescriptors[0].Member = "OrderType";
                }
                else if (command.SortDescriptors[0].Member == "OrderStatusDescription")
                {
                    command.SortDescriptors[0].Member = "Status";
                }
            }
            string sortingStatement = HqlStatementHelper.GetSortingStatement(command.SortDescriptors);
            if (command.SortDescriptors.Count == 0)
            {
                sortingStatement = " order by p.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;
        }
开发者ID:zhsh1241,项目名称:Sconit5_Shenya,代码行数:47,代码来源:PickListController.cs


注:本文中的com.Sconit.Web.Models.SearchStatementModel类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。