public ResultQuotaLogs GetQuotaLogs() { var inputValue = _ntsPage.Request.Form["Inputs"]; var query = Newtonsoft.Json.JsonConvert.DeserializeObject <QueryQuotaLogContract>(inputValue); var result = new OperateQuotaBll().GetQuotaLogs(query); return(result); }
public int DealQuota() { var inputValue = _ntsPage.Request.Form["Inputs"]; var query = Newtonsoft.Json.JsonConvert.DeserializeObject <QuotaDataContact>(inputValue); query.UserName = Framework.Common.Utils.GetCookie("userid"); var result = new OperateQuotaBll().InsertOrEditQuota(query); return(result); }
public override string FormateContent(object primaryKey) { try { #region 变量 string content = string.Empty; int id = (int)primaryKey; string itemCodeName = string.Empty; string objectDes = string.Empty; string editTime = string.Empty; string quotaDate = string.Empty; string type = string.Empty; string oldValue = string.Empty; string newValue = string.Empty; string objectUnit = string.Empty; OperateQuotaBll quotaOper = new OperateQuotaBll(); #endregion #region 数据来源 var quotaInfo = quotaOper.GetQuotaInfoById(id); var itemCodeInfo = new NTS.WEB.BLL.Itemcode().GetItemcodeList(string.Format(" and itemcodenumber='{0}'", quotaInfo.QuotaData.ItemCode), "")[0]; QuotaLog newQoutaLog = quotaInfo.QuotaLogList[0]; #endregion #region 组织数据 itemCodeName = itemCodeInfo.ItemCodeName; objectUnit = itemCodeInfo.Unit; objectDes = quotaInfo.QuotaData.ObjectDesc; newValue = quotaInfo.QuotaData.QuotaValue.ToString(); editTime = newQoutaLog.LogTime.ToString("yyyy年MM月dd日HH时mm分ss秒"); type = quotaInfo.QuotaData.QuotaType == QuotaType.Month ? "月" : "年"; if (quotaInfo.QuotaData.QuotaType == QuotaType.Month) { quotaDate = string.Format("{0}年{1}月", quotaInfo.QuotaData.QuotaTime.Year, quotaInfo.QuotaData.QuotaTime.Month); } else if (quotaInfo.QuotaData.QuotaType == QuotaType.Year) { quotaDate = string.Format("{0}年", quotaInfo.QuotaData.QuotaTime.Year); } if (quotaInfo.QuotaLogList.Count > 1) { QuotaLog oldQUotaLog = quotaInfo.QuotaLogList[1]; oldValue = oldQUotaLog.QuotaValue.ToString(); content = string.Format("{0}用户于{1}修改\"{2}-{3}-{4}定额\":修改前为{5}kwh,修改后为{6}{7}。", _userName, editTime, objectDes, itemCodeName, type, oldValue, newValue, objectUnit); } else if (quotaInfo.QuotaLogList.Count == 1) { content = string.Format("{0}用户于{1}添加\"{2}-{3}-{4}定额\":{5}{6}。", _userName, editTime, objectDes, itemCodeName, type, newValue, objectUnit); } return(content); #endregion } catch (Exception ex) { return(ex.Message); } }