Ejemplo n.º 1
0
        public static SqlConnection GetConnection()
        {
            SqlConnection con = ConnectionGetway.GetConnection();

            if (con.State == ConnectionState.Closed)
            {
                con.Open();
            }
            return(con);
        }
 public bool ProcessSalary(string companyCode, string month)
 {
     using (var con = ConnectionGetway.GetConnection())
     {
         con.Open();
         using (var tran = con.BeginTransaction())
         {
             try
             {
                 var topLevelSalesman = _salesman.GetAssociates(companyCode, companyCode);
                 _salary.CreateNewSalaryAcc(con, tran, companyCode, month);
                 ProcessOrdinalCommission(con, tran, companyCode);
                 ProcessSalesBoundGbCommission(con, tran, topLevelSalesman);
                 tran.Commit();
                 return(true);
             }
             catch (Exception err)
             {
                 tran.Rollback();
                 throw (err);
             }
         }
     }
 }
Ejemplo n.º 3
0
 public static void Initialize(string server, string database, string userId, string password)
 {
     ConnectionGetway.Initialize(server, database, userId, password);
 }
Ejemplo n.º 4
0
 public static void Initialize(string server, string database)
 {
     ConnectionGetway.Initialize(server, database);
 }