Пример #1
0
        public ActionResult Search(ReceiptNoteViewModels model)
        {
            try
            {
                listStoreId = new List <string>();
                List <ReceiptNoteModels> data = new List <ReceiptNoteModels>();
                if (!string.IsNullOrEmpty(model.StoreID))
                {
                    listStoreId.Add(model.StoreID);
                    data = _factory.GetData(model, listStoreId, listCompanyId);
                    data.ForEach(x =>
                    {
                        if (!x.IsPurchaseOrder)
                        {
                            x.SupplierName = "";
                        }
                    });
                }

                model.ListItem      = data;
                CurrentUser.StoreId = model.StoreID;
            }
            catch (Exception e)
            {
                NSLog.Logger.Error("ReceiptNote_Search: ", e);
                return(new HttpStatusCodeResult(400, e.Message));
            }
            return(PartialView("_ListData", model));
        }
Пример #2
0
        public ActionResult Index()
        {
            try
            {
                ReceiptNoteViewModels model = new ReceiptNoteViewModels();
                model.StoreID = CurrentUser.StoreId;

                var ListSupplierInfo = GetListSuppliers(model.StoreID);
                var ListSupplier     = new SelectList(ListSupplierInfo, "Id", "Name");
                model.ListSupplier = ListSupplier.ToList();
                return(View(model));
            }
            catch (Exception ex)
            {
                NSLog.Logger.Error("ReceiptNote_Index Error: ", ex);
                return(new HttpStatusCodeResult(400, ex.Message));
            }
        }