protected void btndathang_Click(object sender, EventArgs e)
        {
            if(Page.IsValid)
            {
                Data.tbCUSTOMERS obj = new tbCUSTOMERS();
                string username = "******" + DateTime.Now.Day.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Year.ToString() + DateTime.Now.Millisecond.ToString();
                obj.vusername = username;
                obj.vpassword = username;
                obj.vcusname = txthoten.Text;
                obj.dbirthday = Common.DateTimeClass.ConvertDateTime(txtngaysinh.Text, "MM/dd/yyyy");
                obj.vprovince = txttinh.Text;
                obj.vaddress = txtdiachi.Text;
                obj.vphone = txtsodienthoai.Text;
                obj.vmobile = txtdidong.Text;
                obj.vemail = txtemail.Text;
                obj.dcreatedate = Common.DateTimeClass.ConvertDateTime(DateTime.Now.ToShortDateString(), "MM/dd/yyyy");
                obj.istatus = "0";
                //List<Data.tbCUSTOMERS> listcustommer = new List<tbCUSTOMERS>();
                //listcustommer = tbCUSTOMERSService.tbCUSTOMERS_GetByTop("", "vusername='******' and vpassword='******'", "");
                //if (listcustommer.Count > 0)
                //{
                //    //Common.WebMsgBox.Show("Đã tồn tại tài khoản này ");
                //    //txttendangnhap.Text = "";
                //    //txttendangnhap.Focus();
                //    //return;
                //}
                //else
                //{
                    tbCUSTOMERSService.tbCUSTOMERS_Insert(obj);

                //}
                    Session["hoten"] = txthoten.Text;
                    Session["username"] = username;
                    Session["password"] = username;
                    Session["billlocation"] = ddlkhuvuc.SelectedValue.ToString();
                    Response.Redirect("/OrderSuccess.aspx");

            }
        }
 protected void btndathang_Click(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         Data.tbCUSTOMERS obj = new tbCUSTOMERS();
         string username = "******" + DateTime.Now.Day.ToString() + DateTime.Now.Month.ToString() + DateTime.Now.Year.ToString() + DateTime.Now.Millisecond.ToString();
         obj.vusername = username;
         obj.vpassword = username;
         obj.vcusname = txthoten.Text;
         obj.dbirthday = Common.DateTimeClass.ConvertDateTime(DateTime.Now, "dd/MM/yyyy");
         obj.vaddress = txtdiachi.Text;
         obj.vphone = txtsodienthoai.Text;
         obj.vemail = txtemail.Text;
         obj.dcreatedate = Common.DateTimeClass.ConvertDateTime(DateTime.Now.ToShortDateString(), "MM/dd/yyyy");
         obj.istatus = "0";
         tbCUSTOMERSService.tbCUSTOMERS_Insert(obj);
         Session["hoten"] = txthoten.Text;
         Session["username"] = username;
         Session["password"] = username;
         SendEmail();
     }
 }
 public bool tbCUSTOMERS_Update(tbCUSTOMERS data)
 {
     using (SqlCommand dbCmd = new SqlCommand("sp_tbCUSTOMERS_Update", GetConnection()))
     {
         dbCmd.CommandType = CommandType.StoredProcedure;
         dbCmd.Parameters.Add(new SqlParameter("@iusid", data.iusid));
         dbCmd.Parameters.Add(new SqlParameter("@vusername", data.vusername));
         dbCmd.Parameters.Add(new SqlParameter("@vpassword", data.vpassword));
         dbCmd.Parameters.Add(new SqlParameter("@vcusname", data.vcusname));
         dbCmd.Parameters.Add(new SqlParameter("@dbirthday", data.dbirthday));
         dbCmd.Parameters.Add(new SqlParameter("@vprovince", data.vprovince));
         dbCmd.Parameters.Add(new SqlParameter("@vaddress", data.vaddress));
         dbCmd.Parameters.Add(new SqlParameter("@vphone", data.vphone));
         dbCmd.Parameters.Add(new SqlParameter("@vmobile", data.vmobile));
         dbCmd.Parameters.Add(new SqlParameter("@vemail", data.vemail));
         dbCmd.Parameters.Add(new SqlParameter("@dcreatedate", data.dcreatedate));
         dbCmd.Parameters.Add(new SqlParameter("@istatus", data.istatus));
         dbCmd.ExecuteNonQuery();
     }
     //Clear cache
     System.Web.HttpContext.Current.Cache.Remove("tbCUSTOMERS");
     return true;
 }
 public static bool tbCUSTOMERS_Update(tbCUSTOMERS data)
 {
     return db.tbCUSTOMERS_Update(data);
 }
 public static bool tbCUSTOMERS_Insert(tbCUSTOMERS data)
 {
     return db.tbCUSTOMERS_Insert(data);
 }