public async Task <int> Add(DistributionEmployee employee)
        {
            var cmd = QueriesCreatingHelper.CreateQueryInsert(employee);

            cmd += ";SELECT LAST_INSERT_ID();";
            return((await DALHelper.ExecuteQuery <int>(cmd, dbTransaction: DbTransaction, connection: DbConnection)).First());
        }
        public async Task <int> Update(DistributionEmployee employee)
        {
            var cmd = QueriesCreatingHelper.CreateQueryUpdate(employee);
            var rs  = await DALHelper.Execute(cmd, dbTransaction : DbTransaction, connection : DbConnection);

            return(rs == 0 ? -1 : 0);
        }
Example #3
0
 public UpdateCommand(DistributionEmployee employee)
 {
     Employee = employee;
 }
Example #4
0
 public AddCommand(DistributionEmployee employee)
 {
     Employee = employee;
 }