Exemplo n.º 1
0
        /// <summary>
        /// Gets the IdentityBank given the bank Id
        /// </summary>
        /// <param name="bankId"></param>
        /// <returns></returns>
        public UploadEntity GetUpload(string uploadId)
        {
            var          uploaddetail = GetUploadDetail(uploadId);
            UploadEntity upload       = null;

            if (uploaddetail != null)
            {
                upload = new UploadEntity(uploadId, uploaddetail["UploaderId"], uploaddetail["BankId"], uploaddetail["BranchId"], Convert.ToInt32(uploaddetail["Status"]));
            }

            return(upload);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Inserts a upload record in the uploads table
        /// </summary>
        /// <param name="upload">The upload record</param>
        /// <returns></returns>
        public int Insert(UploadEntity upload)
        {
            string commandText = "Insert into uploads (Id, UploaderId, BankId, BranchId, Status) values (@id, @uploaderId, @bankId, @branchId, @status)";
            Dictionary <string, object> parameters = new Dictionary <string, object>();

            parameters.Add("@id", upload.Id);
            parameters.Add("@uploaderId", upload.UploaderId);
            parameters.Add("@bankId", upload.BankId);
            parameters.Add("@branchId", upload.BranchId);
            parameters.Add("@status", upload.Status);

            return(_database.Execute(commandText, parameters));
        }