示例#1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         Hashtable hash = (Hashtable)Application[Session["langcurrent"].ToString()];
         tblforgetpass   = hash["blforgetp"].ToString();
         tbutton         = hash["bsubmit"].ToString();
         titlemessage    = hash["mtgetpass"].ToString();
         temail          = hash["memail"].ToString();
         merrmail        = hash["merremail"].ToString();
         mnothave        = hash["mnotemail"].ToString();
         tnotsend        = hash["mnotsend"].ToString();
         tyestosend      = hash["msent"].ToString();
         tcode           = hash["mcode"].ToString();
         tcode2          = hash["mccode"].ToString();
         mcodeerr        = hash["merrcode"].ToString();
         terrInsert      = hash["merrsql"].ToString();
         tCurrentAccess  = hash["currentpage"].ToString();
         thome           = hash["home"].ToString();
         tCurrentAccess += ": <a href='?menu=home'>" + thome + "</a> &raquo; " + tblforgetpass;
         btgetpass.Text  = tbutton;
     }
     catch
     {
     }
     if (!IsPostBack)
     {
         divErrors.Visible = false;
     }
     if (Session["RamDomCodeRegister"] == null)
     {
         Session["RamDomCodeRegister"] = datacommon.CreateCodeRanDom(5);
     }
 }
示例#2
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)
 {
     try
     {
         Hashtable hash = (Hashtable)Application[Session["langcurrent"].ToString()];
         tblregister     = hash["blregister"].ToString();
         mtitle          = hash["mtregister"].ToString();
         tusername       = hash["maccount"].ToString();
         tpass1          = hash["mpass"].ToString();
         tpass2          = hash["mcpass"].ToString();
         tname           = hash["mfname"].ToString();
         tjob            = hash["mjob"].ToString();
         temail          = hash["memail"].ToString();
         tmobile         = hash["mmobile"].ToString();
         thome           = hash["mhomep"].ToString();
         taddress        = hash["maddress"].ToString();
         tcode1          = hash["mcode"].ToString();
         tcode2          = hash["mccode"].ToString();
         tbregister      = hash["bsubmit"].ToString();
         merr            = hash["merrcommon"].ToString();
         mpass           = hash["mpassl"].ToString();
         mpasserr        = hash["merrpass"].ToString();
         mcode           = hash["merrcode"].ToString();
         merruser        = hash["merraccount"].ToString();
         muser           = hash["meaccount"].ToString();
         memail          = hash["meemail"].ToString();
         merremail       = hash["merremail"].ToString();
         terrConnect     = hash["merrsql"].ToString();
         tCurrentAccess  = hash["currentpage"].ToString();
         tlhome          = hash["home"].ToString();
         tCurrentAccess += ": <a href='?menu=home'>" + tlhome + "</a> &raquo; " + tblregister;
     }
     catch
     {
     }
     if (!IsPostBack)
     {
         register.Value     = tbregister;
         divErrors.Disabled = true;
         code = GetCodeRandom.CreateCodeRanDom(5);
         Session["RamDomCodeRegister"] = code;
     }
 }
示例#4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        tCurrentAccess += ": <a href='?menu=home'>" + thome + "</a> &raquo; " + bldownprice;
        string _path     = Server.MapPath("data/exportprice/");
        string _nameFile = "bao_gia_laptop.xls";

        //tdownload += "(" timecurrent.g ")";
        //BarcodeLib.Code39 code39=new BarcodeLib.Code39('lebuisung');
        if (!IsPostBack)
        {
            divErrors.Visible = true;
            string random = DataCommon.CreateCodeRanDom(5);
            btsend.Value = tsend;
            Session["RamDomCodeRegister"] = random;
            try
            {
                file = new FileInfo(_path + _nameFile);
                if (file.Exists)
                {
                    DateTime timeNow  = new DateTime();
                    DateTime timeLast = new DateTime();
                    timeNow  = DateTime.Now;
                    timeLast = file.LastWriteTime;
                    TimeSpan subtime = timeNow - timeLast;
                    if (subtime.Minutes > 10)
                    {
                        isCreatenewExcel = true;
                    }
                    else
                    {
                        if (subtime.Hours > 0)
                        {
                            isCreatenewExcel = true;
                        }
                        else if (subtime.Days > 0)
                        {
                            isCreatenewExcel = true;
                        }
                    }
                }
                else
                {
                    isCreatenewExcel = true;
                }
            }
            catch
            {
                isCreatenewExcel = true;
            }
        }
        if (Session["RamDomCodeRegister"] == null)
        {
            string random = DataCommon.CreateCodeRanDom(4);
            Session["RamDomCodeRegister"] = random;
        }
        if (isCreatenewExcel)
        {
            try
            {
                string table = "";
                table = ProducttoExcel("USD", 0, (int)Application["idtypeproduct"]);
                if (table.Length == 0)
                {
                    table = "<table><tr><td>Không có sản phẩm nào</td></tr></table>";
                }
                StreamWriter createFile = new StreamWriter(_path + _nameFile, false, Encoding.UTF8);
                createFile.Write(table, Encoding.UTF8);
                createFile.Close();
            }
            catch
            {
            }
        }
        file = new FileInfo(_path + _nameFile);
        if (file.Exists)
        {
            timecurrent = file.LastWriteTime;
            timecurrent = timecurrent.ToUniversalTime();
            timecurrent = timecurrent.AddHours(7);
            tdownload   = "<font color='blue'>" + tdownload + " (Cập nhật lúc: " + timecurrent.ToShortTimeString() + ", " + timecurrent.ToString("dd/MM/yy") + " - Hà Nội)</font>";
        }
    }