public int AgentAdd([FromForm] IOT.Core.Model.Agent a) { logger.Debug($"用户对代理商进行添加,添加的名称为:{a.AgentName}"); int i = _agentRepository.AddAgent(a); return(i); }
public Hashtable AddAgent(BusinessEntities businessEntityObj) { Hashtable hashTableObj = new Hashtable(); try { if (_modelState.IsValid) { if (!_repository.RecordExist(businessEntityObj.Code)) { var totalRecordSaved = _repository.AddAgent(businessEntityObj); if (totalRecordSaved == 1) { hashTableObj.Add("Success", true); hashTableObj.Add("Message", uiMessages.DataInsertionSuccess); } else { hashTableObj.Add("Success", false); hashTableObj.Add("Message", uiMessages.DataInsertionFailed); } } else { hashTableObj.Add("Success", false); hashTableObj.Add("Message", uiMessages.RecordExist); } } else { hashTableObj.Add("Success", false); hashTableObj.Add("Message", uiMessages.InvalidModel); } return(hashTableObj); } catch (Exception) { hashTableObj.Add("Success", false); hashTableObj.Add("Message", exMessages.CommonException); return(hashTableObj); } }
public Agent AddAgent(Agent agent) { Agent ag = _agentRepository.AddAgent(agent); return(ag); }