Example #1
0
        public ActionResult Create(Orders obj)
        {
            OrdersDAO odao = new OrdersDAO();

            odao.insert(obj);
            return(RedirectToAction("Index"));
        }
Example #2
0
        public ActionResult Edit(Orders obj)
        {
            OrdersDAO odao = new OrdersDAO();

            odao.update(obj);
            return(RedirectToAction("Index"));
        }
        public OrderController()
        {
            connectionString = ConfigurationManager.ConnectionStrings["connString"].ConnectionString;
            string filePath = ConfigurationManager.AppSettings["logPath"];

            dataAccess = new OrdersDAO(connectionString, filePath);
        }
Example #4
0
        public ActionResult Delete(Orders obj)
        {
            OrdersDAO odao = new OrdersDAO();

            odao.delete(obj);
            return(RedirectToAction("Index"));
        }
Example #5
0
        public ActionResult Complite(int id)
        {
            OrdersDAO odao = new OrdersDAO();
            Orders    ord  = odao.Single(x => x.Id_ord == id);

            ord.Status = new StatusDAO().Single(x => x._name == "Выполнен").Id;
            StorageDAO stoDao = new StorageDAO();
            Storage    add    = stoDao.Single(x => x.FK_mat == ord.FK_Mat1);

            if (add == null)
            {
                add = new Storage()
                {
                    FK_mat = ord.FK_Mat1,
                    Number = ord.Number
                };
                stoDao.insert(add);
            }
            else
            {
                add.Number += ord.Number;
                stoDao.update(add);
            }
            odao.update(ord);
            return(RedirectToAction("Index"));
        }
Example #6
0
        public DatabaseFacade()
        {
            PatientsDAO = new PatientsDAO();

            DictionaryDAO = new DictionaryDAO();

            EmployeesDAO = new EmployeesDAO();

            UserDAO = new UserDAO();

            OrderDAO = new OrdersDAO();

            ProfilesDAO = new ProfilesDAO();

            StudiesDAO = new StudiesDAO();

            SamplesDAO = new SamplesDAO();

            TestsDAO = new TestsDAO();

            VerificationsDAO = new VerificationsDAO();

            ResultsDAO = new ResultsDAO();

            ResultUnitsDAO = new ResultUnitsDAO();

            SessionsDAO = new SessionsDAO();
        }
Example #7
0
        public ActionResult _orders(Busqueda busqueda)
        {
            string selectedDB             = "sucursal" + Session["defaultDB"];
            ResponseList <Order> response = new OrdersDAO().getOrders(selectedDB, busqueda);

            ViewBag.orders = response.model;
            return(PartialView());
        }
Example #8
0
        public ActionResult Delete(int id)
        {
            OrdersDAO odao = new OrdersDAO();
            Orders    ord  = odao.Select(id);

            odao.delete(ord);
            return(RedirectToAction("Index"));
        }
Example #9
0
 //constructor
 public OrdersController()
 {
     errorLogPath        = ConfigurationManager.AppSettings["errorLogPath"];
     connectionString    = ConfigurationManager.ConnectionStrings["dataSource"].ConnectionString;
     _OrdersDAO          = new OrdersDAO(connectionString, errorLogPath);
     _ItemsDAO           = new ItemsDAO(connectionString, errorLogPath);
     Logger.errorLogPath = errorLogPath;
 }
Example #10
0
        //Create our connection string
        public OrderController()
        {
            string connectionString = ConfigurationManager.ConnectionStrings["DataSource"].ConnectionString;

            ordersDAO = new OrdersDAO(connectionString);
            userDao   = new UserDAO(connectionString);
            pcDAO     = new PcDAO(connectionString);
        }
Example #11
0
        public ActionResult _detalleOrders(String idOrden)
        {
            string selectedDB = "sucursal" + Session["defaultDB"];
            ResponseList <DetalleOrder> response = new OrdersDAO().getDetalleOrder(selectedDB, idOrden);

            ViewBag.detalleOrders = response.model;
            return(PartialView());
        }
Example #12
0
        // GET: Orders

        public ActionResult Index()
        {
            ViewBag.username = Session["username"];
            string selectedDB = "sucursal" + Session["defaultDB"];
            ResponseList <CatStatusOrden> responseCat = new OrdersDAO().getCatStatusOrden(selectedDB);

            ViewBag.catStatusOrden = responseCat.model;
            return(View());
        }
Example #13
0
        private void addOrderButton_Click(object sender, RoutedEventArgs e)
        {
            var addOrderScreen = new AddOrderScreen();

            if (addOrderScreen.ShowDialog() == true)
            {
                var newOrder = addOrderScreen.NewOrder;
                OrdersDAO.InsertOrder(newOrder);
                DisplayOrders();
            }
        }
Example #14
0
 public Order(int idorder, int idcustomer, int iduser, DateTime datetime, int paymentmethod, float total, float prepaid, int deleted)
 {
     this.dao           = OrdersDAO.getInstance();
     this.orderproducts = new List <OrderProduct>();
     this.Idorder       = idorder;
     this.Idcustomer    = idcustomer;
     this.Iduser        = iduser;
     this.Datetime      = datetime;
     this.Paymentmethod = paymentmethod;
     this.Total         = total;
     this.Prepaid       = prepaid;
     this.Deleted       = deleted;
 }
