public string SaveServiceSetting(decimal VIPAmount, int VIPMouth, decimal AllelicAmount, int AlielicNumber) { IMeiWei.BLL.servicesettings bll_service = new IMeiWei.BLL.servicesettings(); var model = bll_service.GetModelList(" RecordStatus = 'ACTIVE'").FirstOrDefault(); if (null != model) { model.RecordStatus = "INACTIVE"; bll_service.Update(model); } var newModel = new IMeiWei.Model.servicesettings(); newModel.Id = Guid.NewGuid().ToString(); newModel.RecordStatus = "ACTIVE"; newModel.AlielicNumber = AlielicNumber; newModel.AllelicAmount = AllelicAmount; newModel.CreateBy = "SYSTEM_SET"; newModel.CreateTime = DateTime.Now; newModel.VIPAmount = VIPAmount; newModel.VIPMouth = VIPMouth; bll_service.Add(newModel); return(GenJSSerializer().Serialize(newModel)); }
public string GetServiceSetting() { IMeiWei.BLL.servicesettings bll_service = new IMeiWei.BLL.servicesettings(); var model = bll_service.GetModelList(" RecordStatus = 'ACTIVE'").FirstOrDefault(); if (null == model) { model = new servicesettings(); } return(GenJSSerializer().Serialize(model)); }