protected void bt_OK_Click(object sender, EventArgs e) { CM_DIMembershipBLL ship = new CM_DIMembershipBLL(); if (CM_DIMembershipBLL.GetByUserName(UserName.Text.Trim()).Rows.Count > 0) { MessageBox.Show(this, "用户名重复,请重新键入其他用户名!"); return; } if (select_Client.SelectValue == "" || select_Client.SelectValue == "0") { MessageBox.Show(this, "请选择账号所属经销商!"); return; } ship.Model.UserName = UserName.Text.Trim(); ship.Model.Password = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(Password.Text, "md5"); ship.Model.IsApproved = 1; ship.Model.IsLockedOut = 0; int shipid = ship.Add(); if (shipid > 0) { CM_DIUsersBLL BLL = new CM_DIUsersBLL(); BLL.Model.Client = int.Parse(select_Client.SelectValue); BLL.Model.ShipID = shipid; if (BLL.Add() > 0) MessageBox.ShowAndRedirect(this, "创建成功!", "DIUserList.aspx"); } else MessageBox.Show(this, "账号创建出错,请联系管理员!"); }
protected void gv_DI_RowDeleting(object sender, GridViewDeleteEventArgs e) { CM_DIUsersBLL user = new CM_DIUsersBLL(); user.Delete((int)gv_DI.DataKeys[e.RowIndex][0]); BindGrid(); }
protected void bt_OK_Click(object sender, EventArgs e) { CM_DIMembershipBLL ship = new CM_DIMembershipBLL(); if (CM_DIMembershipBLL.GetByUserName(UserName.Text.Trim()).Rows.Count > 0) { MessageBox.Show(this, "用户名重复,请重新键入其他用户名!"); return; } if (select_Client.SelectValue == "" || select_Client.SelectValue == "0") { MessageBox.Show(this, "请选择账号所属经销商!"); return; } ship.Model.UserName = UserName.Text.Trim(); ship.Model.Password = System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfigFile(Password.Text, "md5"); ship.Model.IsApproved = 1; ship.Model.IsLockedOut = 0; int shipid = ship.Add(); if (shipid > 0) { CM_DIUsersBLL BLL = new CM_DIUsersBLL(); BLL.Model.Client = int.Parse(select_Client.SelectValue); BLL.Model.ShipID = shipid; if (BLL.Add() > 0) { MessageBox.ShowAndRedirect(this, "创建成功!", "DIUserList.aspx"); } } else { MessageBox.Show(this, "账号创建出错,请联系管理员!"); } }
protected string ShowClient(int id) { string clientname = ""; IList <CM_DIUsers> lists = CM_DIUsersBLL.GetModelList("ShipID=" + id.ToString()); foreach (CM_DIUsers item in lists) { CM_Client c = new CM_ClientBLL(item.Client).Model; if (c != null) { clientname += "<a href='DistributorDetail.aspx?ClientID=" + c.ID.ToString() + "' target='_blank' class='listViewTdLinkS1'>" + c.FullName + "</a><br/>"; } } return(clientname); }
protected void bt_OK_Click(object sender, EventArgs e) { CM_DIUsersBLL user = new CM_DIUsersBLL((int)Session["ClientUserID"]); CM_DIMembershipBLL ship = new CM_DIMembershipBLL(user.Model.ShipID); if (!DataEncrypter.Compare(ship.Model.Password,tbx_OrgPassword.Text)) Literal1.Text = "原密码输入错误!"; else { ship.Model.Password = DataEncrypter.EncrypteString(tbx_NewPassword.Text); ship.Update(); Literal1.Text = ""; tbx_NewPassword.Text = ""; tbx_OrgPassword.Text = ""; tbx_RePassword.Text = ""; MessageBox.Show(this, "密码修改成功!"); } }
protected void btn_Add_Click(object sender, EventArgs e) { if (select_Client.SelectValue != "" && select_Client.SelectValue != "0") { int client = int.Parse(select_Client.SelectValue); if (CM_DIUsersBLL.GetModelList("ShipID=" + ViewState["ShipID"] + " AND Client=" + client).Count > 0) { MessageBox.Show(this,"该经销商已添加!"); return; } CM_DIUsersBLL user = new CM_DIUsersBLL(); user.Model.Client = client; user.Model.ShipID = (int)ViewState["ShipID"]; if (user.Add() > 0) BindGrid(); else MessageBox.Show(this, "添加失败!"); } }
protected void bt_OK_Click(object sender, EventArgs e) { CM_DIUsersBLL user = new CM_DIUsersBLL((int)Session["ClientUserID"]); CM_DIMembershipBLL ship = new CM_DIMembershipBLL(user.Model.ShipID); if (!DataEncrypter.Compare(ship.Model.Password, tbx_OrgPassword.Text)) { Literal1.Text = "原密码输入错误!"; } else { ship.Model.Password = DataEncrypter.EncrypteString(tbx_NewPassword.Text); ship.Update(); Literal1.Text = ""; tbx_NewPassword.Text = ""; tbx_OrgPassword.Text = ""; tbx_RePassword.Text = ""; MessageBox.Show(this, "密码修改成功!"); } }
protected void btn_Add_Click(object sender, EventArgs e) { if (select_Client.SelectValue != "" && select_Client.SelectValue != "0") { int client = int.Parse(select_Client.SelectValue); if (CM_DIUsersBLL.GetModelList("ShipID=" + ViewState["ShipID"] + " AND Client=" + client).Count > 0) { MessageBox.Show(this, "该经销商已添加!"); return; } CM_DIUsersBLL user = new CM_DIUsersBLL(); user.Model.Client = client; user.Model.ShipID = (int)ViewState["ShipID"]; if (user.Add() > 0) { BindGrid(); } else { MessageBox.Show(this, "添加失败!"); } } }