Beispiel #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["infoUser"] == null)
     {
         Response.Redirect("Default.aspx");
     }
     divErrors.Visible = false;
     if (!IsPostBack)
     {
         string[] arrvalue = (string[])Session["infoUser"];
         DataSet  ds       = Users.GetUserInformation(int.Parse(arrvalue[0]));
         if (ds.Tables.Count > 0)
         {
             if (ds.Tables[0].Rows.Count > 0)
             {
                 txtEmailFrom.Value = ds.Tables[0].Rows[0]["Email1"].ToString();
                 txtName.Value      = ds.Tables[0].Rows[0]["Contactname"].ToString();
             }
             else
             {
                 Response.Redirect("Default.aspx");
             }
         }
         else
         {
             Response.Redirect("Default.aspx");
         }
     }
     if (Session["RamDomCodeRegister"] == null)
     {
         string random = DataCommon.CreateCodeRanDom(5);
         Session["RamDomCodeRegister"] = random;
     }
     try
     {
         Hashtable hash = (Hashtable)Application[Session["langcurrent"].ToString()];
         currentAccess   = hash["currentpage"].ToString();
         thome           = hash["home"].ToString();
         tsendmail       = hash["fsendmail"].ToString();
         currentAccess  += ": <a href='?menu=home'>" + thome + "</a> &raquo; " + tsendmail;
         tbutton         = "Đồng ý";
         btsend.Value    = tbutton;
         tblsendmail     = "Gửi thư yêu cầu với chúng tôi";
         ttitle          = "Tiêu đề yêu cầu";
         tname           = "Họ tên người gửi";
         tcontent        = "Nội dung yêu cầu";
         tcode           = "Mã xác nhận";
         tcodo1          = "Nhập lại mã xác nhận";
         tfrom           = "Email người gửi";
         terrcommon      = "Xin hãy nhập đầy đủ thông tin";
         terrlengcontent = "Nội dung yêu cầu phải trên 50 ký tự.";
         terrcode        = "Mã xác nhận không đúng";
         tnotsupportsend = "Hệ thống không hỗ trợ gửi mail. Thành thật xin lỗi bạn về điều này.";
         tyestosend      = "Chúng tôi đã nhận được yêu cầu của bạn. Chúng tôi sẽ cố gắng liên lạc với bạn trong thời gian sớm nhất.";
     }
     catch
     {
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["ProductInCart"] != null)
     {
         ManagerCart = (ManagerProcart)Session["ProductInCart"];
     }
     if (ManagerCart.getLengList() > 0)
     {
     }
     else
     {
         Response.Redirect("?menu=shoppingcart");
     }
     //Getlang:
     try
     {
         currentAccess += ": <a href='?menu=home'>" + lhome + "</a> &raquo; " + tblOrder;
     }
     catch
     {
     }
     plhTop.Controls.Add(Page.LoadControl("block/ShoppingCart.ascx"));
     if (Session["infoUser"] != null)
     {
         tmessageinfo = "Xin bạy hãy chỉnh sửa thông tin liên hệ, nếu cần thiết";
     }
     if (!IsPostBack)
     {
         divErrors.Disabled = true;
         //Get Pos:
         DataSet  dsPos  = ManagerUser.PosSelectAllForOrderProduct();
         int      numPos = dsPos.Tables[0].Rows.Count;
         ListItem Item   = new ListItem(tPleaseChoiceWhere, "0");
         slPos.Items.Add(Item);
         for (int i = 0; i < numPos; i++)
         {
             Item = new ListItem(dsPos.Tables[0].Rows[i]["Name"].ToString(), dsPos.Tables[0].Rows[i]["Id"].ToString());
             slPos.Items.Add(Item);
         }
         if (Session["infoUser"] != null)
         {
             string[] arrInfo = (string[])Session["infoUser"];
             DataSet  ds      = ManagerUser.GetUserInformation(int.Parse(arrInfo[0]));
             if (ds.Tables.Count > 0)
             {
                 if (ds.Tables[0].Rows.Count > 0)
                 {
                     txtname.Value   = ds.Tables[0].Rows[0]["ContactName"].ToString();
                     txtaddess.Value = ds.Tables[0].Rows[0]["ShippingAddress"].ToString();
                     txtemail.Value  = ds.Tables[0].Rows[0]["Email1"].ToString();
                     txtmobile.Value = ds.Tables[0].Rows[0]["MobilePhone"].ToString();
                     txthome.Value   = ds.Tables[0].Rows[0]["HomePhone"].ToString();
                 }
             }
         }
     }
 }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["infoUser"] == null)
        {
            Response.Redirect("Default.aspx");
        }
        try
        {
            Hashtable hash = (Hashtable)Application[Session["langcurrent"].ToString()];
            currentAccess  = hash["currentpage"].ToString();
            thome          = hash["home"].ToString();
            tblchange      = hash["facount"].ToString();
            currentAccess += ": <a href='?menu=home'>" + thome + "</a> &raquo; " + tblchange;
            if (!IsPostBack)
            {
                string[]         arrstr   = (string[])Session["infoUser"];
                UserAccount_data userInfo = Users.GetUserInformation(int.Parse(arrstr[0]));
                if (userInfo.Tables.Count > 0)
                {
                    if (userInfo.Tables[0].Rows.Count > 0)
                    {
                        txtusername.Value    = userInfo.Tables[0].Rows[0][UserAccount_data._UserName].ToString();
                        txtname.Value        = userInfo.Tables[0].Rows[0][UserAccount_data._ContactName].ToString();
                        txtcompany.Value     = userInfo.Tables[0].Rows[0][UserAccount_data._Company].ToString();
                        txtjob.Value         = userInfo.Tables[0].Rows[0][UserAccount_data._JobTitle].ToString();
                        txtmobile.Value      = userInfo.Tables[0].Rows[0][UserAccount_data._MobilePhone].ToString();
                        txtoffice.Value      = userInfo.Tables[0].Rows[0][UserAccount_data._OfficePhone].ToString();
                        txthome.Value        = userInfo.Tables[0].Rows[0][UserAccount_data._HomePhone].ToString();
                        txtemail1.Value      = userInfo.Tables[0].Rows[0][UserAccount_data._Email1].ToString();
                        txtemail2.Value      = userInfo.Tables[0].Rows[0][UserAccount_data._Email2].ToString();
                        txtfax.Value         = userInfo.Tables[0].Rows[0][UserAccount_data._FaxNumber].ToString();
                        txttax.Value         = userInfo.Tables[0].Rows[0][UserAccount_data._TaxCode].ToString();
                        txtwebsite.Value     = userInfo.Tables[0].Rows[0][UserAccount_data._Website].ToString();
                        txtaddressbill.Value = userInfo.Tables[0].Rows[0][UserAccount_data._BillingAddress].ToString();
                        txtcitybill.Value    = userInfo.Tables[0].Rows[0][UserAccount_data._BillingCity].ToString();
                        txtzipcodebill.Value = userInfo.Tables[0].Rows[0][UserAccount_data._BillingZipCode].ToString();
                        txtcountrybill.Value = userInfo.Tables[0].Rows[0][UserAccount_data._BillingCountry].ToString();
                        txtaddressship.Value = userInfo.Tables[0].Rows[0][UserAccount_data._ShippingAddress].ToString();
                        txtcityship.Value    = userInfo.Tables[0].Rows[0][UserAccount_data._ShippingCity].ToString();
                        txtzipcodeship.Value = userInfo.Tables[0].Rows[0][UserAccount_data._ShippingZipCode].ToString();
                        txtcountryship.Value = userInfo.Tables[0].Rows[0][UserAccount_data._ShippingCountry].ToString();
                    }
                    else
                    {
                        Session["infoUser"] = null;
                        Response.Redirect("Default.aspx");
                    }
                }
                else
                {
                    Session["infoUser"] = null;
                    Response.Redirect("Default.aspx");
                }
            }
            diverror1.Visible = false;
            diverror2.Visible = false;
            diverror3.Visible = false;
            diverror4.Visible = false;

            tblchange           = "Thay đổi thông tin khách hàng";
            taccount            = "Tài khoản đăng nhập";
            tusername           = "******";
            tpass1              = "Mật khẩu";
            tpass2              = "Xác nhận mật khẩu";
            taccountinfo        = "Thông tin khách hàng";
            tname               = "Họ và tên";
            tcompany            = "Tên công ty";
            tjob                = "Nghề nghiệp";
            tmobile             = "Số đt di động";
            toffice             = "Số đt cơ quan";
            thomephone          = "Số đt nhà riêng";
            temail1             = "Địa chỉ mail1";
            temail2             = "Địa chỉ mail2";
            tfax                = "Số Fax";
            ttax                = "Mã số thuế";
            twebsite            = "Website";
            tbilling            = "Địa chỉ thanh toán";
            taddress            = "Địa chỉ";
            tcity               = "Thành Phố";
            tcountry            = "Quốc Gia";
            tzipcode            = "Mã bưu điện";
            tshipping           = "Địa chỉ giao hàng";
            tbutton             = "Chỉnh sửa";
            terrUpdate          = "Lỗi kết nối SQL. Không thể chỉnh sửa. Xin hãy thử lại";
            tyestochange        = "Thông tin đã được thay đổi";
            terrlengpass        = "******";
            terrpass            = "******";
            terrcommon          = "Xin hãy nhập thông tin cần thiết";
            terremail           = "Địa chỉ email không hợp lệ";
            buttonpass.Value    = tbutton;
            buttoninfor.Value   = tbutton;
            buttonbilling.Value = tbutton;
            buttonship.Value    = tbutton;
        }
        catch
        {
        }
    }