Пример #1
0
 public DataModel.Response.BaseResponse Update(DataModel.Model.LogisticScheduleModel logistic)
 {
     try
     {
         ILogisticSheduleRepository logisticRepository = RepositoryClassFactory.GetInstance().GetLogisticRepository();
         LogisticSchedule           _logistic          = MapperUtil.CreateMapper().Mapper.Map <LogisticScheduleModel, LogisticSchedule>(logistic);
         logisticRepository.Update(_logistic);
         return(new BaseResponse
         {
             ErrorCode = (int)ErrorCode.None,
             Message = Resources.Resource.msg_update_success
         });
     }
     catch (Exception ex)
     {
         return(new BaseResponse
         {
             ErrorCode = (int)ErrorCode.Error,
             Message = ex.Message
         });
     }
 }
Пример #2
0
 public DataModel.Response.InsertResponse Create(DataModel.Model.LogisticScheduleModel logistic)
 {
     try
     {
         ILogisticSheduleRepository logisticRepository = RepositoryClassFactory.GetInstance().GetLogisticRepository();
         object id = logisticRepository.Insert(MapperUtil.CreateMapper().Mapper.Map <LogisticScheduleModel, LogisticSchedule>(logistic));
         return(new InsertResponse
         {
             InsertID = id.ToString(),
             ErrorCode = (int)ErrorCode.None,
             Message = Resources.Resource.msg_create_success
         });
     }
     catch (Exception ex)
     {
         return(new InsertResponse
         {
             ErrorCode = (int)ErrorCode.Error,
             Message = ex.Message
         });
     }
 }