public bool Save(Info_fin_order_income info)
        {
            return(this.BatchTrans()
                   .Append <long>(
                       (r, id) =>
            {
                if (r.Remove <Tb_fin_order_income>().Where()
                    .And(Tb_fin_order_income.Table.Fin_Id, id)
                    .EndWhere().Save() < 0)
                {
                    return false;
                }
                return true;
            }
                       , info.Fin_Id
                       )
                   .Append <Tb_fin_order_income>
                       ((r, l) =>
            {
                l.Fin_Id = NewId();
                if (!Add(r, l))
                {
                    return false;
                }

                return true;
            }, info)
                   .Save());
        }
Example #2
0
        public bool AdoptFinIncome(Info_fin_order_income info)
        {
            return(this.BatchTrans().Append <Model.Info_fin_order_income>
                       ((r, f) =>
            {
                int odrState = (int)Enum.FinState.Pass;    // 2;
                info.Fin_State = odrState;

                Model.Tb_order_log log = new Model.Tb_order_log();
                //log.Ass_Id = info.Fin_Id;
                log.Oper_log = "回款审核通过";
                log.Msg = "回款审核通过";

                if (!WriteLog(r, log, info))
                {
                    return false;
                }

                SetOperateInfo(info, new List <string> {
                    Model.Tb_fin_order_income.Table.Audit_Code
                }
                               , new List <string> {
                    Model.Tb_fin_order_income.Table.Audit_Date
                });

                if (r.Update <Tb_fin_order_income>()
                    .Set()
                    .Field(Model.Tb_fin_order_income.Table.Fin_State, odrState)
                    .Field(Model.Tb_fin_order_income.Table.Audit_Code, info.Audit_Code)
                    .Field(Model.Tb_fin_order_income.Table.Audit_Date, info.Audit_Date)
                    .EndSet()
                    .Where()
                    .And(Model.Tb_fin_order_income.Table.Fin_Id, f.Fin_Id)
                    .EndWhere()
                    .Save() < 1)
                {
                    return false;
                }

                //更新合同摘要的支付金额
                if (r.Update <Tb_fin_order_gen>()
                    .Set()
                    .Increase(Tb_fin_order_gen.Table.Pay_Cost, f.Pay_Cost)
                    .EndSet()
                    .Where()
                    .And(Model.Tb_fin_order_gen.Table.Odr_No, f.Odr_No)
                    .EndWhere()
                    .Save() < 1)
                {
                    return false;
                }


                return true;
            }, info
                       ).Save());
        }
 public override bool Remove(Info_fin_order_income t)
 {
     if (this.Repository.Remove <Tb_fin_order_income>().Where()
         .And(Tb_fin_order_income.Table.Fin_Id, t.Fin_Id)
         .EndWhere().Save() < 1)
     {
         return(false);
     }
     return(true);
 }
 public bool Commit(Info_fin_order_income info)
 {
     if (this.Repository.Update <Tb_fin_order_income>()
         .Set()
         .Field(Model.Tb_fin_order_income.Table.Fin_State, (int)Enum.FinState.Commit)
         .EndSet()
         .Where()
         .And(Tb_fin_order_income.Table.Fin_Id, info.Fin_Id)
         .EndWhere().Save() < 1)
     {
         return(false);
     }
     return(true);
 }
Example #5
0
        public bool RejectFinIncome(Info_fin_order_income info, string msg)
        {
            return(this.BatchTrans().Append <Model.Info_fin_order_income>
                       ((r, f) =>
            {
                int odrState = (int)Enum.FinState.New;    // 0;
                info.Fin_State = odrState;

                Model.Tb_order_log log = new Model.Tb_order_log();
                //log.Ass_Id = info.Fin_Id;
                log.Oper_log = "回款审核不通过";
                log.Msg = msg == null ? "回款审核不通过" : msg;
                if (!WriteLog(r, log, info))
                {
                    return false;
                }

                SetOperateInfo(info, new List <string> {
                    Model.Tb_fin_order_income.Table.Audit_Code
                }
                               , new List <string> {
                    Model.Tb_fin_order_income.Table.Audit_Date
                });

                if (r.Update <Tb_fin_order_income>()
                    .Set()
                    .Field(Model.Tb_fin_order_income.Table.Fin_State, odrState)
                    .Field(Model.Tb_fin_order_income.Table.Audit_Code, info.Audit_Code)
                    .Field(Model.Tb_fin_order_income.Table.Audit_Date, info.Audit_Date)
                    .EndSet()
                    .Where()
                    .And(Model.Tb_fin_order_income.Table.Fin_Id, f.Fin_Id)
                    .EndWhere()
                    .Save() < 1)
                {
                    return false;
                }

                return true;
            }, info
                       ).Save());
        }
 public bool CheckIncomeNoPass(Info_fin_order_income info, string msg = "回款费用审核不通过")
 {
     return(processManager.RejectFinIncome(info, msg));
 }
 public override bool Add(Info_fin_order_income t)
 {
     throw new NotImplementedException();
 }
 public bool CheckIncomePass(Info_fin_order_income info)
 {
     return(processManager.AdoptFinIncome(info));
 }