public static bool InsertSetUp(SBP_BlotterSetup SetupItem) { bool status; try { DbContextB.SBP_BlotterSetup.Add(SetupItem); DbContextB.SaveChanges(); status = true; } catch (Exception) { status = false; } return(status); }
public static bool DeleteSetUp(int id) { bool status; try { SBP_BlotterSetup setupItem = DbContextB.SBP_BlotterSetup.Where(p => p.SNo == id).FirstOrDefault(); if (setupItem != null) { DbContextB.SBP_BlotterSetup.Remove(setupItem); DbContextB.SaveChanges(); } status = true; } catch (Exception) { status = false; } return(status); }
public static bool UpdateSetUp(SBP_BlotterSetup SetupItem) { bool status; try { SBP_BlotterSetup setupItem = DbContextB.SBP_BlotterSetup.Where(p => p.SNo == SetupItem.SNo).FirstOrDefault(); if (setupItem != null) { setupItem.Description = SetupItem.Description; setupItem.status = SetupItem.status; DbContextB.SaveChanges(); } status = true; } catch (Exception) { status = false; } return(status); }