public JsonResult Paying(ExpenseDetailsModel model) { JsonModel jm = new JsonModel(); //获取要去缴费的缴费明细 IHouseUserExpenseDetailsBLL expenseDetailsBLL = BLLFactory <IHouseUserExpenseDetailsBLL> .GetBLL("HouseUserExpenseDetailsBLL"); var expenseDetails = expenseDetailsBLL.GetEntity(u => u.Id == model.Id); if (expenseDetails == null) { jm.Msg = "该缴费记录不存在"; } else if (expenseDetails.IsPayed == ConstantParam.PAYED_TRUE) { jm.Msg = "该缴费记录已缴费"; } else { expenseDetails.IsPayed = ConstantParam.PAYED_TRUE; expenseDetails.PaymentType = 1; expenseDetails.PayedDate = DateTime.Now; expenseDetails.Operator = GetSessionModel().UserID; expenseDetails.InvoiceType = model.InvoiceType; //编辑成功 if (expenseDetailsBLL.Update(expenseDetails)) { //记录操作日志 jm.Content = PropertyUtils.ModelToJsonString(model); } } return(Json(jm, JsonRequestBehavior.AllowGet)); }
public ActionResult Paying(int id) { IHouseUserExpenseDetailsBLL expenseDetailsBLL = BLLFactory <IHouseUserExpenseDetailsBLL> .GetBLL("HouseUserExpenseDetailsBLL"); var expenseDetails = expenseDetailsBLL.GetEntity(u => u.Id == id); if (expenseDetails != null) { ExpenseDetailsModel model = new ExpenseDetailsModel(); model.Id = expenseDetails.Id; if (expenseDetails.BuildDoorId != null) { model.UnitDoor = expenseDetails.BuildDoor.BuildUnit.Build.BuildName + " " + expenseDetails.BuildDoor.BuildUnit.UnitName + " " + expenseDetails.BuildDoor.DoorName; } else if (expenseDetails.BuildCompanyId != null) { model.UnitDoor = expenseDetails.BuildCompany.Name; } model.ExpenseTypeName = expenseDetails.PropertyExpenseType.Name; switch (expenseDetails.ExpenseCycleId) { case ConstantParam.ExpenseCycle_ONE_MONTH: model.ExpenseCycle = "每月"; break; case ConstantParam.ExpenseCycle_TWO_MONTH: model.ExpenseCycle = "每两月"; break; case ConstantParam.ExpenseCycle_ONE_QUARTER: model.ExpenseCycle = "每季度"; break; case ConstantParam.ExpenseCycle_HARF_YEAR: model.ExpenseCycle = "每半年"; break; case ConstantParam.ExpenseCycle_ONE_YEAR: model.ExpenseCycle = "每年"; break; } model.Expense = expenseDetails.Expense; model.ExpenseDateDesc = expenseDetails.ExpenseDateDes; model.InvoiceTypeList = GetInvoiceTypeList(); return(View(model)); } else { return(RedirectToAction("ExpenseList")); } }