Exemplo n.º 1
0
        private void btnOrderCart_Click(object sender, EventArgs e)
        {
            this.Hide();
            DataTable dtIDUser = OrderItemsController.IDUser_Find(UserName, PassWord).Tables[0];
            string    IDUser   = dtIDUser.Rows[0][0].ToString();

            string Roles          = UserController.ShowRole(UserName).Tables[0].Rows[0][0].ToString();
            string DefaultAddress = "";
            string PhoneNumber    = "";
            string FullName       = "";

            if (Roles == "Seller")
            {
                DefaultAddress = "105 Đường 11, phường Tăng Nhơn Phú B, Quận 9, Thành phố Hồ Chí Minh";
                PhoneNumber    = "0333963285";
                FullName       = UserName;
            }
            else
            {
                DataTable dtAddress_User = OrderItemsController.All_Address_Show(IDUser, UserName, PassWord).Tables[0];
                foreach (DataRow dr in dtAddress_User.Rows)
                {
                    if (dr["IsDefault"].ToString() == "1")
                    {
                        DefaultAddress = dr["Street"].ToString() + ", " + dr["Ward"].ToString() + ", " + dr["District"].ToString() + ", " + dr["Province"].ToString();
                        PhoneNumber    = dr["PhoneNumber"].ToString();
                        FullName       = dr["FullName"].ToString();
                    }
                }
            }
            frmShipping frmShip = new frmShipping(UserName, PassWord, DefaultAddress, PhoneNumber, FullName);

            frmShip.ShowDialog();
        }
Exemplo n.º 2
0
        private void cbbDefalutAddress_Click(object sender, EventArgs e)
        {
            DataTable dtIDUser = OrderItemsController.IDUser_Find(UserName, PassWord).Tables[0];
            string    IDUser   = dtIDUser.Rows[0][0].ToString();

            cbbDefalutAddress.Items.Clear();
            DataTable dtAddress_User = OrderItemsController.All_Address_Show(IDUser, UserName, PassWord).Tables[0];

            foreach (DataRow dr in dtAddress_User.Rows)
            {
                string temp = dr["Street"].ToString() + ", " + dr["Ward"].ToString() + ", " + dr["District"].ToString() + ", " + dr["Province"].ToString();
                cbbDefalutAddress.Items.Add(temp);
                string IDAddress_User = dr["IDAddress_User"].ToString();
                lstAddress.Add(IDAddress_User);
            }
        }