예제 #1
0
        public List <Info_OrderMain> QuerySelfOrderRecord(string employCode, object beginTime, object endTime, string odrNo)
        {
            Miles.Coro.ORM.Find.IWherePart wherePart = this.Repository.Find().From <Model.Tb_order_main>()
                                                       .Select().End().Where()
                                                       .And(Model.Tb_order_main.Table.Oper_Code, employCode)
                                                       .And(Model.Tb_order_main.Table.Odr_State, Miles.Coro.ORM.DbCompareChar.NotEqual, (int)Enum.OrderState.New);
            //.StartGroup()
            //.Or(Model.Tb_order_main.Table.Odr_State, Miles.Coro.ORM.DbCompareChar.Equal, (int)Enum.OrderState.Pass)
            //.Or(Model.Tb_order_main.Table.Odr_State, Miles.Coro.ORM.DbCompareChar.Equal, (int)Enum.OrderState.Termination)
            //.StartGroup();

            if (beginTime != null)
            {
                wherePart.And(Model.Tb_order_main.Table.Odr_Date, Miles.Coro.ORM.DbCompareChar.More, (DateTime)beginTime);
            }

            if (endTime != null)
            {
                wherePart.And(Model.Tb_order_main.Table.Odr_Date, Miles.Coro.ORM.DbCompareChar.Less, (DateTime)endTime);
            }

            if (!string.IsNullOrEmpty(odrNo))
            {
                wherePart.AndLike(Model.Tb_order_main.Table.Odr_No, odrNo);
            }

            return(wherePart.End().ToQuery().ToList <Info_OrderMain>());
        }
예제 #2
0
        public List <Info_salary_main> QuerySalaryMainRecord(object beginTime, object endTime, string odrNo)
        {
            Miles.Coro.ORM.Find.IWherePart wherePart = this.Repository.Find()
                                                       .From <Model.Tb_salary_main>()
                                                       .Select().End().Where();

            if (beginTime != null)
            {
                wherePart.And(Model.Tb_salary_main.Table.Oper_Date, Miles.Coro.ORM.DbCompareChar.More, (DateTime)beginTime);
            }

            if (endTime != null)
            {
                wherePart.And(Model.Tb_salary_main.Table.Oper_Date, Miles.Coro.ORM.DbCompareChar.Less, (DateTime)endTime);
            }

            if (!string.IsNullOrEmpty(odrNo))
            {
                wherePart.AndLike(Model.Tb_salary_main.Table.Odr_No_Main, odrNo);
            }

            return(wherePart.End()
                   .ToQuery()
                   .ToList <Info_salary_main>());
        }
예제 #3
0
        public List <Info_link_bill> QuerySelfLinkRecord(string employCode, object beginTime, object endTime, string odrNo)
        {
            Miles.Coro.ORM.Find.IWherePart wherePart = this.Repository.Find().From <Model.Tb_link_bill>()
                                                       .Select().End().Where()
                                                       .And(Model.Tb_link_bill.Table.Employ_Code, employCode)
                                                       .StartGroup()
                                                       .Or(Model.Tb_link_bill.Table.Bill_State, Miles.Coro.ORM.DbCompareChar.Equal, (int)Enum.GenState.Valid)
                                                       .Or(Model.Tb_link_bill.Table.Bill_State, Miles.Coro.ORM.DbCompareChar.Equal, (int)Enum.GenState.Termination)
                                                       .StartGroup();

            if (beginTime != null)
            {
                wherePart.And(Model.Tb_link_bill.Table.Oper_Date, Miles.Coro.ORM.DbCompareChar.More, (DateTime)beginTime);
            }

            if (endTime != null)
            {
                wherePart.And(Model.Tb_link_bill.Table.Oper_Date, Miles.Coro.ORM.DbCompareChar.Less, (DateTime)endTime);
            }

            if (!string.IsNullOrEmpty(odrNo))
            {
                wherePart.AndLike(Model.Tb_link_bill.Table.Odr_No, odrNo);
            }

            return(wherePart
                   .End()
                   .ToQuery()
                   .ToList <Info_link_bill>());
        }
예제 #4
0
        public List <Info_fin_order_gen> QuerySelfGenRecord(string employCode, object beginTime, object endTime, string odrNo)
        {
            Miles.Coro.ORM.Find.IWherePart wherePart = this.Repository.Find().From <Model.Tb_fin_order_gen>()
                                                       .Select().End().Where()
                                                       .And(Model.Tb_fin_order_gen.Table.Employ_Code, employCode)
                                                       .StartGroup()
                                                       .Or(Model.Tb_fin_order_gen.Table.Gen_State, Miles.Coro.ORM.DbCompareChar.Equal, (int)Enum.GenState.Valid)
                                                       .Or(Model.Tb_fin_order_gen.Table.Gen_State, Miles.Coro.ORM.DbCompareChar.Equal, (int)Enum.GenState.Termination)
                                                       .StartGroup();

            if (beginTime != null)
            {
                wherePart.And(Model.Tb_fin_order_gen.Table.Gen_Date, Miles.Coro.ORM.DbCompareChar.More, (DateTime)beginTime);
            }

            if (endTime != null)
            {
                wherePart.And(Model.Tb_fin_order_gen.Table.Gen_Date, Miles.Coro.ORM.DbCompareChar.Less, (DateTime)endTime);
            }

            if (!string.IsNullOrEmpty(odrNo))
            {
                wherePart.AndLike(Model.Tb_fin_order_gen.Table.Odr_No, odrNo);
            }

            return(wherePart.End()
                   .LeftJoin <Model.Tb_order_text>()
                   .On(Model.Tb_fin_order_gen.Table.Odr_No, Model.Tb_order_text.Table.Odr_No)
                   .JoinTable()
                   .Select()
                   .Field(Model.Tb_order_text.Table.Odr_Pay)
                   .End()
                   .ToQuery()
                   .ToList <Info_fin_order_gen>());
        }
