public static bool InsertOpeningDeals(SBP_BlotterOpening OpeningDealsItem) { bool status; try { DbContextB.SBP_BlotterOpening.Add(OpeningDealsItem); DbContextB.SaveChanges(); status = true; } catch (Exception ex) { System.Console.WriteLine(ex.Message.ToString()); status = false; } return(status); }
public static bool DeleteOpeningDeals(int id) { bool status; try { SBP_BlotterOpening prodItem = DbContextB.SBP_BlotterOpening.Where(p => p.SNo == id).FirstOrDefault(); if (prodItem != null) { DbContextB.SBP_BlotterOpening.Remove(prodItem); DbContextB.SaveChanges(); } status = true; } catch (Exception) { status = false; } return(status); }
public static bool UpdateOpeningDeals(SBP_BlotterOpening OpeningDealsItem) { bool status; try { SBP_BlotterOpening prodItem = DbContextB.SBP_BlotterOpening.Where(p => p.SNo == OpeningDealsItem.SNo).FirstOrDefault(); if (prodItem != null) { prodItem.CurrentDate = OpeningDealsItem.CurrentDate; prodItem.TodayAmount = OpeningDealsItem.TodayAmount; DbContextB.SaveChanges(); } status = true; } catch (Exception) { status = false; } return(status); }