public DataModel.Response.InsertResponse CreateUpload(DataModel.Model.UploadModel upload)
 {
     try
     {
         IUploadRepository uploadRepository = RepositoryClassFactory.GetInstance().GetUploadRepository();
         Upload            _upload          = MapperUtil.CreateMapper().Mapper.Map <UploadModel, Upload>(upload);
         object            id = uploadRepository.Insert(_upload);
         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
         });
     }
 }
Exemple #2
0
 public Upload Insert(Upload upload)
 {
     return(_uploadRepository.Insert(upload.Map <DbUpload>()).Map <Upload>());
 }