コード例 #1
0
        //
        // GET: /Project/budget/Details/5

        //public ActionResult Details(int id)
        //{
        //    return View();
        // GET: /Project/ProjectBasedata/Create

        public ActionResult Create()
        {
            var ProjectList = this.ProjectService.GetProjectBasedataList(new ProjectRequest());

            this.ViewBag.ProjectBasedataID = new SelectList(ProjectList, "ID", "PName");

            var model = new InsBudgetInfo();

            return(View("Edit", model));
        }         //
コード例 #2
0
ファイル: ProjectService.cs プロジェクト: liumyzone/HaoTang
 public void SaveInsBudget(InsBudgetInfo insbudget)
 {
     using (var dbContext = new ProjectDbContext())
     {
         if (insbudget.ID > 0)
         {
             dbContext.Update <InsBudgetInfo>(insbudget);
         }
         else
         {
             dbContext.Insert <InsBudgetInfo>(insbudget);
         }
     }
 }
コード例 #3
0
        public ActionResult Create(FormCollection collection)
        {
            var model = new InsBudgetInfo();

            this.TryUpdateModel <InsBudgetInfo>(model);

            if (model.InsWarranty != null)
            {
                model.InsBudgetTotal += (int)model.InsWarranty;
            }
            if (model.InsSubcontracting != null)
            {
                model.InsBudgetTotal += (int)model.InsSubcontracting;
            }
            if (model.InsOtherBudget != null)
            {
                model.InsBudgetTotal += (int)model.InsOtherBudget;
            }

            this.ProjectService.SaveInsBudget(model);

            return(this.RefreshParent());
        }