public void Subscribe(string chatId, string name, string envs) { var table = _storage.GetTable(SubscribeEntity.TableKey); _storage.CreateIfNotExists(table); var entity = _storage.RetrieveEntity <SubscribeEntity>(table, SubscribeEntity.Key, chatId); if (string.IsNullOrEmpty(envs)) { if (entity != null) { _storage.DeleteEntity(table, entity); } } else { if (entity != null) { entity.Envs = envs; _storage.UpdateEntity(table, entity); } else { entity = new SubscribeEntity(chatId) { Name = name, Envs = envs }; _storage.InsertEntity(table, entity); } } }
/// <summary> /// 保存表单(新增、修改) /// </summary> /// <param name="keyValue">主键值</param> /// <param name="entity">实体对象</param> /// <returns></returns> public void SaveForm(string keyValue, SubscribeEntity entity) { try { service.SaveForm(keyValue, entity); } catch (Exception) { throw; } }
public ActionResult SaveAddForm(string keyValue, SubscribeEntity entity) { if (string.IsNullOrWhiteSpace(entity.CustomerId)) { return(Error("客户信息不正确")); } var customerEntity = customerbll.GetEntity(entity.CustomerId); if (customerEntity == null) { return(Error("客户信息不存在")); } entity.CustomerId = customerEntity.CustomerId; entity.CustomerName = customerEntity.FullName; subscribebll.SaveForm(keyValue, entity); return(Success("操作成功。")); }
public void Subscribe(string chatId, string name) { var table = _storage.GetTable(SubscribeEntity.TableKey); _storage.CreateIfNotExists(table); var entity = _storage.RetrieveEntity <SubscribeEntity>(table, SubscribeEntity.Key, chatId); if (entity == null) { entity = new SubscribeEntity(chatId) { Name = name }; _storage.InsertEntity(table, entity); } else { entity.Name = name; _storage.UpdateEntity(table, entity); } }
public ActionResult SaveUpdateForm(string keyValue, SubscribeEntity entity) { subscribebll.SaveForm(keyValue, entity); return(Success("操作成功。")); }
public void UpdateSubscribe(SubscribeEntity Subscribe) { EcomakDbContext.Subscribes.Update(Subscribe); }
//suscribe public void CreateSubscribe(SubscribeEntity Subscribe) { EcomakDbContext.Subscribes.Add(Subscribe); }