Пример #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (IsPostBack) return;
     MCodeCom codeCom = new MCodeCom();
     IList<ComboItem> citylst = MCodeCom.ToComboItems(codeCom.GetListCity(), "294").ListItems;
     DropDownList1.DataSource = citylst;
     DropDownList1.DataBind();
 }
Пример #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack)
            {
                return;
            }
            else
            {
                //load data
                MCodeCom codeCom = new MCodeCom();
                IList<ComboItem> citylst = MCodeCom.ToComboItems(codeCom.GetListCity(), "294").ListItems;
                DropDownList1.DataSource = citylst;
                DropDownList1.DataBind();
                DropDownList1.SelectedValue = "294";
                DropDownList2.DataSource = citylst;
                DropDownList2.DataBind();
                DropDownList2.SelectedValue = "294";

                UserComDao userCom = new UserComDao();
                if (Session["Cart"] == null || Session["payMethod"] == null)
                {
                    Response.Redirect(Pages.CLIENT_INDEX);
                }
                if (Session["payMethod"].ToString().Equals("1"))
                {
                    if (Session["userCd"] == null)
                    {
                        Response.Redirect(Pages.CLIENT_LOGIN);
                    }
                    Guid userCd = new Guid(Session["userCd"].ToString());

                    result = userCom.GetSingle(userCd, false);
                    if (result == null)
                    {
                        Response.Redirect(Pages.CLIENT_LOGIN);
                    }
                    else
                    {
                        clientName.Text = result.FullName;
                        clientAddress.Text = result.Address;
                        clientTell.Text = result.Phone1;
                        txtClientCd.Value = result.Email;
                        DropDownList1.SelectedValue = result.CityCd;

                        RadioButton1.Checked = true;

                        deliveryName.Text = result.FullName;
                        deliveryAddress.Text = result.Address;
                        deliveryTell.Text = result.Phone1;
                        DropDownList2.SelectedValue = result.CityCd;

                    }

                }

            }
        }
Пример #3
0
        /// <summary>
        /// Get infomation
        /// </summary>
        /// <param name="inputObject">DataModel</param>
        /// <returns>DataModel</returns>
        private InitDataModel GetInfo(InitDataModel inputObject)
        {
            // Local variable declaration
            InitDataModel getResult = null;
            MCodeCom mCodeCom = null;
            AdminUserEntryDao adminUserEntryDao = null;

            // Variable initialize
            getResult = new InitDataModel();
            mCodeCom = new MCodeCom();
            adminUserEntryDao = new AdminUserEntryDao();

            // Get data
            var listCity = mCodeCom.GetListCity(false, false);
            var listDeleteFlag = mCodeCom.GetListCode(Logics.GROUP_DELETE_FLAG, null, false, false);
            var listGroup = mCodeCom.GetListGroup(false, false);
            var user = new User();
            if (!IsAdd) user = adminUserEntryDao.GetSingle(inputObject.UserCd);

            // Set value
            getResult.ListCity = listCity;
            getResult.ListDeleteFlag = listDeleteFlag;
            getResult.ListGroup = listGroup;
            getResult.User = user;

            // Return value
            return getResult;
        }
Пример #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack)
            {
                return;
            }
            if (Session["Cart"] == null || Session["payMethod"] == null)
            {
                Response.Redirect(Pages.CLIENT_INDEX);
            }
            if (Session["CheckoutRequestModel"] == null || Session["hasCheckout"] == null)
            {
                Response.Redirect(Pages.CLIENT_CHECKOUT);
            }
            if (Session["payMethod"].ToString().Equals("0") && Session["SaveRequestModel"] == null)
            {
                Response.Redirect(Pages.CLIENT_CHECKOUT);
            }
            else
            {
                Session["hasCheckout"] = null;
            }

            //load data
            MCodeCom codeCom = new MCodeCom();
            IList<ComboItem> citylst = MCodeCom.ToComboItems(codeCom.GetListCity(), "294").ListItems;
            DropDownList1.DataSource = citylst;
            DropDownList1.DataBind();
            DropDownList1.SelectedValue = "294";
            DropDownList2.DataSource = citylst;
            DropDownList2.DataBind();
            DropDownList2.SelectedValue = "294";

            if (Session["payMethod"].ToString().Equals("0"))
            {
                SaveRequestModel accCreate = (SaveRequestModel)Session["SaveRequestModel"];
                email.Text = accCreate.Email;
            }
            CheckoutRequestModel checkout = (CheckoutRequestModel)Session["CheckoutRequestModel"];
            Accept accept = checkout.Accept;
            clientName.Text = accept.ClientName;
            clientAddress.Text = accept.ClientAddress;
            clientTell.Text = accept.ClientTel;
            DropDownList1.SelectedValue = accept.ClientCityCd;
            deliveryName.Text = accept.DeliveryName;
            deliveryAddress.Text = accept.DeliveryAddress;
            deliveryTell.Text = accept.DeliveryTel;
            DropDownList2.SelectedValue = accept.DeliveryCityCd;
            note.Text = accept.Notes;
            if (accept.PaymentMethods == "01")
            {
                lblPay.Text = "Thanh toán tiền mặt khi nhận hàng";
            }
            else if (accept.PaymentMethods == "02")
            {
                lblPay.Text = "Thanh toán trực truyến bằng thẻ ATM - Internet Banking";
            }
            IList<CartItem> cart = (IList<CartItem>)Session["Cart"];
            CartCom cartCom = new CartCom(cart);
            decimal amount = cartCom.TotalAmount;
            decimal ship = 0;
            if (Session["GiftPrice"] != null && Session["GiftCd"] != null)
            {
                amount = amount - (decimal)Session["GiftPrice"];

            }
            total = amount;
            if (accept.DeliveryCityCd == "294")
            {
                if (amount < 200000)
                {
                    ship = 20000;
                    total = total + ship;
                }
            }
            else
            {
                if (amount < 1000000)
                {
                    ship = 30000;
                    total = total + ship;
                }
            }
            Label1.Text = DataHelper.ToString(Formats.CURRENCY, amount);
            if (ship != 0)
            {
                Label2.Text = DataHelper.ToString(Formats.CURRENCY, ship);
            }
            Label3.Text = DataHelper.ToString(Formats.CURRENCY, total);
            Session["TotalAmt"] = total;
        }