예제 #5
0
        public List <Q_store_out_item> QueryStoreOutRecord(object beginTime, object endTime, string odrNo)
        {
            Miles.Coro.ORM.Find.IWherePart wherePart = this.Repository.Find().From <Model.Tb_store_out>()
                                                       .Select()
                                                       .Field(Model.Tb_store_out.Table.StoreOut_Id, true)
                                                       .End()
                                                       .Where()
                                                       .And(Model.Tb_store_out.Table.StoreOut_State, (int)Enum.OutStoreState.Valid);

            if (beginTime != null)
            {
                wherePart.And(Model.Tb_store_out.Table.Oper_Date, Miles.Coro.ORM.DbCompareChar.More, (DateTime)beginTime);
            }

            if (endTime != null)
            {
                wherePart.And(Model.Tb_store_out.Table.Oper_Date, Miles.Coro.ORM.DbCompareChar.Less, (DateTime)endTime);
            }

            if (!string.IsNullOrEmpty(odrNo))
            {
                wherePart.AndLike(Model.Tb_store_out.Table.Odr_No, odrNo);
            }

            List <Q_store_out_item> list = wherePart
                                           .End()
                                           .InnerJoin <Model.Tb_store_out_item>()
                                           .On(Model.Tb_store_out.Table.StoreOut_Id, Model.Tb_store_out_item.Table.StoreOut_Id)
                                           .JoinTable()
                                           .Select().End()
                                           .Where()
                                           .And(Model.Tb_store_out_item.Table.Mtl_Qty, Miles.Coro.ORM.DbCompareChar.More, 0)
                                           .End()
                                           .ToQuery()
                                           .ToList <Q_store_out_item>();

            for (int i = 0; i < list.Count; i++)
            {
                Q_store_out_item item = list[i];
                Info_mtl_item    mtl  = Cache.LogicCache.DicMtlItem[item.Mtl_Code];
                item = Miles.Coro.Common.Utils.CopyToOther <Info_mtl_item, Q_store_out_item>(mtl, item);
            }

            return(list);
        }
예제 #6
0
        public List <Q_project_Cost_Item> QuerySelfCostItemRecord(string employCode, object beginTime, object endTime, string odrNo)
        {
            Miles.Coro.ORM.Find.IWherePart wherePart = this.Repository.Find()
                                                       .From <Model.Tb_project_Cost>()
                                                       .Select()
                                                       .Field(Model.Tb_project_Cost.Table.Odr_No)
                                                       .Field(Model.Tb_project_Cost.Table.Odr_Prt_Name)
                                                       .Field(Model.Tb_project_Cost.Table.Odr_Type)
                                                       .Field(Model.Tb_project_Cost.Table.Oper_Date)
                                                       .Field(Model.Tb_project_Cost.Table.Employ_Name)
                                                       .End()
                                                       .Where()
                                                       .And(Tb_project_Cost.Table.Cost_State, (int)Enum.ProjectCostState.Valid)
                                                       .And(Tb_project_Cost.Table.Employ_Code, employCode);

            if (beginTime != null)
            {
                wherePart.And(Model.Tb_project_Cost.Table.Oper_Date, Miles.Coro.ORM.DbCompareChar.More, (DateTime)beginTime);
            }

            if (endTime != null)
            {
                wherePart.And(Model.Tb_project_Cost.Table.Oper_Date, Miles.Coro.ORM.DbCompareChar.Less, (DateTime)endTime);
            }

            if (!string.IsNullOrEmpty(odrNo))
            {
                wherePart.AndLike(Model.Tb_project_Cost.Table.Odr_No, odrNo);
            }

            return(wherePart.End().LeftJoin <Model.Tb_project_Cost_Item>()
                   .On(Model.Tb_project_Cost.Table.LinkBill_Id, Model.Tb_project_Cost_Item.Table.LinkBill_Id)
                   .JoinTable()
                   .Select()
                   .End()
                   .LeftJoin <Model.Tb_expend_item>()
                   .On(Model.Tb_project_Cost_Item.Table.Item_Value, Model.Tb_expend_item.Table.Item_Value)
                   .JoinTable()
                   .Select()
                   .Field(Model.Tb_expend_item.Table.Define_Flag)
                   .End()
                   .ToQuery().ToList <Q_project_Cost_Item>());
        }
예제 #7
0
        public List <Info_matchTb> QueryMatchTbRecord(object beginTime, object endTime, string odrNo)
        {
            Miles.Coro.ORM.Find.IWherePart wherePart = this.Repository.Find().From <Model.Tb_matchTb>()
                                                       .Select().End().Where()
                                                       .And(Model.Tb_matchTb.Table.MatchTb_State, (int)Enum.MatchTbState.Valid);

            if (beginTime != null)
            {
                wherePart.And(Model.Tb_matchTb.Table.Oper_Date, Miles.Coro.ORM.DbCompareChar.More, (DateTime)beginTime);
            }

            if (endTime != null)
            {
                wherePart.And(Model.Tb_matchTb.Table.Oper_Date, Miles.Coro.ORM.DbCompareChar.Less, (DateTime)endTime);
            }

            if (!string.IsNullOrEmpty(odrNo))
            {
                wherePart.AndLike(Model.Tb_matchTb.Table.Odr_No, odrNo);
            }

            return(wherePart.End().ToQuery().ToList <Info_matchTb>());
        }