Example #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["Account"] == null)
            {
                Response.Write(" <script> parent.document.location= 'logout.aspx' </script> ");
                Response.End();
            }
            else
            {
                account = Session["Name"].ToString();

                btn_Print.Text = "列印儲位明細(一張" + _PrintPageSize + "筆),印單機:" + PosNumber.GetPrintMachineNo(IPaddress);

                templblCount = lbl_Count.Text;

                lblMsg.Text          = "";
                lbl_Message.Text     = "";
                lbl_Count.Text       = "";
                lbl_ReportCount.Text = "";

                if (!IsPostBack)
                {
                    txt_Start.Text = DateTime.Today.AddDays(-7).ToString("yyyy-MM-dd");
                    txt_End.Text   = DateTime.Today.ToString("yyyy-MM-dd");
                }

                HandleStartDate = txt_Start.Text.Trim();
                HandleEndDate   = txt_End.Text.Trim();

                P_Report.Visible = (DDL_SearchType.SelectedItem.Text == "展售未上架");
                gv_List.Visible  = (DDL_SearchType.SelectedItem.Text == "庫存銷售" || DDL_SearchType.SelectedItem.Text == "瑕疵" || DDL_SearchType.SelectedItem.Text == "問題件");

                P_SerialList.Visible = !CB_自動查儲位.Checked;
            }
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            PosDT = PosNumber.GetAllPosNo();

            if (!string.IsNullOrEmpty(Request["ClerkName"]))
            {
                ck.Name = Request["ClerkName"];
            }
            else
            {
                Auth();
            }

            if (string.IsNullOrEmpty(Request["Date"]))
            {
                Date = DateTime.Now.ToString("yyyy/MM/dd");
            }
            else
            {
                Date = Request["Date"];
            }

            PosNoBiding();
            if (!string.IsNullOrEmpty(Request["PosNo"]))
            {
                PosNo = Request["PosNo"];
            }

            LoadOrderData();
        }
Example #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            PosDT = PosNumber.GetAllPosNo();

            if (string.IsNullOrEmpty(Request["Date"]))
            {
                Date = DateTime.Now.ToString("yyyy/MM/dd");
            }
            else
            {
                Date = Request["Date"];
            }

            if (string.IsNullOrEmpty(Request["Month"]))
            {
                Month = "";
            }
            else
            {
                string[] datelist = Request["Month"].ToString().Split('/');
                Year  = datelist[0];
                Month = datelist[1];
            }

            if (!string.IsNullOrEmpty(Request["PosNo"]))
            {
                PosNo = Request["PosNo"];
            }

            LoadOrderData();
        }
Example #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string act       = (string.IsNullOrEmpty(Request["act"])) ? "" : Request["act"];
            string thisYear  = currentTime.ToString("yyyy");
            string thisMonth = currentTime.ToString("MM");
            string thisDay   = currentTime.ToString("dd");

            startYear  = (!string.IsNullOrEmpty(Request["startYear"])) ? Request["startYear"] : thisYear;
            startMonth = (!string.IsNullOrEmpty(Request["startMonth"])) ? Request["startMonth"] : thisMonth;
            startDay   = (!string.IsNullOrEmpty(Request["startDay"])) ? Request["startDay"] : thisDay;
            endYear    = (!string.IsNullOrEmpty(Request["endYear"])) ? Request["endYear"] : thisYear;
            endMonth   = (!string.IsNullOrEmpty(Request["endMonth"])) ? Request["endMonth"] : thisMonth;
            endDay     = (!string.IsNullOrEmpty(Request["endDay"])) ? Request["endDay"] : thisDay;
            string QueryType = (!string.IsNullOrEmpty(Request["QueryType"])) ? Request["QueryType"] : "";

            if (QueryType == "訂單資料查詢" || QueryType == "")
            {
                LoadOrderData();
            }
            else
            {
                LoadReturnOrderData();
            }


            if (act == "GetOrderItem")
            {
                DataTable dt        = Order.GetOrderItemByOrderID(Request["OrderID"]);
                string    OrderItem = Order.GetOrderItemString(dt);
                var       result    = new { result = dt.Rows.Count > 0, data = OrderItem };
                ShowResultOnPage(JsonConvert.SerializeObject(result));
            }


            if (act == "CancelOrders")
            {
                string ErrorMsg = "";
                bool   status   = false;
                if (Auth())
                {
                    string IPaddress = Request.UserHostAddress;
                    string PosNo     = PosNumber.GetPosNumberMapping(IPaddress);
                    status = Order.CancelOrders(Request["OrderID"], PosNo, ck.ID);
                    if (status)
                    {
                        ErrorMsg = "新增成功";
                    }
                    else
                    {
                        ErrorMsg = "新增失敗";
                    }
                }
                else
                {
                    ErrorMsg = "尚未登入";
                }
                var result = new { result = status, ErrorMsg = ErrorMsg };
                ShowResultOnPage(JsonConvert.SerializeObject(result));
            }
        }
