Exemple #1
0
 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);
             }
         }
     }
 }
Exemple #2
0
 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);
             }
         }
     }
 }
Exemple #3
0
 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);
             }
         }
     }
 }
Exemple #4
0
 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);
             }
         }
     }
 }
Exemple #5
0
 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);
             }
         }
     }
 }
Exemple #6
0
 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);
             }
         }
     }
 }
Exemple #7
0
 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);
             }
         }
     }
 }
Exemple #8
0
 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);
             }
         }
     }
 }
Exemple #9
0
 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);
             }
         }
     }
 }
Exemple #10
0
 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);
             }
         }
     }
 }
Exemple #11
0
        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);
                    }
                }
            }
        }
Exemple #12
0
 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);
             }
         }
     }
 }
Exemple #13
0
        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);
                    }
                }
            }
        }
Exemple #14
0
        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);
                    }
                }
            }
        }
Exemple #15
0
        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);
                    }
                }
            }
        }
Exemple #16
0
        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);
                    }
                }
            }
        }