public async Task <int> Update(CollectionEmployee employee)
        {
            var cmd = QueriesCreatingHelper.CreateQueryUpdate(employee);
            var rs  = await DALHelper.Execute(cmd, dbTransaction : DbTransaction, connection : DbConnection);

            return(rs == 0 ? -1 : 0);
        }
        public async Task <int> Add(CollectionEmployee employee)
        {
            var cmd = QueriesCreatingHelper.CreateQueryInsert(employee);

            cmd += ";SELECT LAST_INSERT_ID();";
            return((await DALHelper.ExecuteQuery <int>(cmd, dbTransaction: DbTransaction, connection: DbConnection)).First());
        }
Beispiel #3
0
 public AddCommand(CollectionEmployee employee)
 {
     Employee = employee;
 }
Beispiel #4
0
 public UpdateCommand(CollectionEmployee employee)
 {
     Employee = employee;
 }