public bool IsSalesOperationSuccess(SalesOperationInformationVM itemVm) { SalesOperationInformation item = new SalesOperationInformation() { SalesNo = itemVm.SalesNo, BranchId = itemVm.BranchId, EmployeeId = itemVm.EmployeeId, SalesDate = itemVm.SalesDate, CustomerName = itemVm.CustomerName, CustomerContact = itemVm.CustomerContact, TotalAmount = itemVm.TotalAmount, VAT = itemVm.VAT, DiscountAmount = itemVm.DiscountAmount, PayableAmount = itemVm.PayableAmount, PaidAmount = itemVm.PaidAmount, DueAmount = itemVm.DueAmount, SalesItems = itemVm.SalesItems, Date = itemVm.Date }; dbContext.SalesOperationInformations.Add(item); var isSuccess = dbContext.SaveChanges() > 0; IsStockUpdated(itemVm.SalesItems, itemVm.BranchId); return(isSuccess); }
public bool IsExpenseCategorySaved(ExpenseCategoryVM itemVm) { ExpenseCategory item = new ExpenseCategory() { Name = itemVm.Name, Code = itemVm.Code, Description = itemVm.Description, Date = itemVm.Date, ParentId = itemVm.ParentId }; dbContext.ExpenseCategories.Add(item); var isAdded = dbContext.SaveChanges(); if (isAdded > 0) { return(true); } else { return(false); } return(false); }
public bool IsBranchSaved(BranchVM itemVm) { Branch item = new Branch() { Code = itemVm.Code, Contact = itemVm.Contact, Address = itemVm.Address, OrganizationId = itemVm.OrganizationId, Date = itemVm.Date }; dbContext.Branches.Add(item); var isAdded = dbContext.SaveChanges(); if (isAdded > 0) { return(true); } else { return(false); } return(false); }
public bool IsPartySaved(PartyVM itemVm) { Party item = new Party() { Name = itemVm.Name, PreCode = itemVm.PreCode, Code = itemVm.Code, Contact = itemVm.Contact, Address = itemVm.Address, Email = itemVm.Email, Image = itemVm.Image, Date = itemVm.Date, IsCustomer = itemVm.IsCustomer, IsSupplier = itemVm.IsSupplier }; dbContext.Parties.Add(item); var isAdded = dbContext.SaveChanges(); if (isAdded > 0) { return(true); } else { return(false); } return(false); }
public bool IsOrganizationSaved(OrganizationVM itemVm) { Organization item = new Organization() { Name = itemVm.Name, Code = itemVm.Code, Contact = itemVm.Contact, Address = itemVm.Address, Image = itemVm.Image, Date = itemVm.Date }; dbContext.Organizations.Add(item); var isAdded = dbContext.SaveChanges(); if (isAdded > 0) { return(true); } else { return(false); } return(false); }
public bool IsEmployeeSaved(EmployeeVM itemVm) { Employee item = new Employee() { Name = itemVm.Name, Code = itemVm.Code, BranchId = itemVm.BranchId, JoiningDate = itemVm.JoiningDate, Image = itemVm.Image, Contact = itemVm.Contact, Email = itemVm.Email, ReferenceId = itemVm.ReferenceId, EmergencyContact = itemVm.EmergencyContact, NID = itemVm.NID, FathersName = itemVm.FathersName, MothersName = itemVm.MothersName, PresentAddress = itemVm.PresentAddress, PermanentAddress = itemVm.PermanentAddress, Date = itemVm.Date }; dbContext.Employees.Add(item); var isAdded = dbContext.SaveChanges(); if (isAdded > 0) { return(true); } else { return(false); } return(false); }
public bool IsItemSaved(ItemVM itemVm) { Item item = new Item() { Name = itemVm.Name, PreCode = itemVm.PreCode, Code = itemVm.Code, Description = itemVm.Description, Image = itemVm.Image, Date = itemVm.Date, CategoryId = itemVm.CategoryId, CostPrice = itemVm.CostPrice, SalePrice = itemVm.SalePrice }; dbContext.Items.Add(item); var isAdded = dbContext.SaveChanges(); if (isAdded > 0) { return(true); } else { return(false); } return(false); }
public ActionResult Create([Bind(Include = "ID,Name,Phone2,Address")] Customer customer) { if (ModelState.IsValid) { db.Customers.Add(customer); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(customer)); }
public ActionResult Create([Bind(Include = "ID,Type,Model,Quantity_Available,Quantity_Sold,Unit_Price,Selling_Price,Des,Date_Updated,Unique_Barcode")] Product product) { if (ModelState.IsValid) { db.Products.Add(product); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(product)); }
public ActionResult Create([Bind(Include = "ID,Address_ID,Company_Name,Contact_Name,Contact_Designation,Email")] Supplier supplier) { if (ModelState.IsValid) { db.Suppliers.Add(supplier); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Address_ID = new SelectList(db.Addresses, "ID", "City", supplier.Address_ID); return(View(supplier)); }
public ActionResult Create([Bind(Include = "ID,Name,Username,Password,Last_Login,User_Type,Address_ID,Mobile,Manager_ID")] Login login) { if (ModelState.IsValid) { db.Logins.Add(login); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Address_ID = new SelectList(db.Addresses, "ID", "City", login.Address_ID); ViewBag.Manager_ID = new SelectList(db.Employees, "ID", "Name", login.Manager_ID); return(View(login)); }
public ActionResult Create([Bind(Include = "Barcode_Serial,Product_ID,Color,Date")] Barcode barcode) { if (ModelState.IsValid) { db.Barcodes.Add(barcode); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Product_ID = new SelectList(db.Products, "ID", "Type", barcode.Product_ID); ViewBag.Barcode_Serial = new SelectList(db.Gifts, "Barcode", "SL", barcode.Barcode_Serial); return(View(barcode)); }
public ActionResult Create([Bind(Include = "Invoice_ID,Customer_ID,Journal_ID,Date")] Sale sale) { if (ModelState.IsValid) { db.Sales.Add(sale); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.Customer_ID = new SelectList(db.Customers, "ID", "Name", sale.Customer_ID); ViewBag.Journal_ID = new SelectList(db.Journals, "ID", "ID", sale.Journal_ID); return(View(sale)); }
public bool IsItemCategorySaved(ItemCategoryVM itemVm) { ItemCategory item = new ItemCategory() { Name = itemVm.Name, Code = itemVm.Code, Description = itemVm.Description, Image = itemVm.Image, Date = itemVm.Date, ParentId = itemVm.ParentId }; dbContext.ItemCategories.Add(item); var isAdded = dbContext.SaveChanges() > 0; return(isAdded); }
public static void DBSubmitChanges() { try { db.SaveChanges(); } catch (Exception ex) { throw new Exception(ex.StackTrace); } }
public bool IsPurchaseOperationSuccess(PurchaseOperationInformationVM itemVm) { PurchaseOperationInformation item = new PurchaseOperationInformation() { PurchaseNo = itemVm.PurchaseNo, BranchId = itemVm.BranchId, EmployeeId = itemVm.EmployeeId, SupplierId = itemVm.SupplierId, PurchaseDate = itemVm.PurchaseDate, Remarks = itemVm.Remarks, TotalAmount = itemVm.TotalAmount, PaidAmount = itemVm.PaidAmount, DueAmount = itemVm.DueAmount, PurchaseItems = itemVm.PurchaseItems, Date = itemVm.Date }; dbContext.PurchaseOperationInformations.Add(item); var isSuccess = dbContext.SaveChanges() > 0; IsStockUpdated(itemVm.PurchaseItems, itemVm.BranchId); return(isSuccess); }
public bool IsExpenseOperationSuccess(ExpenseOperationInformationVM itemVm) { ExpenseOperationInformation item = new ExpenseOperationInformation() { ExpenseNo = itemVm.ExpenseNo, BranchId = itemVm.BranchId, EmployeeId = itemVm.EmployeeId, ExpenseDate = itemVm.ExpenseDate, TotalAmount = itemVm.TotalAmount, PaidAmount = itemVm.PaidAmount, DueAmount = itemVm.DueAmount, ExpenseItems = itemVm.ExpenseItems, Date = itemVm.Date }; dbContext.ExpenseOperationInformations.Add(item); var isSuccess = dbContext.SaveChanges() > 0; return(isSuccess); }