public string SaveCommPrice() { var inputValue = HttpContext.Current.Request.Form["Inputs"]; QueryComm model = Newtonsoft.Json.JsonConvert.DeserializeObject <QueryComm>(inputValue); if (model == null) { return(null); } //ResultRate result = new RateBLL().SaveCommPrice(model); ResultRate result = new RateBLL().SaveParValue(model); return(Newtonsoft.Json.JsonConvert.SerializeObject(result)); }
/// <summary> /// 平价模式保存 (新增、修改) /// </summary> /// <param name="model"></param> /// <returns></returns> public ResultRate SaveCommPrice(QueryComm model) { ResultRate resultModel = new ResultRate(); Model.TB_Price_CommBill commModel = new TB_Price_CommBill() { Price = model.Price, EnergyCode = model.EnergyCode, ID = model.ID }; if (model.ID == 0) { resultModel.IsSucess = _dal.AddCommPrice(commModel); } else { resultModel.IsSucess = _dal.UpdateCommPrice(commModel); } return(resultModel); }
/// <summary> /// 平价模式保存 (新增、修改) /// </summary> /// <param name="model"></param> /// <returns></returns> public ResultRate SaveParValue(QueryComm model) { ResultRate resultModel = new ResultRate(); Model.TB_PAR_VALUE_SET commModel = new TB_PAR_VALUE_SET() { PRICE = model.PRICE, TYPEID = model.TYPEID, ID = model.ID, CNAME = model.CNAME, DATE = model.DATE }; if (model.ID == 0) { resultModel.IsSucess = _dal.AddParValue(commModel); } else { resultModel.IsSucess = _dal.UpdateParValue(commModel); } return(resultModel); }