예제 #1
0
        //==============END ADD BRANCH==============//

        //================ADD BRANCH(w/ branch manager)================//
        public static void SQLAddBranchManager(_Branch B)
        {
            var    cs         = ConfigurationManager.ConnectionStrings["ZoomDB"];
            string connection = cs.ConnectionString;

            SqlConnection sqlconnect = new SqlConnection(connection);
            SqlCommand    add        = new SqlCommand("INSERT INTO BRANCH VALUES(@BMNGR)", sqlconnect);

            add.Parameters.AddWithValue("BMNGR", B.BranchManagerID);
            sqlconnect.Open();

            add.ExecuteNonQuery();

            sqlconnect.Close();
        }
예제 #2
0
        //==============END ADD BRANCH==============//

        //================ADD BRANCH(w/ branch manager)================//
        public static void SQLAddBranchManager(_Branch B, int bID)
        {
            var    cs         = ConfigurationManager.ConnectionStrings["ZoomDB"];
            string connection = cs.ConnectionString;

            SqlConnection sqlconnect = new SqlConnection(connection);
            SqlCommand    add        = new SqlCommand("UPDATE BRANCH set BR_MANAGERID=@BMNGR where id=@bID", sqlconnect);

            add.Parameters.AddWithValue("BMNGR", B.BranchManagerID);
            add.Parameters.AddWithValue("bID", bID);
            sqlconnect.Open();

            add.ExecuteNonQuery();

            sqlconnect.Close();
        }
예제 #3
0
        //=========END_Add_ROLE=====//

        //================ADD BRANCH================//
        public static void SQLAddBranch(_Branch B)
        {
            var    cs         = ConfigurationManager.ConnectionStrings["ZoomDB"];
            string connection = cs.ConnectionString;

            SqlConnection sqlconnect = new SqlConnection(connection);
            SqlCommand    add        = new SqlCommand("INSERT INTO BRANCH VALUES(@LOC, @BOWNER,@BMANAGE,@BrandID,@cityCode)", sqlconnect);

            add.Parameters.AddWithValue("LOC", B.Location);
            add.Parameters.AddWithValue("BOWNER", B.BranchOwnerID);
            add.Parameters.AddWithValue("BMANAGE", DBNull.Value);
            add.Parameters.AddWithValue("BrandID", B.BranchId);
            add.Parameters.AddWithValue("cityCode", B.cityCode);
            sqlconnect.Open();

            add.ExecuteNonQuery();

            sqlconnect.Close();
        }