//==============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(); }
//==============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(); }
//=========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(); }