/// <summary> /// 新增临时收费 /// </summary> /// <param name="tCharge"></param> /// <param name="tChargeDetails"></param> public void AddTempCharge(TempCharge tCharge, List<TempChargeDetail> tChargeDetails) { using (DBHelper db = DBHelper.Create()) { db.BeginTransaction(); db.Insert<TempCharge>(tCharge); db.InsertBatch<TempChargeDetail>(tChargeDetails.ToArray()); db.Commit(); } }
/// <summary> /// 增加一条数据 /// </summary> public void Add(TempCharge model) { using (DBHelper db = DBHelper.Create()) { db.Insert<TempCharge>(model); } }
/// <summary> /// 新增临时收费 /// </summary> /// <param name="tCharge"></param> /// <param name="tChargeDetails"></param> public void AddTempCharge(TempCharge tCharge, List<TempChargeDetail> tChargeDetails) { if (tChargeDetails != null) { tCharge.ID = Guid.NewGuid().ToString("N"); tCharge.CreateTime = DateTime.Now; foreach (TempChargeDetail detail in tChargeDetails) { detail.ID = Guid.NewGuid().ToString("N"); detail.TempChargeID = tCharge.ID; detail.CreateTime = DateTime.Now; if (!string.IsNullOrEmpty(detail.ItemID)) { decimal itemPrice = new ChargeItemRule().GetPriceByItemID(detail.ItemID, detail.Count, ""); detail.Money = Convert.ToDecimal(detail.Count) * itemPrice; tCharge.Money += detail.Money; } } dal.AddTempCharge(tCharge, tChargeDetails); } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(TempCharge model) { using (DBHelper db = DBHelper.Create()) { db.Update<TempCharge>(model); return true; } }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Ajax.Model.TempCharge model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public void Add(Ajax.Model.TempCharge model) { dal.Add(model); }
public ActionResult TempChargeConfirmSearch(EasyUIGridParamModel param) { int itemCount = 0; TempCharge tc = new TempCharge(); tc.Status = 0; List<dynamic> tempCharges = new TempChargeRule().Search(param, tc, out itemCount); var showList = from tempCharge in tempCharges select new { ID = tempCharge.ID, CustomerName = tempCharge.CUSTOMERNAME, ChargeName = tempCharge.CHARGENAME, Money = tempCharge.MONEY, CreateTime = tempCharge.CREATETIME, OperName = tempCharge.NAME, Detail = "查看详细" }; return Json(new { total = tempCharges.Count, rows = showList }, JsonRequestBehavior.AllowGet); }
public ActionResult TempChargeAdd(TempCharge tCharge, List<TempChargeDetail> tChargeDetail) { AjaxResult result = new AjaxResult(); try { tCharge.ID = Guid.NewGuid().ToString("N"); tCharge.OperatorID = MyTicket.CurrentTicket.UserID; new TempChargeRule().AddTempCharge(tCharge, tChargeDetail); result.Success = true; result.Message = "收费成功"; } catch (Exception ex) { result.Success = false; result.Message = ex.Message; } return Json(result, JsonRequestBehavior.AllowGet); }
public ActionResult Search(EasyUIGridParamModel param, TempCharge tCharge, TempChargeDetail tChargeDetail) { int itemCount = 0; List<dynamic> chargeList = new Ajax.BLL.TempChargeRule().Search(param, tCharge, out itemCount); var showList = from tempCharge in chargeList select new { ID = tempCharge.ID, CUSTOMERNAME = tempCharge.CUSTOMERNAME, CHARGENAME = tempCharge.CHARGENAME, MONEY = tempCharge.MONEY, CREATETIME = tempCharge.CREATETIME, NAME = tempCharge.NAME }; return Json(new { total = itemCount, rows = showList }, JsonRequestBehavior.AllowGet); }