One More
I have this line up of methods calls inside my presentation layer all of those methods are placed inside my BLL, each of of those methods call to other methods that placed inside my DAL which do some kind of database operation, the target of this process is to
delete old team and add new team instead.
so i have two questions:Code:// Getting list of SiteSetting (return 1 item) List<SiteSetting> lstSiteSetting = siteSetting.GetAllFromSiteSetting(); // Getting list of UsersDetails (return 1 item) List<UsersDetails> lstUsersDetails = usersDetails.GetAllFromUsersDetailsByRecordID(TeamID); // Increasing SiteSetting TeamID by 1 siteSetting.IncreaseByOneSiteSettingTeamID(); // Getting list of empty (none user) teams (Limiting to 1) from team_details List<TeamDetails> lstOldTeamDetails = teamDetails.GetEmptyTeamByCountryID(lstUsersDetails[0].CountryID.ToString()); if (lstOldTeamDetails.Count > 0) // Team found start updating process... { // Updating old team with the new team details teamDetails.UpdateNewTeamDetailsByTeamID(lstSiteSetting[0].TeamID.ToString(), usersDetails.RegionID.ToString(), lstOldTeamDetails[0].RecordID.ToString()); // Updating users tables with new details. usersDetails.UpdateNewUserDetails(lstSiteSetting[0].TeamID.ToString(), lstUsersDetails[0].RecordID.ToString()); // Deleting Expend arena of the old team (if exist) expendArena.DeleteExpendsByTeamID(lstOldTeamDetails[0].TeamID); // Deleting old team Arena teamArena.DeleteArenaByTeamID(lstOldTeamDetails[0].TeamID); // Build arena for the new team teamArena.BuiildArenaByTeamID(lstSiteSetting[0].TeamID, lstSiteSetting[0]);
A) is my logic looks right?
B) since all of these actions are connected, if one fail (SQL / C# Error) there will be mismatch data inside the database, that's mean i need some kind of Transaction, those is ASP.NET has some kind of built transaction mechanism that can handle these type of situations ?
Thanks.





If you Like it 
Reply With Quote