Example #1
0
        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);
        }
Example #2
0
        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);
        }
Example #3
0
        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);
        }