Example #5
0
        public void PosNoBiding()
        {
            string IPaddress = Request.UserHostAddress;

            PosNo     = PosNumber.GetPosNumberMapping(IPaddress);
            MachineNo = PosNumber.GetInvoiceMachineNo(IPaddress);
        }
Example #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            HttpPostCheck();

            switch (act)
            {
            case "Query":
                QueryOrder();
                break;

            case "GetOrderItem":
                GetOrderItem(OrderID);
                break;

            default:
                DataTable dt = PosNumber.GetAllPosNo();
                PosList  = JsonConvert.SerializeObject(dt.AsEnumerable().Select(r => new { PosNo = r["PosNo"] }).ToList());
                AllStaff = GetAllStaff();
                break;
            }
        }
Example #7
0
        public void PosNoBiding()
        {
            string IPaddress = Request.UserHostAddress;

            PosNo = int.Parse(PosNumber.GetPosNumberMapping(IPaddress)).ToString("D3");
        }
Example #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string act = (string.IsNullOrEmpty(Request["act"])) ? "" : Request["act"];
            string thisYear = currentTime.ToString("yyyy");
            string thisMonth = currentTime.ToString("MM");
            string thisDay = currentTime.ToString("dd");
            startYear = (!string.IsNullOrEmpty(Request["startYear"])) ? Request["startYear"] : thisYear;
            startMonth = (!string.IsNullOrEmpty(Request["startMonth"])) ? Request["startMonth"] : thisMonth;
            startDay = (!string.IsNullOrEmpty(Request["startDay"])) ? Request["startDay"] : thisDay;
            endYear = (!string.IsNullOrEmpty(Request["endYear"])) ? Request["endYear"] : thisYear;
            endMonth = (!string.IsNullOrEmpty(Request["endMonth"])) ? Request["endMonth"] : thisMonth;
            endDay = (!string.IsNullOrEmpty(Request["endDay"])) ? Request["endDay"] : thisDay;
            string QueryType = (!string.IsNullOrEmpty(Request["QueryType"])) ? Request["QueryType"] : "";

            if (QueryType == "訂單資料查詢" || QueryType == "")
            {
                LoadOrderData();
            }
            else
            {
                DateFormating();
                DateTime start_date = new DateTime(int.Parse(startYear), int.Parse(startMonth), int.Parse(startDay));
                DateTime end_date = new DateTime(int.Parse(endYear), int.Parse(endMonth), int.Parse(endDay), 23, 59, 59);
                OrderDT = Order.GetReturnOrderByDate(start_date, end_date);
                FailedOrderItemDT = Order.GetReturnItemByDate(start_date, end_date);

                var Orderlist = OrderDT.AsEnumerable().Select(r => new { OrderID = r["OrderID"], Amount = (int)r["Amount"], PayType = (int)r["PayType"], Status = (int)r["Status"] }).Distinct();
                var FailedOrderItemList = FailedOrderItemDT.AsEnumerable().Select(r => new { OrderID = r["OrderID"], Quantity = (int)r["Quantity"] });
                FailedTotalAmount = (from a in Orderlist
                                     where a.OrderID.ToString() != "0"
                                     select a).Sum(x => x.Amount);

                FailedTotalCash = (from a in Orderlist
                                   where a.OrderID.ToString() != "0" && a.PayType == 1
                                   select a).Sum(x => x.Amount);

                FailedTotalCredit = (from a in Orderlist
                                     where a.OrderID.ToString() != "0" && a.PayType == 2
                                     select a).Sum(x => x.Amount);

                FailedNum = (from a in FailedOrderItemList
                             where a.OrderID.ToString() != "0"
                             select a).Sum(x => x.Quantity);

            }


            if (act == "GetOrderItem")
            {
                DataTable dt = Order.GetOrderItemByOrderID(Request["OrderID"]);
                string OrderItem = Order.GetOrderItemString(dt);
                var result = new { result = dt.Rows.Count > 0, data = OrderItem };
                ShowResultOnPage(JsonConvert.SerializeObject(result));
            }

            if (act == "CancelOrders")
            {
                string ErrorMsg = "";
                bool status = false;
                if (Auth())
                {
                    string IPaddress = Request.UserHostAddress;
                    string PosNo = PosNumber.GetPosNumberMapping(IPaddress);
                    status = Order.CancelOrders(Request["OrderID"], PosNo, ck.ID);
                    if (status)
                    { ErrorMsg = "新增成功"; }
                    else
                    { ErrorMsg = "新增失敗"; }
                }
                else
                {
                    ErrorMsg = "尚未登入";
                }
                var result = new { result = status, ErrorMsg = ErrorMsg };
                ShowResultOnPage(JsonConvert.SerializeObject(result));
            }
        }