示例#1
0
        public ActionResult InsertCommission(_FinalCommission model)
        {
            FinalCommission newmodel = new FinalCommission();

            newmodel.TargetNameEN       = model.TargetNameEN;
            newmodel.TargetNameCN       = model.TargetNameCN;
            newmodel.ProjectID          = model.ProjectID;
            newmodel.InOut              = model.InOut;
            newmodel.DelegateLessIncome = model.DelegateLessIncome;
            newmodel.DelegateMoreCount  = model.DelegateMoreCount;
            newmodel.DelegateMoreIncome = model.DelegateMoreIncome;
            newmodel.SponsorIncome      = model.SponsorIncome;
            newmodel.Income             = model.Income;
            newmodel.CommissionRate     = model.CommissionRate;
            newmodel.Commission         = model.CommissionA;
            newmodel.Tax              = model.Tax;
            newmodel.Bonus            = model.Bonus;
            newmodel.ActualCommission = model.ActualCommission;

            newmodel.DelegateLessRate       = model.DelegateLessRate;
            newmodel.DelegateLessCommission = model.DelegateLessCommission;
            newmodel.DelegateMoreRate       = model.DelegateMoreRate;
            newmodel.DelegateMoreCommission = model.DelegateMoreCommission;
            newmodel.SponsorRate            = model.SponsorRate;
            newmodel.SponsorCommission      = model.SponsorCommission;
            newmodel.TotalCommission        = model.TotalCommission;

            newmodel.DelegateLessPayed = model.DelegateLessPayed;
            newmodel.DelegateMorePayed = model.DelegateMorePayed;
            newmodel.SponsorPayed      = model.SponsorPayed;
            newmodel.CommissionPayed   = model.CommissionPayed;

            newmodel.DelegateIncome     = model.DelegateIncome;
            newmodel.DelegateRate       = model.DelegateRate;
            newmodel.DelegateCommission = model.DelegateCommission;
            newmodel.DelegatePayed      = model.DelegatePayed;

            var procode = CH.GetDataById <Project>(model.ProjectID).ProjectCode;

            newmodel.CommID = procode + "-" + model.TargetNameEN + DateTime.Now.Year.ToString() + DateTime.Now.Month.ToString().PadLeft(2, '0');
            CH.Create <FinalCommission>(newmodel);
            var list = Finance_Logical._PreCommissionBLL.GetFinalCommission(model.ProjectID, model.TargetNameEN);
            var data = list.OrderBy(p => p.TargetNameEN).ToList();

            return(View(new GridModel(data)));
        }
示例#2
0
        public ActionResult SaveCommission(_FinalCommission model)
        {
            FinalCommission newmodel = new FinalCommission();

            newmodel = CH.GetDataById <FinalCommission>(model.ID);
            newmodel.TargetNameEN       = model.TargetNameEN;
            newmodel.TargetNameCN       = model.TargetNameCN;
            newmodel.ProjectID          = model.ProjectID;
            newmodel.InOut              = model.InOut;
            newmodel.DelegateLessIncome = model.DelegateLessIncome;
            newmodel.DelegateMoreCount  = model.DelegateMoreCount;
            newmodel.DelegateMoreIncome = model.DelegateMoreIncome;
            newmodel.SponsorIncome      = model.SponsorIncome;
            newmodel.Income             = model.Income;
            newmodel.CommissionRate     = model.CommissionRate;
            newmodel.Commission         = model.CommissionA;
            newmodel.Tax              = model.Tax;
            newmodel.Bonus            = model.Bonus;
            newmodel.ActualCommission = model.ActualCommission;

            newmodel.DelegateLessRate       = model.DelegateLessRate;
            newmodel.DelegateLessCommission = model.DelegateLessCommission;
            newmodel.DelegateMoreRate       = model.DelegateMoreRate;
            newmodel.DelegateMoreCommission = model.DelegateMoreCommission;
            newmodel.SponsorRate            = model.SponsorRate;
            newmodel.SponsorCommission      = model.SponsorCommission;
            newmodel.TotalCommission        = model.TotalCommission;

            newmodel.DelegateLessPayed = model.DelegateLessPayed;
            newmodel.DelegateMorePayed = model.DelegateMorePayed;
            newmodel.SponsorPayed      = model.SponsorPayed;
            newmodel.CommissionPayed   = model.CommissionPayed;

            newmodel.DelegateIncome     = model.DelegateIncome;
            newmodel.DelegateRate       = model.DelegateRate;
            newmodel.DelegateCommission = model.DelegateCommission;
            newmodel.DelegatePayed      = model.DelegatePayed;

            CH.Edit <FinalCommission>(newmodel);
            var list = Finance_Logical._PreCommissionBLL.GetFinalCommission(model.ProjectID, model.TargetNameEN);
            var data = list.OrderBy(p => p.TargetNameEN).ToList();

            return(View(new GridModel(data)));
        }