public IApplication Delete(IApplication instance) { using (var cmd = new DBCommand()) { try { ApplicationDAL.Delete(cmd, instance); cmd.Commit(); return(instance); } catch (Exception ex) { cmd.RollBack(); using (var builder = new MessageBuilder()) { string err = builder.AppendLine("删除申请单错误!").AppendLine(ex).Message; throw new Exception(err); } } } }
public ICustomer Create(string id, string name, string sex, string phone, string address) { using (var cmd = new DBCommand()) { try { ICustomer instance = CustomerDAL.Create(cmd, id, name, sex, phone, address); cmd.Commit(); return(instance); } catch (Exception ex) { cmd.RollBack(); using (var builder = new MessageBuilder()) { string err = builder.AppendLine("创建客户信息错误!").AppendLine(ex).Message; throw new Exception(err); } } } }
public IStatus Create(string id, string value) { using (var cmd = new DBCommand()) { try { IStatus instance = StatusDAL.Create(cmd, id,value); cmd.Commit(); return instance; } catch (Exception ex) { cmd.RollBack(); using (var builder = new MessageBuilder()) { string err = builder.AppendLine("创建状态信息错误!").AppendLine(ex).Message; throw new Exception(err); } } } }
public IStatus Delete(IStatus instance) { using (var cmd = new DBCommand()) { try { StatusDAL.Delete(cmd, instance); cmd.Commit(); return instance; } catch (Exception ex) { cmd.RollBack(); using (var builder = new MessageBuilder()) { string err = builder.AppendLine("删除状态信息错误!").AppendLine(ex).Message; throw new Exception(err); } } } }
public ICollection Create(string id, decimal?value, decimal?offset) { using (var cmd = new DBCommand()) { try { ICollection instance = CollectionDAL.Create(cmd, id, value, offset); cmd.Commit(); return(instance); } catch (Exception ex) { cmd.RollBack(); using (var builder = new MessageBuilder()) { string err = builder.AppendLine("创建付费信息错误!").AppendLine(ex).Message; throw new Exception(err); } } } }
public ICollection Create(string id, decimal? value, decimal? offset) { using (var cmd = new DBCommand()) { try { ICollection instance = CollectionDAL.Create(cmd, id, value,offset); cmd.Commit(); return instance; } catch (Exception ex) { cmd.RollBack(); using (var builder = new MessageBuilder()) { string err = builder.AppendLine("创建付费信息错误!").AppendLine(ex).Message; throw new Exception(err); } } } }
public ICase Create(string id, string type, string text) { using (var cmd = new DBCommand()) { try { ICase instance = CaseDAL.Create(cmd, id, type, text); cmd.Commit(); return(instance); } catch (Exception ex) { cmd.RollBack(); using (var builder = new MessageBuilder()) { string err = builder.AppendLine("创建问题信息错误!").AppendLine(ex).Message; throw new Exception(err); } } } }
public ICase Create(string id, string type, string text) { using (var cmd = new DBCommand()) { try { ICase instance = CaseDAL.Create(cmd, id, type, text); cmd.Commit(); return instance; } catch (Exception ex) { cmd.RollBack(); using (var builder = new MessageBuilder()) { string err = builder.AppendLine("创建问题信息错误!").AppendLine(ex).Message; throw new Exception(err); } } } }
public IStatus Create(string id, string value) { using (var cmd = new DBCommand()) { try { IStatus instance = StatusDAL.Create(cmd, id, value); cmd.Commit(); return(instance); } catch (Exception ex) { cmd.RollBack(); using (var builder = new MessageBuilder()) { string err = builder.AppendLine("创建状态信息错误!").AppendLine(ex).Message; throw new Exception(err); } } } }
public IUser Create(string name, string password, UserRole? role) { using (var cmd = new DBCommand()) { try { string id = Guid.NewGuid().ToString(); IUser instance = UserDAL.Create(cmd, id,name, password, role); cmd.Commit(); return instance; } catch (Exception ex) { cmd.RollBack(); using (var builder = new MessageBuilder()) { string err = builder.AppendLine("创建用户信息错误!").AppendLine(ex).Message; throw new Exception(err); } } } }
public ICustomer Create(string id, string name, string sex, string phone, string address) { using (var cmd = new DBCommand()) { try { ICustomer instance = CustomerDAL.Create(cmd, id,name,sex,phone,address); cmd.Commit(); return instance; } catch (Exception ex) { cmd.RollBack(); using (var builder = new MessageBuilder()) { string err = builder.AppendLine("创建客户信息错误!").AppendLine(ex).Message; throw new Exception(err); } } } }
public IUser Create(string name, string password, UserRole?role) { using (var cmd = new DBCommand()) { try { string id = Guid.NewGuid().ToString(); IUser instance = UserDAL.Create(cmd, id, name, password, role); cmd.Commit(); return(instance); } catch (Exception ex) { cmd.RollBack(); using (var builder = new MessageBuilder()) { string err = builder.AppendLine("创建用户信息错误!").AppendLine(ex).Message; throw new Exception(err); } } } }
public IUser Update(IUser instance, string name, string password, UserRole?role) { using (var cmd = new DBCommand()) { try { UserDAL.Update(cmd, instance, name, password, role); cmd.Commit(); return(instance); } catch (Exception ex) { cmd.RollBack(); using (var builder = new MessageBuilder()) { string err = builder.AppendLine("更新用户信息错误!").AppendLine(ex).Message; throw new Exception(err); } } } }
public IApplication Update(IApplication instance, string id, string customerId, string region, DateTime?dateApplied, DateTime?dateTraved, string offNoteNo, DateTime?offNoteDate, string remark) { using (var cmd = new DBCommand()) { try { ApplicationDAL.Update(cmd, instance, id, customerId, region, dateApplied, dateTraved, offNoteNo, offNoteDate, remark); cmd.Commit(); return(instance); } catch (Exception ex) { cmd.RollBack(); using (var builder = new MessageBuilder()) { string err = builder.AppendLine("更新申请单错误!").AppendLine(ex).Message; throw new Exception(err); } } } }
public IApplication Create(string id, string customerId, string region, DateTime? dateApplied, DateTime? dateTraved, string offNoteNo, DateTime? offNoteDate, string remark) { using (var cmd = new DBCommand()) { try { IApplication instance = ApplicationDAL.Create(cmd, id, customerId, region, dateApplied, dateTraved, offNoteNo, offNoteDate, remark); cmd.Commit(); return instance; } catch (Exception ex) { cmd.RollBack(); using (var builder = new MessageBuilder()) { string err = builder.AppendLine("创建申请单错误!").AppendLine(ex).Message; throw new Exception(err); } } } }
public IUser Update(IUser instance, string name, string password, UserRole? role) { using (var cmd = new DBCommand()) { try { UserDAL.Update(cmd, instance, name, password,role); cmd.Commit(); return instance; } catch (Exception ex) { cmd.RollBack(); using (var builder = new MessageBuilder()) { string err = builder.AppendLine("更新用户信息错误!").AppendLine(ex).Message; throw new Exception(err); } } } }