示例#1
0
        public void UpdateOrderRunId(int orderId, int runId)
        {
            Order    o  = GetById(orderId);
            PrintRun pr = orderTable.Context.GetTable <PrintRun>().Single(s => s.runID == runId);

            o.PrintRun = pr;
            orderTable.Context.SubmitChanges();
        }
示例#2
0
        public void UpdatePrintRunStatus(int printRunId, int statusId)
        {
            PrintRun pr        = GetById(printRunId);
            Status   newStatus = printRunTable.Context.GetTable <Status>().Single(s => s.statusId == statusId);

            pr.Status = newStatus;
            printRunTable.Context.SubmitChanges();
        }
示例#3
0
        public void UpdateOrderStatus_PrintRun(int printRundId, int statusID)
        {
            IPrintRunRepository printRepo = RepositoryFactory.Get <IPrintRunRepository>();
            IOrderRepository    orderRepo = RepositoryFactory.Get <IOrderRepository>();


            PrintRun printRun = printRepo.GetById(printRundId);

            var orders = from p
                         in orderRepo.Orders
                         where p.PrintRun.runID == printRundId
                         select p;

            foreach (var cur_Order in orders)
            {
                orderRepo.UpdateOrderStatus(cur_Order.orderID, statusID);
            }
        }
示例#4
0
        private Control getStatusControl(PrintRun pr)
        {
            DropDownList dropListStatus = new DropDownList();

            dropListStatus.ID = pr.runID.ToString();

            IStatusRepository statusRepository = RepositoryFactory.Get <IStatusRepository>();
            var query = statusRepository.Statuses.ToList();

            foreach (int statusID in Enum.GetValues(typeof(PWAS_Site.PrintRunStatus)))
            {
                if (statusID != OrderConstants.ORDER_STATUS_CREATED)
                {
                    ListItem lsItem = new ListItem(statusRepository.GetById(statusID).statusName);
                    dropListStatus.Items.Add(lsItem);

                    if (pr.Status.statusId == statusID)
                    {
                        dropListStatus.SelectedIndex = dropListStatus.Items.IndexOf(lsItem);
                    }

                    if (pr.Status.statusId == OrderConstants.ORDER_STATUS_CLOSED)
                    {
                        dropListStatus.Enabled = false;
                    }
                }
            }

            if (pr.Status.statusId == OrderConstants.ORDER_STATUS_CREATED)
            {
                ListItem lsItem = new ListItem(statusRepository.GetById(pr.Status.statusId).statusName);
                dropListStatus.Items.Add(lsItem);
                dropListStatus.SelectedIndex = dropListStatus.Items.IndexOf(lsItem);
                dropListStatus.Enabled       = false;
            }

            dropListStatus.Width = Unit.Pixel(200);
            dropListStatus.SelectedIndexChanged += new EventHandler(func_selected);
            dropListStatus.AutoPostBack          = true;

            return(dropListStatus);
        }
示例#5
0
        public void createPrintRun(object sender, EventArgs e)
        {
            IPrintRunRepository prRepo = RepositoryFactory.Get <IPrintRunRepository>();
            PrintRun            newRun;

            if (validateFields())
            {
                newRun              = new PrintRun();
                newRun.height       = Int32.Parse(runHeight.Text);
                newRun.width        = Int32.Parse(runWidth.Text);
                newRun.quantity     = Int32.Parse(runQuantity.Text);
                newRun.stock_finish = runFinish.SelectedValue;
                newRun.stock_weight = runWeight.SelectedValue;
                newRun.run_name     = runName.Text;

                prRepo.AddPrintRun(newRun);
                prRepo.SubmitChanges();

                notifyMsg.Text      = "Print Run Created Sucessfully";
                notifyMsg.ForeColor = System.Drawing.Color.Green;
                notifyMsg.Visible   = true;
            }
        }
示例#6
0
        private Control getActionControl(PrintRun pr)
        {
            Button actionbutton = new Button();

            if (Security.IsAuthorized(getUserID(), PWAS_Site.PwasObject.PrintRun, PwasAction.Update, PwasScope.All))
            {
                actionbutton.ID = pr.runID + "update";
                actionbutton.CommandArgument = pr.runID.ToString();
                actionbutton.Text            = "Update";
                actionbutton.Visible         = true;
                actionbutton.Width           = Unit.Pixel(100);
                actionbutton.Command        += new CommandEventHandler(func_update);
            }
            else if (Security.IsAuthorized(getUserID(), PWAS_Site.PwasObject.PrintRun, PwasAction.Update, PwasScope.Self))
            {
                actionbutton.ID      = pr.runID + "update";
                actionbutton.Enabled = false;
            }
            else
            {
                Response.Redirect("index.aspsx");
            }
            return(actionbutton);
        }
示例#7
0
        private Control getViewControl(PrintRun pr)
        {
            ImageButton editButton = new ImageButton();

            if (Security.IsAuthorized(getUserID(), PWAS_Site.PwasObject.PrintRun, PwasAction.View, PwasScope.All))
            {
                editButton.ID = pr.runID + "edit";
                editButton.CommandArgument = pr.runID.ToString();
                editButton.ImageUrl        = "/images/left-list.gif";
                editButton.Visible         = true;
                editButton.Command        += new CommandEventHandler(func_View);
            }
            else if (Security.IsAuthorized(getUserID(), PWAS_Site.PwasObject.PrintRun, PwasAction.View, PwasScope.Self))
            {
                editButton.ID = pr.runID + "edit";
                editButton.CommandArgument = pr.runID.ToString();
                editButton.ImageUrl        = "/images/left-list_gray.gif";
            }
            else
            {
                Response.Redirect("index.aspsx");
            }
            return(editButton);
        }
示例#8
0
 public void AddPrintRun(PrintRun printRun)
 {
     printRunTable.InsertOnSubmit(printRun);
 }