Ejemplo n.º 1
0
        public ActionResult ShippingMethodEdit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }

            Method = new GenericRepository <ShippingMethod>(db);

            ShippingMethod method = Method.Get(id.Value);

            if (method == null)
            {
                return(HttpNotFound());
            }

            Carriers = new GenericRepository <Carriers>(db);
            ViewData["carrierSelect"] = Carriers.GetAll(true).Where(c => c.IsEnable).OrderBy(c => c.ID).ToList();

            List <object> directLineSelect = new List <object>()
            {
                new { text = "無", value = (byte)0 }
            };

            directLineSelect.AddRange(db.DirectLine.AsNoTracking().Where(d => d.IsEnable).Select(d => new { text = d.Name, value = d.ID }).ToList());
            ViewData["directLineSelect"] = new SelectList(directLineSelect.AsEnumerable(), "value", "text", method.DirectLine);

            ViewBag.WCPScript = WebClientPrint.CreateScript(Url.Action("ProcessRequest", "WebClientPrintAPI", null, HttpContext.Request.Url.Scheme), Url.Action("PrintFile", "File", null, HttpContext.Request.Url.Scheme), HttpContext.Session.SessionID);
            return(View(method));
        }
        // GET: Invoice/Details/5
        public ActionResult Details(int id)
        {
            var lBoInvoice = this.LInvoice.bll_GetInvoiceById(id).TrasferToMInvoice();

            ViewBag.WCPScript = WebClientPrint.CreateScript(Url.Action("ProcessRequest", "WebClientPrintAPI", null, HttpContext.Request.Url.Scheme), Url.Action("PrintCommands", "Invoice", new { pIdInvoice = id }, HttpContext.Request.Url.Scheme), HttpContext.Session.SessionID);
            return(this.View(lBoInvoice));
        }
Ejemplo n.º 3
0
    public ActionResult Index()
    {
        ViewBag.WCPScript = WebClientPrint.CreateScript(Url.Action("ProcessRequest", "WebClientPrintAPI", null, HttpContext.Request.Url.Scheme),
                                                        Url.Action("PrintCommands", "PrintESCPOS", null, HttpContext.Request.Url.Scheme),
                                                        HttpContext.Session.SessionID);

        return(View());
    }
Ejemplo n.º 4
0
        public IActionResult Index()
        {
            ViewData["WCPScript"] = WebClientPrint.CreateScript(Url.Action("ProcessRequest",
                                                                           "WebClientPrintAPI", null, Url.ActionContext.HttpContext.Request.Scheme),
                                                                Url.Action("PrintCommands", "PrintESCPOS", null, Url.ActionContext.HttpContext.Request.Scheme),
                                                                Url.ActionContext.HttpContext.Session.Id);

            return(View());
        }
Ejemplo n.º 5
0
        public ActionResult ShippingMethodEdit(int id)
        {
            if (!MyHelp.CheckAuth("shipping", "shippingMethod", EnumData.AuthType.Edit))
            {
                return(RedirectToAction("index", "main"));
            }

            Method = new GenericRepository <ShippingMethod>(db);

            ShippingMethod method = Method.Get(id);

            if (method == null)
            {
                return(HttpNotFound());
            }

            if (TryUpdateModel(method) && ModelState.IsValid)
            {
                Method.SaveChanges();

                MyHelp.Log("ShippingMethod", method.ID, "編輯運輸方式");
                return(RedirectToAction("shippingMethod", "shipping"));
            }

            Carriers = new GenericRepository <Carriers>(db);
            ViewData["carrierSelect"] = Carriers.GetAll(true).Where(c => c.IsEnable).OrderBy(c => c.ID).ToList();

            List <object> directLineSelect = new List <object>()
            {
                new { text = "無", value = (byte)0 }
            };

            directLineSelect.AddRange(db.DirectLine.AsNoTracking().Where(d => d.IsEnable).Select(d => new { text = d.Name, value = d.ID }).ToList());
            ViewData["directLineSelect"] = new SelectList(directLineSelect.AsEnumerable(), "value", "text", method.DirectLine);

            ViewBag.WCPScript = WebClientPrint.CreateScript(Url.Action("ProcessRequest", "WebClientPrintAPI", null, HttpContext.Request.Url.Scheme), Url.Action("PrintFile", "File", null, HttpContext.Request.Url.Scheme), HttpContext.Session.SessionID);
            return(View(method));
        }