コード例 #1
0
ファイル: ExpenseController.cs プロジェクト: mehmetsungur/OM
        public JsonResult CreatePersonnel(CreateExpenseVM vm)
        {
            try
            {
                Expense newPersonnel = new Expense();
                newPersonnel.Created    = DateTime.Now;
                newPersonnel.CreatedBy  = SessionManager.ActiveUser.Id;
                newPersonnel.Modified   = DateTime.Now;
                newPersonnel.ModifiedBy = SessionManager.ActiveUser.Id;
                newPersonnel.IsActive   = true;

                newPersonnel.Type        = "Personnel";
                newPersonnel.ProcessDate = vm.ProcessDate;
                newPersonnel.Process     = vm.Process;
                newPersonnel.CompanyName = vm.CompanyName;
                newPersonnel.PayDate     = vm.PayDate;
                newPersonnel.Price       = Math.Round(vm.Price, 2);
                newPersonnel.Description = vm.Description;

                _es.Insert(newPersonnel);

                return(Json(new { Result = true, Message = "Personel Gideri Başarıyla Kaydedildi." }));
            }
            catch (Exception ex)
            {
                return(Json(new { Result = false, ex.Message }));
            }
        }
コード例 #2
0
        public ActionResult Create()
        {
            CreateExpenseVM createExpenseVM = new CreateExpenseVM();

            return(View(createExpenseVM));
        }