public ActionResult ViewBill(int nBillID) { GlobalSession.SessionIsAlive(Session, Response); Bill _oBill = new Bill(); if (nBillID > 0) { _oBill = _oBillService.Get(nBillID, (int)Session[GlobalSession.UserID]); _oBillDetails = _oBillDetailService.GetsByBillID(_oBill.BillID, (int)Session[GlobalSession.UserID]); } else { Random random = new Random(); _oBill.BillNo = random.Next(1, 99).ToString() + DateTime.Now.Month + DateTime.Now.Day + DateTime.Now.Hour + DateTime.Now.Minute + DateTime.Now.Second; } ViewBag.BillDetails = _oBillDetails; List <Store> oStores = new List <Store>(); StoreService oStoreService = new StoreService(); oStores = oStoreService.Gets(1, (int)Session[GlobalSession.UserID]); List <StoreProduct> oStoreProducts = new List <StoreProduct>(); ViewBag.Stores = oStores; ViewBag.StoreProducts = oStoreProducts; return(View(_oBill)); }
public ActionResult ViewCustomers(int nBUID, int nUserID) { GlobalSession.SessionIsAlive(Session, Response); _oContractors = _oContractorService.GetsByContractorType(EnumContractorType.Customer, (int)Session[GlobalSession.UserID]); ViewBag.BUID = nBUID; return(View(_oContractors)); }
public ActionResult ViewSellProductQty(int nStoreID, int nStoreProductID) { GlobalSession.SessionIsAlive(Session, Response); _oStoreProduct = new StoreProduct(); _oStoreProduct.StoreID = nStoreID; if (nStoreProductID > 0) { _oStoreProduct = _oStoreProductService.Get(nStoreID, nStoreProductID, (int)Session[GlobalSession.UserID]); } ContractorService oContractorService = new ContractorService(); List <Contractor> oContractors = new List <Contractor>(); oContractors = oContractorService.GetsByContractorType(EnumContractorType.Supplier, (int)Session[GlobalSession.UserID]); List <ProductCategory> oProductCategorys = new List <ProductCategory>(); ProductCategoryService oProductCategoryService = new ProductCategoryService(); oProductCategorys = oProductCategoryService.Gets(1, (int)Session[GlobalSession.UserID]); List <Product> oProducts = new List <Product>(); ProductService oProductService = new ProductService(); oProducts = oProductService.Gets(1, (int)Session[GlobalSession.UserID]); ViewBag.ProductTypes = _oProductTypeService.Gets(1, (int)Session[GlobalSession.UserID]); ViewBag.Contractors = oContractors; ViewBag.Products = oProducts; ViewBag.ProductCategorys = oProductCategorys; return(View(_oStoreProduct)); }
public ActionResult ViewStoreProducts(int nBUID, int nUserID) { GlobalSession.SessionIsAlive(Session, Response); _oStores = _oStoreService.Gets(nBUID, (int)Session[GlobalSession.UserID]); _oStoreProducts = _oStoreProductService.Gets(nBUID, (int)Session[GlobalSession.UserID]); ViewBag.BUID = nBUID; return(View(_oStores)); }
public ActionResult ViewStoreProductHistorys(int nBUID, int nUserID) { GlobalSession.SessionIsAlive(Session, Response); nUserID = Convert.ToInt32(Session["UserID"].ToString()); _oStoreProductHistorys = _oStoreProductHistoryService.Gets("SELECT TOP(200)* FROM View_StoreProductHistory ORDER BY DBServerDateTime DESC", (int)Session[GlobalSession.UserID]); ViewBag.Stores = _oStoreService.Gets(1, (int)Session[GlobalSession.UserID]); ViewBag.BUID = nBUID; return(View(_oStoreProductHistorys)); }
public ActionResult ViewStore(int nStoreID) { GlobalSession.SessionIsAlive(Session, Response); Store _oStore = new Store(); if (nStoreID > 0) { _oStore = _oStoreService.Get(nStoreID, (int)Session[GlobalSession.UserID]); } return(View(_oStore)); }
public ActionResult ViewProductCategory(int nProductCategoryID) { GlobalSession.SessionIsAlive(Session, Response); ProductCategory _oProductCategory = new ProductCategory(); if (nProductCategoryID > 0) { _oProductCategory = _oProductCategoryService.Get(nProductCategoryID, (int)Session[GlobalSession.UserID]); } ViewBag.ProductTypes = _oProductTypeService.Gets(1, (int)Session[GlobalSession.UserID]); return(View(_oProductCategory)); }
public ActionResult ViewCustomer(int nContractorID) { GlobalSession.SessionIsAlive(Session, Response); Contractor _oContractor = new Contractor(); if (nContractorID > 0) { _oContractor = _oContractorService.Get(nContractorID, (int)Session[GlobalSession.UserID]); } ViewBag.ContractorTypes = Enum.GetValues(typeof(EnumContractorType)).Cast <EnumContractorType>().Select(e => new EnumClass { Id = ((int)e), Name = e.ToString() }); return(View(_oContractor)); }
public JsonResult Delete(ProductCategory oProductCategory) { GlobalSession.SessionIsAlive(Session, Response); ProductCategory _oProductCategory = new ProductCategory(); if (oProductCategory.ProductCategoryID > 0) { _oProductCategory = _oProductCategoryService.IUD(oProductCategory, EnumDBOperation.Delete, (int)Session[GlobalSession.UserID]); } JavaScriptSerializer serializer = new JavaScriptSerializer(); string sjson = serializer.Serialize(_oProductCategory); return(Json(sjson, JsonRequestBehavior.AllowGet)); }
public JsonResult Delete(ProductType oProductType) { GlobalSession.SessionIsAlive(Session, Response); ProductType _oProductType = new ProductType(); if (oProductType.ProductTypeID > 0) { _oProductType.ErrorMessage = _oProductTypeService.Delete(oProductType, (int)Session[GlobalSession.UserID]); } JavaScriptSerializer serializer = new JavaScriptSerializer(); string sjson = serializer.Serialize(_oProductType); return(Json(sjson, JsonRequestBehavior.AllowGet)); }
public ActionResult Save(ProductType oProductType) { GlobalSession.SessionIsAlive(Session, Response); if (oProductType.ProductTypeID <= 0) { _oProductType = _oProductTypeService.IUD(oProductType, EnumDBOperation.Insert, (int)Session[GlobalSession.UserID]); } else { _oProductType = _oProductTypeService.IUD(oProductType, EnumDBOperation.Update, (int)Session[GlobalSession.UserID]); } JavaScriptSerializer serializer = new JavaScriptSerializer(); string sjson = serializer.Serialize(_oProductType); return(Json(sjson, JsonRequestBehavior.AllowGet)); }
public ActionResult ViewStoreProduct(int nStoreID) { GlobalSession.SessionIsAlive(Session, Response); _oStoreProduct = new StoreProduct(); ContractorService oContractorService = new ContractorService(); List <Contractor> oContractors = new List <Contractor>(); oContractors = oContractorService.GetsByContractorType(EnumContractorType.Supplier, (int)Session[GlobalSession.UserID]); if (nStoreID > 0) { _oStore = _oStoreService.Get(nStoreID, (int)Session[GlobalSession.UserID]); _oStoreProducts = _oStoreProductService.GetsByStoreID(_oStore.StoreID, (int)Session[GlobalSession.UserID]); } ViewBag.ProductTypes = _oProductTypeService.Gets(1, (int)Session[GlobalSession.UserID]); ViewBag.StoreProducts = _oStoreProducts; ViewBag.Contractors = oContractors; return(View(_oStore)); }
public ActionResult ViewDueBill(int nBillID) { GlobalSession.SessionIsAlive(Session, Response); Bill _oBill = new Bill(); if (nBillID > 0) { _oBill = _oBillService.Get(nBillID, (int)Session[GlobalSession.UserID]); if (_oBill.BillID_Ref <= 0) { _oBill.BillNo_Ref = _oBill.BillNo; _oBill.YetToPay = (_oBill.AmountToPaid - _oBill.TotalPaidAmount); _oBill.DueAmount = 0; _oBill.PaidTotal = 0; _oBillDetails = _oBillDetailService.GetsByBillID(_oBill.BillID, (int)Session[GlobalSession.UserID]); } else { _oBillDetails = _oBillDetailService.GetsByBillID(_oBill.BillID_Ref, (int)Session[GlobalSession.UserID]); } } else { throw new Exception("Exception: Invalid Due Bill."); } ViewBag.BillDetails = _oBillDetails; List <Store> oStores = new List <Store>(); StoreService oStoreService = new StoreService(); oStores = oStoreService.Gets(1, (int)Session[GlobalSession.UserID]); List <StoreProduct> oStoreProducts = new List <StoreProduct>(); ViewBag.Stores = oStores; ViewBag.StoreProducts = oStoreProducts; return(View(_oBill)); }
public ActionResult ViewProductCategorys(int nBUID, int menuid) { GlobalSession.SessionIsAlive(Session, Response); _oProductCategorys = _oProductCategoryService.Gets(nBUID, (int)Session[GlobalSession.UserID]); return(View(_oProductCategorys)); }
public ActionResult Index() { GlobalSession.SessionIsAlive(Session, Response); return(View(_oUser)); }