public ActionResult GetProductsByCategory(int categoryId) { CakesPosRepository cpr = new CakesPosRepository(_connectionString); IEnumerable <Product> products = cpr.GetProductsByCategory(categoryId); return(Json(products, JsonRequestBehavior.AllowGet)); }
public ActionResult DeletePayments(int orderId) { CakesPosRepository cpr = new CakesPosRepository(_connectionString); cpr.DeletePaymentsById(orderId); return(null); }
public ActionResult AddCategory(string categoryName) { CakesPosRepository cpr = new CakesPosRepository(_connectionString); cpr.AddCategory(categoryName); return(RedirectToAction("Admin")); }
public ActionResult HistorySearch(string search, string opt, DateTime date, bool all) { CakesPosRepository cpr = new CakesPosRepository(_connectionString); IEnumerable <OrderHistoryViewModel> ordersHistory = cpr.SearchOrders(search, opt, date, all); return(Json(ordersHistory, JsonRequestBehavior.AllowGet)); }
public ActionResult MakePayment(int customerId, int orderId, decimal amount, string note, string paymentMethod) { CakesPosRepository cpr = new CakesPosRepository(_connectionString); cpr.MakePayment(customerId, orderId, amount, note, paymentMethod); return(null); }
public ActionResult OpenOrder(int orderId) { CakesPosRepository cpr = new CakesPosRepository(_connectionString); cpr.openOrder(orderId); return(null); }
public ActionResult SaveEmail(int customerId, string email) { CakesPosRepository cpr = new CakesPosRepository(_connectionString); cpr.SaveEmail(customerId, email); return(null); }
public ActionResult DeductFromAccount(int customerId, int orderId, decimal amount) { CakesPosRepository cpr = new CakesPosRepository(_connectionString); cpr.MakeAccountTrans(customerId, -amount, "Order #" + orderId + " Withdrawal"); return(null); }
public ActionResult MakeAccountTrans(int customerId, decimal amount, string note) { CakesPosRepository cpr = new CakesPosRepository(_connectionString); cpr.MakeAccountTrans(customerId, amount, note); return(null); }
public ActionResult AddStatementPayment(int customerId, int statementId, decimal amount, string paymentNote) { CakesPosRepository cpr = new CakesPosRepository(_connectionString); cpr.AddStatementPayment(customerId, statementId, amount, paymentNote); return(null); }
public ActionResult EditProduct(int?productId, int?categoryId, string productName, decimal?price, decimal?catererDiscount, int?restockAmount, HttpPostedFileBase image, bool?discontinued) { Product p = new Product(); p.ProductName = productName; p.Price = (decimal)price; p.CatererDiscount = (decimal)catererDiscount; p.RestockAmount = restockAmount; p.CategoryId = (int)categoryId; if (image != null) { Guid g = Guid.NewGuid(); image.SaveAs(Server.MapPath("~/Uploads/" + g + ".jpg")); p.Image = g + ".jpg"; } else { p.Image = ""; } p.Discontinued = discontinued; CakesPosRepository cpr = new CakesPosRepository(_connectionString); cpr.EditProduct(p, (int)productId); return(RedirectToAction("Inventory")); }
public ActionResult Search(string search) { CakesPosRepository cpr = new CakesPosRepository(_connectionString); IEnumerable <Customer> customers = cpr.SearchCustomers(search); return(Json(customers, JsonRequestBehavior.AllowGet)); }
public ActionResult GetOpenStatements() { CakesPosRepository cpr = new CakesPosRepository(_connectionString); IEnumerable <StatementsModel> statements = cpr.GetAllOpenStatements(); return(Json(statements, JsonRequestBehavior.AllowGet)); }
public ActionResult AddOrderDetails(int orderId, int productId, decimal unitPrice, int quantity) { CakesPosRepository cpr = new CakesPosRepository(_connectionString); cpr.AddOrderDetails(orderId, productId, unitPrice, quantity); return(null); }
public ActionResult GetCustomerById(int id) { CakesPosRepository cpr = new CakesPosRepository(_connectionString); Customer customer = cpr.GetCustomerById(id); return(Json(customer, JsonRequestBehavior.AllowGet)); }
public ActionResult EditCustomer(int customerId, string firstName, string lastName, string address, string city, string state, string zip, string phone1, string phone2, string cell1, string cell2, bool caterer, string email) { CakesPosRepository cpr = new CakesPosRepository(_connectionString); cpr.EditCustomer(customerId, firstName, lastName, address, city, state, zip, phone1, phone2, cell1, cell2, caterer, email); return(null); }
public ActionResult UpdateInventory(int id, int amount) { CakesPosRepository cpr = new CakesPosRepository(_connectionString); cpr.UpdateInventory(id, amount); return(null); }
public ActionResult GetTotalByOrderId(int id, int customerId) { CakesPosRepository cpr = new CakesPosRepository(_connectionString); decimal total = cpr.GetTotalByOrderId(id, customerId); return(Json(total, JsonRequestBehavior.AllowGet)); }
public ActionResult GetOrderHistory(int orderId, int customerId) { CakesPosRepository cpr = new CakesPosRepository(_connectionString); OrderDetailsViewModel orderHistory = cpr.GetOrderDetails(orderId, customerId); return(Json(orderHistory, JsonRequestBehavior.AllowGet)); }
public ActionResult StatementDeductFromAccount(int customerId, int statementId, decimal amount, string note) { CakesPosRepository cpr = new CakesPosRepository(_connectionString); cpr.sDeductFromAccount(customerId, statementId, amount, note); return(null); }
public ActionResult UpdateInvoicesPaid(int statementId) { CakesPosRepository cpr = new CakesPosRepository(_connectionString); cpr.UpdateInvoicesPaid(statementId); return(null); }
public ActionResult UpdateStatus(int orderId, string status) { CakesPosRepository cpr = new CakesPosRepository(_connectionString); cpr.AddStatus(orderId, status); return(null); }
public ActionResult AddOrder(int customerId, DateTime requiredDate, string deliveryOpt, string deliveryFirstName, string deliveryLastName, string deliveryAddress, string deliveryCity, string deliveryState, string deliveryZip, string phone1, string phone2, string cell1, string cell2, string creditCard, string expiration, string securityCode, string paymentMethod, decimal discount, string notes, string greetings, string deliveryNote, bool paid, decimal deliveryCharge) { DateTime dateTime = DateTime.Now; CakesPosRepository cpr = new CakesPosRepository(_connectionString); int orderId = cpr.AddOrder(customerId, dateTime, requiredDate, deliveryOpt, deliveryFirstName, deliveryLastName, deliveryAddress, deliveryCity, deliveryState, deliveryZip, phone1, phone2, cell1, cell2, creditCard, expiration, securityCode, paymentMethod, discount, notes, greetings, deliveryNote, paid, deliveryCharge); return(Json(orderId)); }
public ActionResult OrderHistory() { CakesPosRepository cpr = new CakesPosRepository(_connectionString); //IEnumerable<OrderHistoryViewModel> orders = cpr.GetOrders(); IEnumerable <OrderHistoryViewModel> orders = cpr.SearchOrders("", "open", DateTime.Today.Date, false); return(View(orders)); }
public ActionResult GetProductAvailabilityByProductId(int productId) { DateTime min = DateTime.Today.Date.AddMonths(-1); DateTime max = DateTime.Today.Date.AddDays(7); CakesPosRepository cpr = new CakesPosRepository(_connectionString); return(Json(cpr.GetProductAvailabilityByProductId(min, max, productId), JsonRequestBehavior.AllowGet)); }
public ActionResult Statements(DateTime min, DateTime max) { CakesPosRepository cpr = new CakesPosRepository(_connectionString); IEnumerable <OrderHistoryViewModel> orders = cpr.GetCatererOrdersByDate(min, max); orders = orders.OrderBy(o => o.lastName); return(Json(orders, JsonRequestBehavior.AllowGet)); }
public ActionResult EmailInvoice(int customerId, int orderId) { CakesPosRepository cpr = new CakesPosRepository(_connectionString); InvoiceManager i = new InvoiceManager(); Customer c = cpr.GetCustomerById(customerId); i.EmailInvoice(@"C:\inetpub\sites\CakesPos\InvoicesPdf\" + orderId + ".pdf", c.Email); return(null); }
public ActionResult CreateInvoice(int customerId, int orderId) { CakesPosRepository cpr = new CakesPosRepository(_connectionString); OrderDetailsViewModel o = cpr.GetOrderDetails(customerId, orderId); InvoiceManager i = new InvoiceManager(); i.CreateInvoicePDF(o); return(null); }
public ActionResult CreateInvoiceOtherEmail(int customerId, int orderId, string email) { CakesPosRepository cpr = new CakesPosRepository(_connectionString); OrderDetailsViewModel o = cpr.GetOrderDetails(customerId, orderId); InvoiceManager i = new InvoiceManager(); i.CreateInvoicePDF(o); i.EmailInvoice(@"C:\inetpub\sites\CakesPos\InvoicesPdf\" + orderId + ".pdf", email); return(null); }
public ActionResult Statements() { //DateTime min = DateTime.Now.AddMonths(-1).Date; //DateTime max = DateTime.Now.Date; CakesPosRepository cpr = new CakesPosRepository(_connectionString); IEnumerable <OrderHistoryViewModel> orders = cpr.GetCatererOrdersForStatements(); orders = orders.OrderBy(o => o.lastName); return(View(orders)); }