protected void btnEnable_Click(object sender, EventArgs e) { if (DepTreeList.SelectionCount <= 0) { JSHelper.Alert("请至少选择一条记录!", this); } else { List <string> list = new List <string>();//建立事务列表 foreach (var item in DepTreeList.GetSelectedNodes()) { list.Add(string.Format("update department set deptstatus='1' where deptnumber='{0}'", item.Key)); } try { OracleHelper.ExecuteSqlTran(list); InitData(); DepTreeList.UnselectAll(); JSHelper.Alert("更新成功!", this); } catch (Exception ex) { JSHelper.Alert("出现异常,更新失败!请与管理员联系!", this); } } }
protected void btnUpdate_Click(object sender, EventArgs e) { if (upctrlPsn.UploadedFiles[0].IsValid && upctrlPsn.HasFile) { commonFunc.SaveFile(upctrlPsn, this); string savePath = commonFunc.GetSavePath(upctrlPsn, this); Aspose.Cells.Workbook xlsPsn = new Aspose.Cells.Workbook(savePath); //xlsPsn.Open(savePath); Aspose.Cells.Cells cellsPsn = xlsPsn.Worksheets[0].Cells; var dtTemp = cellsPsn.ExportDataTable(0, 0, cellsPsn.MaxDataRow + 1, cellsPsn.MaxDataColumn + 1); ListBox lstUpdated = new ListBox(); for (int i = 1; i < dtTemp.Rows.Count; i++) { if (commonFunc.VerifyNumber(dtTemp.Rows[i][0].ToString().Trim())) { lstUpdated.Items.Add(dtTemp.Rows[i][0].ToString().Trim()); } } foreach (ListItem item in lstUpdated.Items) { if (!xlstPerson.Items.Contains(item)) { xlstPerson.Items.Add(item); } } xlblPersonNumber.Text = xlstPerson.Items.Count.ToString(); JSHelper.Alert(UpdatePanel2, this, "上传成功!"); } }
protected void btnSendMsg_Click(object sender, EventArgs e) { if (txtMsg.Value == "") { JSHelper.Alert(UpdatePanel2, this, "请输入你要发送的短信内容!"); } else if (xlstPerson.Items.Count <= 0) { JSHelper.Alert(UpdatePanel2, this, "请输入你要发送的对象!"); } else { string msg = Sms.Send(txtMsg.Value, xlstPerson, txtSender.Text.Trim()); if (msg == "1") { txtMsg.Value = ""; JSHelper.Alert(UpdatePanel2, this, "已将要发送的短信提交到服务器!"); } else { JSHelper.Alert(UpdatePanel2, this, "已将要发送的短信提交到服务器!\n" + @msg); } } //} }
protected void Button1_Click1(object sender, EventArgs e) { administatorsModel administatorsModel = new administatorsModel(); administatorsModel.midName = username.Value; if (newpassword2.Value == userpassword.Value) { administatorsModel.mpassword = userpassword.Value; } else { JSHelper.Alert(this, "两次密码输入不一致"); } administatorsModel.mphone = txtphone.Value; administatorsModel.mailbox = email.Value; Admin_BLL.administratorBLL administratorBLL = new Admin_BLL.administratorBLL(); int count = administratorBLL.insert(administatorsModel); if (count > 0) { JSHelper.Alert(this, "添加成功"); RepeaterList(); } else { JSHelper.Alert(this, "添加失败"); } }
protected string getwhere() { string strwhere = "warehouse_id=" + Convert.ToString(Session["warehouse_id"]) + "and is_new<3"; if (txtsid.Text.IsNotNullAndEmpty()) { if (CheckCharIsNumber(this.txtsid.Text.ToString())) { strwhere += " and shopxpptid=" + txtsid.Text.ToString(); } else { JSHelper.Alert("请输入数字类型的商品id"); } } if (txttxm.Text.IsNotNullAndEmpty()) { if (CheckCharIsNumber(this.txttxm.Text.ToString())) { strwhere += " and txm ='" + txttxm.Text.ToString() + "'"; } } if (txtpname.Text.IsNotNullAndEmpty()) { strwhere += " and shopxpptname like '%" + txtpname.Text.ToString() + "%'"; } return(strwhere); }
protected void btnSure_Click(object sender, EventArgs e) { User bllUser = new User(); int id = 0; try { id = (int)SessionBox.GetUserSession().LoginId; } catch (Exception ex) { JSHelper.AlertAndRedirect("请登录后操作!\n" + ex.Message, "../Login.aspx", this); } if (bllUser.VerifyPassword(id, SecurityEncryption.MD5(txtOldPwd.Text, 32))) { if (bllUser.ChangePassword(id, SecurityEncryption.MD5(txtPwd2.Text, 32))) { JSHelper.AlertAndRedirect("密码修改成功,下次登录请用新密码!", "../Main.aspx", this); } } else { JSHelper.Alert("原密码输入不正确!", this); } }
protected void btnDel_Click(object sender, EventArgs e) { if (xlstPerson.Items.Count > 0 && xlstPerson.SelectedIndex != -1) { xlstPerson.Items.Remove(xlstPerson.SelectedItem); xlblPersonNumber.Text = xlstPerson.Items.Count.ToString(); } else { JSHelper.Alert(UpdatePanel2, this, "请先选中要删除的对象!"); } }
protected void btnSave_Click(object sender, EventArgs e) { Role Rolebll = new Role(); List <string> list = new List <string>();//建立事务列表 for (int i = 0; i <= gvModuleOperator.Rows.Count - 1; i++) { CheckBoxList chkAuthorityList = (CheckBoxList)gvModuleOperator.Rows[i].Cells[1].FindControl("chkAuthorityList"); Label lblVerify = (Label)gvModuleOperator.Rows[i].Cells[0].FindControl("lblVerify"); string[] vstate = lblVerify.Text.Split(',');//获取原始状态 for (int j = 0; j < chkAuthorityList.Items.Count; j++) { if (chkAuthorityList.Items[j].Enabled) { if (chkAuthorityList.Items[j].Selected) { if (vstate[j] != "1")//检查数据有没有变化 { string item = string.Empty; item = item + Rid.Text + "|" + gvModuleOperator.DataKeys[i].Values[0].ToString() + "|" + chkAuthorityList.Items[j].Value + "|1";//设置为1,加入权限 list.Add(item); } } else { if (vstate[j] != "0")//检查数据有没有变化 { string item = string.Empty; item = item + Rid.Text + "|" + gvModuleOperator.DataKeys[i].Values[0].ToString() + "|" + chkAuthorityList.Items[j].Value + "|0";//设置为0,删除删除 list.Add(item); } } } } } if (Rolebll.UpdateRoleOperator(list)) { BindModule(); JSHelper.Alert("设置成功!", this); } else { JSHelper.Alert("设置操作失败!", this); } }
protected void btnSure_Click(object sender, EventArgs e) { User ull = new User(); if (ull.UpdateUserGroup((List <object>)Session["UserIDList"], Convert.ToInt32(ddlUserGroup.SelectedValue))) { JSHelper.AlertAndCloseModalWin("更新成功!", this); } else { JSHelper.Alert("更新失败!", this); } }
protected void Button1_Click(object sender, EventArgs e) { string filepath = Session["filename"].ToString(); string serverpath = "\\images\\" + filepath; Admin_BLL.CeshiBLL ceshi = new Admin_BLL.CeshiBLL(); int count = ceshi.Addseshi(serverpath); if (count > 0) { JSHelper.Alert(this, "添加成功"); } }
protected void RefuseBtn_Click(object sender, EventArgs e) { int mid = Convert.ToInt32(Session["Mid"]); int Theid = Convert.ToInt32(Request.QueryString["Theid"]); The_capitalBLL capitalBLL = new The_capitalBLL(); int count = capitalBLL.RefusedTo(Theid, mid); if (count > 0) { JSHelper.Alert(this, "拒绝通过"); Response.Redirect("TheShops_Audit.aspx"); } }
protected void btnSendAll_Click(object sender, EventArgs e) { List <string> lstPhone = txtPhone.Text.Split(',').ToList(); string msg = Sms.Send(lstPhone, txtSms.Text.Trim()); if (msg == "1") { JSHelper.Alert("发送成功!", this); } else { JSHelper.Alert(msg, this); } }
protected void gvPerson_RowUpdating(object sender, GridViewUpdateEventArgs e) { SF_Person sfp = new SF_Person(); sfp.LIGHTNUMBER = ((TextBox)gvPerson.Rows[e.RowIndex].FindControl("txtLightNo2")).Text.Trim(); sfp.POSID = int.Parse(((DropDownList)gvPerson.Rows[e.RowIndex].FindControl("ddlPostion")).SelectedValue.Trim()); sfp.TEL = ((TextBox)gvPerson.Rows[e.RowIndex].FindControl("txtPhone")).Text.Trim(); if (!p.Update(sfp)) { JSHelper.Alert("更新失败!", this); } gvPerson.EditIndex = -1; GetPersonData(); }
protected void RefuseBtn_Click(object sender, EventArgs e) { int Mid = Convert.ToInt32(Session["Mid"]); int investid = Convert.ToInt32(Request.QueryString["investid"]); Admin_BLL.Shops_AuditBLL auditBLL = new Admin_BLL.Shops_AuditBLL(); int count = auditBLL.UpRefuse(investid, Mid); if (count > 0) { JSHelper.Alert(this, "拒绝通过"); Response.Redirect("Shops_Audit.aspx"); } }
protected void Unnamed_ServerClick(object sender, EventArgs e) { string name = Session["UserName"].ToString(); string pass = Session["PassWord"].ToString(); string oldpass = OldPass.Value; string newpass = NewPass.Value; string newpass1 = NewPass1.Value; if (oldpass != pass) { JSHelper.Alert("原密码错误"); return; } if (newpass == "" || newpass1 == "") { JSHelper.Alert("密码不能为空"); return; } if (newpass != newpass1) { JSHelper.Alert("两次密码输入不一致"); return; } if (admin.UpdatePass(newpass, name) > 0) { JSHelper.Alert("修改成功"); Response.Redirect("Login.aspx"); } else { JSHelper.Alert("修改失败"); } //int id = Convert.ToInt32(Session["id"]); //string newpass = NewPass.Value; //string oldpass = OldPass.Value; //int pass = Convert.ToInt32(Session["PassWord"]); //if(Convert.ToInt32(oldpass)!=pass) //{ // JSHelper.Alert("旧密码错误"); //} //if (Convert.ToInt32(admin.UpdatePass( oldpass, id)) == 1) //{ // JSHelper.Alert("密码修改成功"); //} //else //{ // JSHelper.Alert("密码修改失败"); //} }
protected void lvAdminList_ItemUpdating(object sender, ListViewUpdateEventArgs e) { NewModel newModel = new NewModel(); newModel.ID = e.Keys["id"].ToString(); newModel.UserName = e.NewValues["UserName"].ToString(); //newModel.PassWord = e.NewValues["PassWord"].ToString(); if (admin.UpdateAdmin(newModel) == 1) { lvAdminList.EditIndex = -1; BindAdmin(); return; } JSHelper.Alert("更新失败"); }
protected void lvNewList_ItemDeleting(object sender, ListViewDeleteEventArgs e) { int id = Convert.ToInt32(e.Keys["id"]); if (Convert.ToInt32(admin.DeleteProduct(id)) == 1) { JSHelper.Alert("删除成功"); BindProducts(); } else { JSHelper.Alert("删除失败"); return; } }
protected void lvNewList_ItemUpdating(object sender, ListViewUpdateEventArgs e) { NewModel newModel = new NewModel(); newModel.ProID = e.Keys["id"].ToString(); newModel.ProName = e.NewValues["name"].ToString(); newModel.ProType = e.NewValues["type"].ToString(); if (admin.UpdateProduct(newModel) == 1) { lvProductList.EditIndex = -1; BindProducts(); return; } JSHelper.Alert("更新失败"); }
protected void lvMessage_ItemDeleting(object sender, ListViewDeleteEventArgs e) { int id = Convert.ToInt32(e.Keys["id"]); if (Convert.ToInt32(news.DeleteMess(id)) == 1) { JSHelper.Alert("删除成功"); Mess(); } else { JSHelper.Alert("删除失败"); return; } }
protected void lvNewList_ItemUpdating(object sender, ListViewUpdateEventArgs e) { NewModel newModel = new NewModel(); newModel.Id = e.Keys["id"].ToString(); newModel.Title = e.NewValues["title"].ToString(); newModel.Type = e.NewValues["type"].ToString(); newModel.DateTime = e.NewValues["datetime"].ToString(); if (admin.UpdateNew(newModel) == 1) { lvNewList.EditIndex = -1; BindNewList(); return; } JSHelper.Alert("更新失败"); }
protected void btnEditUsergroup_Click(object sender, EventArgs e) { if (gridUser.Selection.Count <= 0) { JSHelper.Alert("请至少选择一个用户!", this); } else { if (Session["UserIDList"] != null) { Session.Remove("UserIDList"); } List <object> keyValues = gridUser.GetSelectedFieldValues("USERID"); Session["UserIDList"] = keyValues; JSHelper.ShowModalDialogWindow("EditUserGroup.aspx", 300, 200, 300, 450, this); } }
private void Update() { NewModel newModel = new NewModel(); newModel.Title = title.Value; newModel.Content = content.Value; newModel.Type = type.Value; //newModel.DateTime = datetime.Value; newModel.Id = Request["id"]; if (admin.UpdateNew(newModel) == 0) { JSHelper.Alert("更新失败"); } else { JSHelper.Alert("更新成功"); } }
//public void Bind() //{ // string username = user.Value; // string password = pwd.Value; // if (username == "" || password == "") // { // JSHelper.Alert("用户名或密码不正确"); // return; // } // string sql = $"select * from AdminUser where UserName='******' and PassWord='******'"; // DataTable dt = SqlHelper.GetDataTable(sql); // int sq = dt.Rows.Count; // if (sq >= 1) // { // string Lv = dt.Rows[0]["Level"].ToString(); // Session["Level"] = Lv; // JSHelper.Alert("登陆成功"); // Response.Redirect($"index.aspx?Level={Lv}"); // } // else // { // JSHelper.Alert("用户名或密码错误"); // } //} protected void Unnamed_ServerClick(object sender, EventArgs e) { //Session["UserName"] = user.Value; //Session["PassWord"] = pwd.Value; //Bind(); AdminUserBLL adUser = new AdminUserBLL(); //string userName = user.Value; //string passWord = pwd.Value; //SqlDataReader dr = adUser.UserLoginCheck(userName, passWord); //if (dr.Read()/*adUser.UserLoginCheck(userName, passWord)*/) //{ // Session["UserName"] = user.Value; // Session["ID"] = Convert.ToInt32(dr["id"]); // Session["PassWord"] = pwd.Value; // dr.Close(); // Response.Redirect("Index.aspx"); //} //else //{ // JSHelper.Alert("账号或密码不正确"); // dr.Close(); // return; //} string name = user.Value; string pass = pwd.Value; DataTable dt = adUser.UserLoginCheck(name, pass); if (adUser.UserLoginCheck(name, pass).Rows.Count == 1) { Session["UserName"] = name; Session["PassWord"] = pass; Session["id"] = dt.Rows[0]["id"].ToString(); Session["level"] = dt.Rows[0]["level"].ToString(); Response.Redirect("index.aspx"); } else { JSHelper.Alert("账号或密码不正确"); } }
protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName == "Delete") { int Uid = Convert.ToInt32(e.CommandArgument); UserListBLL userListBLL = new UserListBLL(); int count = userListBLL.delete(Uid); if (count > 0) { JSHelper.Alert(this, "删除成功"); BindUser(); } else { JSHelper.Alert(this, "删除失败"); } } }
protected void UPdateEdit_Click(object sender, EventArgs e) { string SessionName = Session["Name"].ToString(); administatorsModel model = new administatorsModel(); model.midName = IdmidName.Value; model.Sex = Convert.ToInt32(IdSex.Value); model.Age = Convert.ToInt32(IdAge.Value); model.mphone = Idmphone.Value; model.mailbox = Idmailbox.Value; Admin_BLL.admin_infoBLL infoBLL = new Admin_BLL.admin_infoBLL(); int count = infoBLL.Updateadministators(model, SessionName); if (count > 0) { JSHelper.Alert(this, "修改成功"); } }
protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName == "update") { int sbefore = 0; int Id = Convert.ToInt32(e.CommandArgument); advertisingBLL advertisingBLL = new advertisingBLL(); int count = advertisingBLL.Update(Id, sbefore); if (count > 0) { BindAdv(); } } if (e.CommandName == "delete") { int Id = Convert.ToInt32(e.CommandArgument); advertisingBLL advertisingBLL = new advertisingBLL(); int count = advertisingBLL.delete(Id); if (count > 0) { JSHelper.Alert(this, "删除成功"); BindAdv(); } else { JSHelper.Alert(this, "删除失败"); } } if (e.CommandName == "update1") { int sbefore = 1; int Id = Convert.ToInt32(e.CommandArgument); advertisingBLL advertisingBLL = new advertisingBLL(); int count = advertisingBLL.Update(Id, sbefore); if (count > 0) { BindAdv(); } } }
protected void btnAddPerson_Click(object sender, EventArgs e) { User usersCrud = new User(); SF_User user = new SF_User(); if (txtPwd.Text != "" && ddlUserGroup.SelectedValue != "-1") { int usercount = 0; string userName = ""; user.PassWord = SecurityEncryption.MD5(txtPwd.Text.Trim(), 32); int roleID = 0; roleID = Convert.ToInt32(ddlRole.SelectedValue); user.UserGroupID = Convert.ToInt32(ddlUserGroup.SelectedValue); user.UserStatus = ddlState.SelectedValue; for (int i = 0; i < xlstSelected.Items.Count; i++) { user.UserName = xlstSelected.Items[i].Value.ToString(); user.PersonNumber = xlstSelected.Items[i].Value.ToString(); if (!usersCrud.UserExists(user.UserName)) { int n = (int)usersCrud.CreateUser(user); if (n >= 1) { if (roleID != 0) { usersCrud.AddUserRole(n, roleID); } } usercount++; } else { userName += user.UserName + ","; } } JSHelper.Alert(string.Format("共添加{0}个用户!", usercount), this); } else { JSHelper.Alert("初始化信息请填写完整!", this); } }
protected void btnSend_Click(object sender, EventArgs e) { //if (txtPhone.Text != "" && txtSms.Text != "") //{ // string msg = Sms.Send(txtPhone.Text.Trim(), txtSms.Text.Trim(),SmsType.Other,"123",""); // if ( msg== "1") // { // JSHelper.Alert("发送成功!", this); // } // else // { // msg = @"发送失败!原因如下:\n" + msg; // JSHelper.Alert(msg, this); // } //} //else //{ System.Threading.Thread.Sleep(5000); List <string> lst = XmlHelper.ReadXml(this, "App_Data", "person.xml"); ListBox lstSelected = new ListBox(); foreach (string str in lst) { if (str != "") { lstSelected.Items.Add(str.Trim()); } } foreach (ListItem item in lstSelected.Items) { txtSms.Text += item.Value; } int count = 0; for (int i = 0; i < 1000000; i++) { count++; } JSHelper.Alert(@count.ToString(), this); //} }
protected void lvAdminList_ItemDeleting(object sender, ListViewDeleteEventArgs e) { //int id = Convert.ToInt32(e.Keys["id"]); //string name = e.Values["UserName"].ToString(); //if (Session["userName"].ToString()==name/*Convert.ToInt32(admin.DeleteAdmin(id)) == 1*/) //{ // JSHelper.Alert("不能删除当前账号"); // return; //} string name = Session["UserName"].ToString(); string id = e.Keys["id"].ToString(); string Slevel = Session["Level"].ToString(); //string level =e.Values["Level"].ToString(); if (id == admin.SelectAdmin("-1", name).Rows[0]["id"].ToString()) { JSHelper.Alert("当前账号正在使用,不能删除"); return; } //if (level == "1") //{ // JSHelper.Alert("不能删除超级管理员"); // return; //} if (Slevel == "2") { JSHelper.Alert("权限不足,不能删除该账号"); return; } if (admin.DeleteAdmin(id) == 1) { JSHelper.Alert("删除成功"); BindAdmin(); return; } else { JSHelper.Alert("删除失败"); } }
public void InsertMessage() { NewModel newModel = new NewModel { Name = name.Value, MContent = content.Value, Tel = tel.Value }; string name1 = name.Value; if (string.IsNullOrEmpty(name1)) { JSHelper.Alert("昵称不能为空"); return; } string content1 = content.Value; if (string.IsNullOrEmpty(content1)) { JSHelper.Alert("内容不能为空"); return; } string tel1 = tel.Value; if (string.IsNullOrEmpty(tel1)) { JSHelper.Alert("联系方式不能为空"); return; } if (news.InsertMess(newModel) == 1) { JSHelper.Alert("发布成功"); name.Value = string.Empty; content.Value = string.Empty; } else { JSHelper.Alert("发布失败"); } Mess(); }