public static bool UpdateDTLDeals(SBP_BlotterDTL DTLDealsItem) { bool status; try { SBP_BlotterDTL prodItem = DbContextB.SBP_BlotterDTL.Where(p => p.SNo == DTLDealsItem.SNo).FirstOrDefault(); if (prodItem != null) { prodItem.DTL_Date = DTLDealsItem.DTL_Date; prodItem.DTL_Code = DTLDealsItem.DTL_Code; prodItem.NO_OF_Days = DTLDealsItem.NO_OF_Days; prodItem.DTL_Amount = DTLDealsItem.DTL_Amount; prodItem.T_User_Id = DTLDealsItem.T_User_Id; prodItem.T_Date = DTLDealsItem.T_Date; prodItem.Flag = DTLDealsItem.Flag; DbContextB.SaveChanges(); } status = true; } catch (Exception) { status = false; } return(status); }
public ActionResult Create() { SBP_BlotterDTL model = new SBP_BlotterDTL(); ViewData["SysCurrentDt"] = GetCurrentDT().ToString("dd-MMM-yyyy"); ViewData["BrCode"] = BrCode; return(View(model)); }
public static bool InsertDTLDeals(SBP_BlotterDTL DTLDealsItem) { bool status; try { DbContextB.SBP_BlotterDTL.Add(DTLDealsItem); DbContextB.SaveChanges(); status = true; } catch (Exception ex) { System.Console.WriteLine(ex.Message.ToString()); status = false; } return(status); }
public static bool DeleteDTLDeals(int id) { bool status; try { SBP_BlotterDTL prodItem = DbContextB.SBP_BlotterDTL.Where(p => p.SNo == id).FirstOrDefault(); if (prodItem != null) { DbContextB.SBP_BlotterDTL.Remove(prodItem); DbContextB.SaveChanges(); } status = true; } catch (Exception) { status = false; } return(status); }