public List <sp_GetAdgiverFnameLnamePhnResult> GetAdGiverNamePhnByEmail(string userEmailId) { try { OiiOHaatDCDataContext dbContext = DatabaseHelper.GetDataModelDataContext(); List <AdGiver> adgiveraccNmaePhn = new List <AdGiver>(); var adGiveraccNamePhn = dbContext.sp_GetAdgiverFnameLnamePhn(userEmailId).ToList(); return(adGiveraccNamePhn); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
/// <summary> /// Hasan Add GetParentCategoryIDByName Category Date: 4 March 2015 /// </summary> /// <returns></returns> /// public int GetParentCategoryIDByName(string categoryName) { try { OiiOHaatDCDataContext dbContext = DatabaseHelper.GetDataModelDataContext(); var categoryID = dbContext.Categories.Single(d => d.IsRemoved == false && d.ParentID == null && d.Name == categoryName).IID.ToString(); dbContext.Dispose(); return(int.Parse(categoryID)); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
//public object UpdateadGiverAccNamePhn(string userEmailId) //{ // OiiOHaatDCDataContext dbContext = DatabaseHelper.GetDataModelDataContext(); // AdGiver adgiveracc = new AdGiver(); // var adGiveracc = dbContext.SpGetAllPoliceStation(userEmailId); // return adGiveracc; //} public object UpdateadGiverAccNamePhn(string userEmailId, string Name, string PhoneNo1) { try { OiiOHaatDCDataContext dbContext = DatabaseHelper.GetDataModelDataContext(); AdGiver adgiveracc = new AdGiver(); var adGiveracc = dbContext.sp_UpdateAccNamePhone(userEmailId, Name, PhoneNo1); return(adGiveracc); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
public List <MappingCategory> GetMappingCategoryAll() { try { OiiOHaatDCDataContext dbContext = DatabaseHelper.GetDataModelDataContext(); List <MappingCategory> mappingCategoryList = new List <MappingCategory>(); mappingCategoryList = dbContext.MappingCategories.Where(d => d.IsRemoved == false).ToList(); dbContext.Dispose(); return(mappingCategoryList); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
public void DeleteFromMaterialAndPicAndSaveToLog(long matId) { try { OiiOHaatDCDataContext db = DatabaseHelper.GetDataModelDataContext(); db.DeleteFromMaterialAndSaveToLog(matId); } catch (Exception exception) { throw new Exception(exception.Message, exception); } }
public List <LeavingCause> GetLeavingCouseAll() { try { OiiOHaatDCDataContext dbContext = DatabaseHelper.GetDataModelDataContext(); List <LeavingCause> LeavingCauseList = new List <LeavingCause>(); LeavingCauseList = dbContext.LeavingCauses.Where(d => d.IsRemoved == false).ToList(); dbContext.Dispose(); return(LeavingCauseList); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
public void UpdatePoliceStaion(PoliceStation policeStation) { try { OiiOHaatDCDataContext msDC = DatabaseHelper.GetDataModelDataContext(); PoliceStation policeSta = msDC.PoliceStations.Single(d => d.IID == policeStation.IID); DatabaseHelper.Update <PoliceStation>(msDC, policeStation, policeSta); msDC.Dispose(); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
public void UpdateBrand(Brand brand) { try { OiiOHaatDCDataContext msDC = DatabaseHelper.GetDataModelDataContext(); Brand brandNew = msDC.Brands.Single(d => d.IID == brand.IID); DatabaseHelper.Update <Brand>(msDC, brand, brandNew); msDC.Dispose(); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
public void UpdateadGiverTracing(AdGiverTracing adGiverTracing) { try { OiiOHaatDCDataContext msDC = DatabaseHelper.GetDataModelDataContext(); AdGiverTracing userGrp = msDC.AdGiverTracings.Single(d => d.IID == adGiverTracing.IID); DatabaseHelper.Update <AdGiverTracing>(msDC, adGiverTracing, userGrp); msDC.Dispose(); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
public Model GetModelByID(int modelID) { try { OiiOHaatDCDataContext dbContext = DatabaseHelper.GetDataModelDataContext(); Model model = new Model(); model = dbContext.Models.Single(d => d.IID == modelID && d.IsRemoved == false); dbContext.Dispose(); return(model); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
public void UpdateModel(Model model) { try { OiiOHaatDCDataContext msDC = DatabaseHelper.GetDataModelDataContext(); Model modelNew = msDC.Models.Single(d => d.IID == model.IID); DatabaseHelper.Update <Model>(msDC, model, modelNew); msDC.Dispose(); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
public void UpdateEmailSubscribe(OiiONewsLetter EmailSubscribe) { try { OiiOHaatDCDataContext msDC = DatabaseHelper.GetDataModelDataContext(); OiiONewsLetter Emailsubscribe = msDC.OiiONewsLetters.Single(d => d.UserEmail == EmailSubscribe.UserEmail); DatabaseHelper.Update <OiiONewsLetter>(msDC, EmailSubscribe, Emailsubscribe); msDC.Dispose(); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
public List <OiiONewsLetter> GetEmailSubscriber(string EmailSubscriber) { try { OiiOHaatDCDataContext dbContext = DatabaseHelper.GetDataModelDataContext(); List <OiiONewsLetter> EmailSubscriberList = new List <OiiONewsLetter>(); EmailSubscriberList = dbContext.OiiONewsLetters.Where(d => d.IID != null && d.IsSubscribe == true && d.UserEmail.Contains(EmailSubscriber)).ToList(); dbContext.Dispose(); return(EmailSubscriberList); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
public OiiOOther GetOtherContentByIID(int OtherContentID) { try { OiiOHaatDCDataContext dbContext = DatabaseHelper.GetDataModelDataContext(); OiiOOther Oiioother = new OiiOOther(); Oiioother = dbContext.OiiOOthers.Single(d => d.IID == OtherContentID); dbContext.Dispose(); return(Oiioother); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
public void Updateoiiocontent(OiiOOther oiiocontent) { try { OiiOHaatDCDataContext msDC = DatabaseHelper.GetDataModelDataContext(); OiiOOther Oiiocontent = msDC.OiiOOthers.Single(d => d.IID == oiiocontent.IID); DatabaseHelper.Update <OiiOOther>(msDC, oiiocontent, Oiiocontent); msDC.Dispose(); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
public void UpdateDivisionOrState(DivisionOrState divisionOrState) { try { OiiOHaatDCDataContext msDC = DatabaseHelper.GetDataModelDataContext(); DivisionOrState divisionOrStateNew = msDC.DivisionOrStates.Single(d => d.IID == divisionOrState.IID); DatabaseHelper.Update <DivisionOrState>(msDC, divisionOrState, divisionOrStateNew); msDC.Dispose(); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
//public List<District> GetDistrictByName(string name) //{ // try // { // OiiOHaatDCDataContext dbContext = DatabaseHelper.GetDataModelDataContext(); // List<District> districtList = new List<District>(); // districtList = dbContext.Districts.Where(d => d.IsRemoved == false && d.Name.Contains(name)).ToList(); // dbContext.Dispose(); // return districtList; // } // catch (Exception ex) { throw new Exception(ex.Message, ex); } //} public List <District> GetAllDistrict() { try { OiiOHaatDCDataContext dbContext = DatabaseHelper.GetDataModelDataContext(); List <District> districtList = new List <District>(); districtList = dbContext.Districts.ToList(); dbContext.Dispose(); return(districtList); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
public List <UserWFPermission> GetUserPermissionByGropIDAndUrlID(Int32 userGroupID, Int32 urlListID) { try { OiiOHaatDCDataContext dbContext = DatabaseHelper.GetDataModelDataContext(); List <UserWFPermission> userWFPermission = new List <UserWFPermission>(); userWFPermission = dbContext.UserWFPermissions.Where(d => d.UserGroupID == userGroupID && d.UrlWFListID == urlListID).ToList(); dbContext.Dispose(); return(userWFPermission); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
public AdGiverTracing GetAddGiverTracingIID(int AddGiverTracingID) { try { OiiOHaatDCDataContext dbContext = DatabaseHelper.GetDataModelDataContext(); AdGiverTracing adGivertracing = new AdGiverTracing(); adGivertracing = dbContext.AdGiverTracings.Single(d => d.IID == AddGiverTracingID); dbContext.Dispose(); return(adGivertracing); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
public UserWFPermission GetUserPermissionByID(Int32 userPermissionID) { try { UserWFPermission userPermission = new UserWFPermission(); OiiOHaatDCDataContext DbContext = DatabaseHelper.GetDataModelDataContext(); userPermission = DbContext.UserWFPermissions.Single(d => d.IID == userPermissionID); DbContext.Dispose(); return(userPermission); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
public Brand GetBrandByID(long brandID) { try { OiiOHaatDCDataContext dbContext = DatabaseHelper.GetDataModelDataContext(); Brand brand = new Brand(); brand = dbContext.Brands.Single(d => d.IID == brandID && d.IsRemoved == false); dbContext.Dispose(); return(brand); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
public MyFavourite GetEmailIDnMaterialID(string userEmailId, int MaterialID) { try { OiiOHaatDCDataContext dbContext = DatabaseHelper.GetDataModelDataContext(); var ID = dbContext.MyFavourites.SingleOrDefault(ag => ag.UserLoginID == userEmailId && ag.MaterialID == MaterialID); dbContext.Dispose(); return(ID); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
public List <UserWFPermission> checkUrlListByID(int p) { OiiOHaatDCDataContext dbContext = DatabaseHelper.GetDataModelDataContext(); List <UserWFPermission> checkUrl = new List <UserWFPermission>(); checkUrl = dbContext.UserWFPermissions.Where(d => d.UrlWFListID == p).ToList(); dbContext.Dispose(); return(checkUrl); }
public void UpdatePostOffice(PostOffice postOffice) { try { OiiOHaatDCDataContext msDC = DatabaseHelper.GetDataModelDataContext(); PostOffice postOff = msDC.PostOffices.Single(d => d.IID == postOffice.IID); DatabaseHelper.Update <PostOffice>(msDC, postOffice, postOff); msDC.Dispose(); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
public MappingTable GetMappingByIID(int mappingID) { try { OiiOHaatDCDataContext dbContext = DatabaseHelper.GetDataModelDataContext(); MappingTable mappingTable = new MappingTable(); mappingTable = dbContext.MappingTables.Single(d => d.IID == mappingID && d.IsRemoved == false); dbContext.Dispose(); return(mappingTable); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
public Country GetCountryByIID(int countryID) { try { OiiOHaatDCDataContext dbContext = DatabaseHelper.GetDataModelDataContext(); Country country = new Country(); country = dbContext.Countries.Single(d => d.IID == countryID); dbContext.Dispose(); return(country); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
public MappingCategory GetMappingCategoryByID(int mappingCategoryID) { try { OiiOHaatDCDataContext dbContext = DatabaseHelper.GetDataModelDataContext(); MappingCategory mappingCategory = new MappingCategory(); mappingCategory = dbContext.MappingCategories.FirstOrDefault(d => d.CategoryID == mappingCategoryID && d.IsRemoved == false); //dbContext.Dispose(); return(mappingCategory); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
public List <Country> GetCountryAll() { try { OiiOHaatDCDataContext dbContext = DatabaseHelper.GetDataModelDataContext(); List <Country> countryList = new List <Country>(); countryList = dbContext.Countries.ToList(); dbContext.Dispose(); return(countryList); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
public List <MappingTable> GetAllMappingTableForListView() { try { OiiOHaatDCDataContext dbContext = DatabaseHelper.GetDataModelDataContext(); List <MappingTable> mappingTables = dbContext.MappingTables.Where(C => C.IsRemoved == false).ToList(); //dbContext.Dispose(); return(mappingTables); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
public List <Country> GetAllCountryForListView() { try { OiiOHaatDCDataContext dbContext = DatabaseHelper.GetDataModelDataContext(); List <Country> Countries = dbContext.Countries.ToList(); //dbContext.Dispose(); return(Countries); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }