Exemplo n.º 1
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            tbCustomer tbc = new tbCustomer()
            {
                address = txtAddress.Text,
                c_name = txtCName.Text,
                email = txtEmail.Text,
                link_men = txtLink.Text,
                mobile = txtMobile.Text,
                password = "******",
                PinPai = txtPingPai.Text,
                ProName = txtProduct.Text,
                remark = txtBZ.Text,
                tel = txtTel.Text,
                types = 2,
                username = txtCName.Text
            };

            CustomerBLL cbll = new CustomerBLL();
            int cid=  cbll.supplierAdd(tbc);
            if (cid > 0)
            {
                Response.Redirect("ThankReg.htm");
            }
        }
Exemplo n.º 2
0
 public AdminBLL()
 {
     ca       = new CategoriesBLL();
     cu       = new CustomerBLL();
     em       = new EmployeesBLL();
     or       = new OrderBLL();
     oq       = new Orders_QryBLL();
     pb       = new ProductsBLL();
     salescat = new SalesbycategoriesBLL();
     salesamt = new SalestotalsbyamountBLL();
     sec      = new SecurityBLL();
     spl      = new SuppliersBLL();
 }
Exemplo n.º 3
0
    protected void BtnRegister_Click(object sender, EventArgs e)
    {
        Model.CustomerMusic cus = new Model.CustomerMusic();
        cus.UserName = username.Text;
        cus.UserPwd  = Dbhelper.Encryption(Pwd.Text);
        cus.Phone    = phone.Text;
        cus.Email    = E_mail.Text;
        cus.Birthday = Birth.Text;

        if (radSex.Checked == true)
        {
            cus.Sex = "男";
        }
        else if (radSex.Checked == false)
        {
            cus.Sex = "女";
        }

        int count = new BLL.CustomerBLL().InsterRegist(cus);

        switch (count)
        {
        case -3:
            Showerror.Text = "用户已经存在!";
            break;

        case -2:
            Showerror.Text = "数据库连接失败!";
            break;

        case -1:
            Showerror.Text = "数据操作失败!";
            break;

        case 0:
            Showerror.Text = "注册失败,检查数据!";
            break;

        default:
            Response.Write("注册成功");
            Response.Redirect("login.aspx");
            break;
        }
    }
Exemplo n.º 4
0
    protected void Btnlogin_Click(object sender, EventArgs e)
    {
        string phone = txtLongin.Text;
        string pwd   = txtpwd.Text;

        Model.CustomerMusic cs = new Model.CustomerMusic();
        cs = new BLL.CustomerBLL().SelectLogin(phone, pwd);
        if (cs.Phone == "0")
        {
            loginerror.Text = cs.UserPwd;
        }
        else
        {
            loginerror.Text   = "登录成功!";
            Session["Logins"] = cs;
            int xw = new BLL.CustomerBLL().UpdateCustomerID(cs.ID);
            Response.Redirect("Mymusic.aspx");
        }
    }
Exemplo n.º 5
0
        public static void SaveListCustomersOfGroup(int groupId, List <int> customersId)
        {
            // List of customer in group
            var customersInGroup   = CustomerBLL.ListCustomersInGroup(groupId);
            var customersInGroupId = customersInGroup.Select(c => c.Id).ToList();


            // List of new customer wants to add to the group
            var newCustomersId = customersId.Except(customersInGroupId);

            // List of customer wants to remove from the group
            var removeCustomersId = customersInGroupId.Except(customersId);

            var newCustomersList = new List <CustomerGroups>();

            foreach (var customerId in newCustomersId)
            {
                newCustomersList.Add(
                    new CustomerGroups
                {
                    CustomerId = customerId,
                    GroupId    = groupId,
                    JoinDate   = DateTime.Now,
                });
            }

            var removeCustomersList = new List <CustomerGroups>();

            foreach (var customerId in removeCustomersId)
            {
                removeCustomersList.Add(
                    new CustomerGroups
                {
                    CustomerId = customerId,
                    GroupId    = groupId
                });
            }

            CustomerGroupDAL.AddRange(newCustomersList);
            CustomerGroupDAL.RemoveRange(removeCustomersList);
        }
Exemplo n.º 6
0
        /// <summary>
        /// 用户基本信息提交注册
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void ImageButton2_Click(object sender, ImageClickEventArgs e)
        {
            tbCustomer tbcustomer = new tbCustomer()
            {
                address = "",
                c_code = "",
                c_name = username.Value.Trim(),
                email = email.Value.Trim(),
                link_men = "",
                mobile = "",
                password = password.Value.Trim(),
                rank = "",
                remark = "",
                state = 1,
                tel = "",
                types = 1,
                username = username.Value.Trim()
            };

            CustomerBLL cbll = new CustomerBLL();
            int count= cbll.Add(tbcustomer);
            if (count != 0)
            {
                MailAddress messagefrom = new MailAddress("*****@*****.**");
                string MessageTo = email.Value.Trim();
                string MessageSuject = "邮件主题";
                string MessageBody = "请进行邮箱验证来完成您注册的最后一步操作,<a href='http://localhost:55419/JiHuoEmail.aspx?id="+count+"'>邮箱账号激活</a>";

                //发送邮件
                if (emailsend(messagefrom, MessageTo, MessageSuject, MessageBody))
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "test1", "alert('邮件发送成功,请激活邮件后登录')", true);
                    Session["Email"] = email.Value.Trim();
                    Response.Redirect("JiHuoEmail.aspx");
                }
            }
        }
Exemplo n.º 7
0
        private void getcustmoerinfo()
        {
            CustomerBLL cbll = new CustomerBLL();
               Model.Customer.tbCustomer tbcustomer=  cbll.GetModel(int.Parse(Session["Cid"].ToString()));
               if (tbcustomer.address != null && tbcustomer.address.Length>0)
               {
               this.txtAddress.Text = tbcustomer.address;
               }

               if (tbcustomer.email != null && tbcustomer.email.Length > 0)
               {
               this.txtEmail.Text = tbcustomer.email;
               }

               if (tbcustomer.mobile != null && tbcustomer.mobile.Length > 0)
               {
               this.txtMobile.Text = tbcustomer.mobile;
               }

               if (tbcustomer.link_men != null && tbcustomer.link_men.Length > 0)
               {
               this.txtOthors.Text = tbcustomer.link_men;
               }

               if (tbcustomer.c_name != null && tbcustomer.c_name.Length > 0)
               {
               this.txtRealName.Text = tbcustomer.c_name;
               }

               if (tbcustomer.tel != null && tbcustomer.tel.Length > 0)
               {
               this.txtTel.Text = tbcustomer.tel;
               }
        }
Exemplo n.º 8
0
 public frmCustomer()
 {
     InitializeComponent();
     cust = (CustomerBLL) WinClient.ApplicationContext["CustomerBLL"];
 }