Example #15
0
 public ActionResult EditarGuia(string guia, string orden)
 {
     try
     {
         ordersDAO = new OrdersDAO();
         string selectedDB = "sucursal" + Session["defaultDB"];
         return(Json(ordersDAO.EditarGuia(selectedDB, guia, orden), JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Example #16
0
 public ActionResult EditarStatus(int idUsuarioOrdenCompra, int idStatusOrdenCompra, string guia)
 {
     try
     {
         ordersDAO = new OrdersDAO();
         string selectedDB = "sucursal" + Session["defaultDB"];
         return(Json(ordersDAO.updateStatusOrders(selectedDB, idUsuarioOrdenCompra, idStatusOrdenCompra, guia), JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        public void loadData()
        {
            OrdersDAO dao = new OrdersDAO();

            List <Orders> list = new List <Orders>();

            try
            {
                list = dao.GetAllOrders(frmLogin.AuthorizedUser.Username);
            }
            catch (Exception)
            {
                throw;
            }

            tblOrderHistory.DataSource = list;
        }
Example #18
0
        void DisplayOrders()
        {
            fetchedOrders = OrdersDAO.GetOrders();
            ordersListView.ItemsSource = fetchedOrders;

            if (fetchedOrders.Count != 0)
            {
                orderToShow = fetchedOrders[0];
            }
            else
            {
                orderToShow = new Order()
                {
                    Name = "mac dinh",
                };
            }

            DisplayOrderToShow();
        }
Example #19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (HttpContext.Current.Session == null || HttpContext.Current.Session["admin"] == null)
            {
                Response.Redirect("~/LoginP.aspx");
            }

            Page.Header.Title = "Fast food - Orders";


            if (IsPostBack == false)
            {
                SearchTextBox.Text      = "";
                this.order_state        = OrderStates.order_to_deliver;
                OrdersStateTextBox.Text = this.order_state;
                l1 = OrdersDAO.GetORDERsByState(this.order_state);
                OrdersListView.DataSource = l1;
                OrdersListView.DataBind();
            }
        }
Example #20
0
        private void btnCheckOut_Click(object sender, EventArgs e)
        {
            Dictionary <Toy, int> OrderCart = frmDisplayToy.OrderCart;

            OrdersDAO dao = new OrdersDAO();

            try
            {
                bool result = dao.CreateOrder(frmLogin.AuthorizedUser.Username, OrderCart);

                if (result)
                {
                    MessageBox.Show("Order Complete!");
                    this.Close();
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Example #21
0
        private void GetAndBindOrders(string order_state)
        {
            if (!string.IsNullOrEmpty(SearchTextBox.Text.Trim()))
            {
                this.search = SearchTextBox.Text.Trim();
            }

            if (DateCheckBox.Checked && !string.IsNullOrEmpty(DateTextBox.Text.Trim()))
            {
                if (string.IsNullOrEmpty(this.search))
                {
                    l1 = OrdersDAO.GetORDERsByStateAndDate(order_state, DateTextBox.Text.Trim());
                    OrdersListView.DataSource = l1;
                    OrdersListView.DataBind();
                }
                else
                {
                    l1 = OrdersDAO.GetORDERsByStateAndSearchAndDate(order_state, this.search.Trim(), DateTextBox.Text.Trim());
                    OrdersListView.DataSource = l1;
                    OrdersListView.DataBind();
                }
            }
            else
            {
                if (string.IsNullOrEmpty(this.search))
                {
                    l1 = OrdersDAO.GetORDERsByState(order_state);
                    OrdersListView.DataSource = l1;
                    OrdersListView.DataBind();
                }
                else
                {
                    l1 = OrdersDAO.GetORDERsByStateAndSearch(order_state, this.search.Trim());
                    OrdersListView.DataSource = l1;
                    OrdersListView.DataBind();
                }
            }
        }
Example #22
0
 public OrdersController(OrdersDAO ordersDao)
 {
     _ordersDao = ordersDao;
 }
Example #23
0
 public Order()
 {
     this.dao           = OrdersDAO.getInstance();
     this.orderproducts = new List <OrderProduct>();
 }
Example #24
0
 public OrdersController(OrdersDAO ordersDao, IAmACommandProcessor commandProcessor)
 {
     _ordersDao        = ordersDao;
     _commandProcessor = commandProcessor;
 }
Example #25
0
        //Create our connection string
        public HomeController()
        {
            string connectionString = ConfigurationManager.ConnectionStrings["DataSource"].ConnectionString;

            ordersDAO = new OrdersDAO(connectionString);
        }
Example #26
0
        public ActionResult Edit(int id)
        {
            OrdersDAO odao = new OrdersDAO();

            return(View(odao.Select(id)));
        }
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     orders = OrdersDAO.GetOrders();
     DisplayRevenueByCategory();
     DisplayRevenueByMonth();
 }
Example #28
0
        public ActionResult Index()
        {
            OrdersDAO odao = new OrdersDAO();

            return(View(odao.Select()));
        }
Example #29
0
 public OrderController()
 {
     _ordersDAO = new OrdersDAO();
 }
Example #30
0
 public OrderController()
 {
     //_customersDAO = new CustomersDAO();
     _ordersDAO = new OrdersDAO();
 }