/// <summary>
        /// 查询
        /// </summary>
        private void DoSelect()
        {
            string where = string.Empty;
            foreach (CommonSearchCriterionItem item in SearchCriterion.Searches.Searches)
            {
                if (!String.IsNullOrEmpty(item.Value.ToString()))
                {
                    switch (item.PropertyName)
                    {
                    case "CreateTime":

                        where += " year(CreateTime)=" + item.Value + " ";
                        break;
                    }
                }
            }
            SearchCriterion.RemoveSearch("CreateTime");
            SearchCriterion.SetOrder(TravelMoneyConfig.Prop_Corp);             //公司
            SearchCriterion.SetOrder(TravelMoneyConfig.Prop_Indutydate, true); //日期

            CommPowerSplit PS     = new CommPowerSplit();
            SysUser        UsrEnt = SysUser.Find(UserInfo.UserID);

            if (PS.TraveMoneyConfig(UserInfo.UserID, UserInfo.LoginName)) //总部HR权限  HR1
            {
                if (!string.IsNullOrEmpty(where))
                {
                    ents = TravelMoneyConfig.FindAll(SearchCriterion, Expression.Sql(where));
                    this.PageState.Add("TravelMoneyConfigList", ents);
                }
                else
                {
                    ents = TravelMoneyConfig.FindAll(SearchCriterion);
                    this.PageState.Add("TravelMoneyConfigList", ents);
                }
            }
            else
            {
                //公司权限
                UserContextInfo UC = new UserContextInfo();
                SearchCriterion.SetSearch(TravelMoneyConfig.Prop_Corp, UC.GetUserCurrentCorpId(UserInfo.UserID));

                if (!string.IsNullOrEmpty(where))
                {
                    ents = TravelMoneyConfig.FindAll(SearchCriterion, Expression.Sql(where));
                    this.PageState.Add("TravelMoneyConfigList", ents);
                }
                else
                {
                    ents = TravelMoneyConfig.FindAll(SearchCriterion);
                    this.PageState.Add("TravelMoneyConfigList", ents);
                }
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 查询
        /// </summary>
        private void DoSelect()
        {
            string CorpId = string.Empty;

            string where = string.Empty;
            var UsrEnt = SysUser.Find(UserInfo.UserID);

            CommPowerSplit ps = new CommPowerSplit();

            if (ps.IsNoticeRole(UserInfo.UserID, UserInfo.LoginName))
            {
                where += " (WorkFlowState='1' or WorkFlowState='2' or WorkFlowState='-1') ";
                if (!string.IsNullOrEmpty(SearchCriterion.GetSearchValue("Year") + ""))
                {
                    where += "  and  year(ApplyTime)= " + SearchCriterion.GetSearchValue("Year") + " ";
                }
                SearchCriterion.RemoveSearch("Year");
                ents = UsrTravelWelfare.FindAll(SearchCriterion, Expression.Sql(where));
                this.PageState.Add("UsrTravelWelfareList", ents);
            }
            else
            {
                // 判断公司登陆
                UserContextInfo UC = new UserContextInfo();
                CorpId = UC.GetUserCurrentCorpId(UserInfo.UserID);

                //SearchCriterion.AddSearch("CompanyId", CorpId);
                where += " (WorkFlowState='1' or WorkFlowState='2' or WorkFlowState='-1') " + AppealUsrAuth();
                if (!string.IsNullOrEmpty(SearchCriterion.GetSearchValue("Year") + ""))
                {
                    where += "  and  year(ApplyTime)= " + SearchCriterion.GetSearchValue("Year") + " ";
                }
                SearchCriterion.RemoveSearch("Year");
                SearchCriterion.SetOrder("CompanyId", true);
                ents = UsrTravelWelfare.FindAll(SearchCriterion, Expression.Sql(where));
                this.PageState.Add("UsrTravelWelfareList", ents);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 查询
        /// </summary>
        private void DoSelect()
        {
            if (SearchCriterion.Orders.Count == 0)
            {
                if (!SearchCriterion.Orders.Exists(en => en.PropertyName == "CreateTime"))
                {
                    SearchCriterion.Orders.Add(new OrderCriterionItem("CreateTime", false));
                }
            }

            string type = "all";

            foreach (CommonSearchCriterionItem sear in SearchCriterion.Searches.Searches)
            {
                if (sear.PropertyName == "Name" && sear.Value + "" != "")
                {
                    type = "Logistic";
                }
                else if ((sear.PropertyName == "CName" && sear.Value + "" != "") || (sear.PropertyName == "Number" && sear.Value + "" != ""))
                {
                    type = "Order";
                }
            }

            string did = RequestData.Get <string>("did");

            if (type == "all" || type == "Logistic" || !string.IsNullOrEmpty(did))
            {
                //if (!string.IsNullOrEmpty(did))
                //{
                //    SearchCriterion.Searches.Clear();
                //}
                ents = Logistic.FindAll(SearchCriterion, Expression.Sql(" charindex('" + did + "',DeliveryId)>0 "));

                //if (ents.Count == 0 && !string.IsNullOrEmpty(did))
                //{
                //    DeliveryOrder doent = DeliveryOrder.TryFind(did);
                //    if (doent != null)
                //    {
                //        ents = Logistic.FindAll(SearchCriterion, Expression.Eq("CustomerId", doent.CId));
                //    }
                //}

                this.PageState.Add("LogisticList", ents);
            }

            if (type == "all" || type == "Order")
            {
                string     wtype = RequestData.Get <string>("wtype");
                ICriterion crit  = null;
                if (wtype == "1")
                {
                    SearchCriterion.AddSearch("LogisticState", "已填写");
                }
                else
                {
                    crit = Expression.Or(Expression.Sql(" LogisticState <> '已填写' "), Expression.IsNull("LogisticState"));
                }
                SearchCriterion.AddSearch("State", "已出库");
                DeliveryOrder[] ents2 = DeliveryOrder.FindAll(SearchCriterion, crit);
                this.PageState.Add("OrderList", ents2);

                SearchCriterion.RemoveSearch("State");
            }
        }