protected void Button1_Click(object sender, EventArgs e) { DataAccess da = new DataAccess(); string username = UserName.Text; if (username == "") { Jscript.Alert("用户名不能为空"); return; } string realname = RealName.Text; if (realname == "") { Jscript.Alert("姓名不能为空"); return; } string password = pwd.Text; password = StringUtil.EncryptPassword(password, "MD5"); string youxiao = Youxiao.Checked ? "1" : "0"; string superType = Superman.Checked ? "1" : "0"; string quan = "," + Request.Form["innerc"] + ","; if (ViewState["editmode"] != null) { da.RunSql("update tm_Admin set realname='" + realname + "',AdminPurview='" + quan + "',isused=" + youxiao + ",supertype=" + superType + " where username='******'"); if (pwd.Text.Trim() != "") { da.RunSql("update tm_Admin set pwd='" + password + "' where username='******'"); } } else { da.RunSql("insert into tm_Admin(username,realname,pwd,AdminPurview,isUsed,supertype) values('" + username + "','" + realname + "','" + password + "','" + quan + "'," + youxiao + "," + superType + ")"); } Jscript.AlertAndRedirect("成功新增管理员!", "Adminlist.aspx"); }
protected void Page_Load(object sender, EventArgs e) { string successMessage = IRequest.GetFormString("successMessage"); string successUrl = IRequest.GetFormString("successUrl"); string errorMessage = IRequest.GetFormString("errorMessage"); if ((IRequest.GetFormString("Js_RealName").Length <= 1) || (IRequest.GetFormString("Js_Tel").Length <= 1) || (IRequest.GetFormString("Js_Email").Length <= 1)) { Jscript.AlertAndBack(errorMessage); } else { try { using (ISession session = dbContext.Current().GetContext("SqlDb").GetSession()) { SqlDb.Dcms_JobSeeker jobSeeker = new SqlDb.Dcms_JobSeeker(); jobSeeker.Js_AddTime = DateTime.Now; UpdateModelByForm(jobSeeker, Request.Form); session.Create(jobSeeker); } Jscript.AlertAndRedirect(successMessage, successUrl); } catch { Jscript.AlertAndBack(errorMessage); } } }
/// <summary> /// 彻底删除按钮处理事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnDelete_Click(object sender, EventArgs e) { string ciids = hdClientInfoIDs.Value; hdClientInfoIDs.Value = ""; if (!MLMGC.COMP.StringUtil.IsStringArrayList(ciids))//判断格式是否正确 格式:1,21,321 { HttpContext.Current.Response.Write("参数错误"); return; } E_ItemClientInfo data = new E_ItemClientInfo(); data.EnterpriseID = EnterpriceID; data.ClientInfoIDs = ciids; bool flag = new T_ItemClientInfo().ThoroughDelete(data); if (flag) { Jscript.AlertAndRedirect(this, "删除成功", "Recycled.aspx"); } else { Jscript.ShowMsg("删除失败", this); } }
/// <summary> /// 提交退出申请 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSubmit_Click(object sender, EventArgs e) { string reason = txtReason.Text.Trim(); if (string.IsNullOrEmpty(reason)) { Jscript.ShowMsg("请输入退出理由!", this); return; } E_ItemApply data = new E_ItemApply(); data.ItemID = itemid; data.UserID = UserID; data.ApplyType = EnumApplyType.申请退出; data.Reason = reason; bool flag = new T_ItemApply().Add(data); if (flag) { Jscript.AlertAndRedirect(this, "申请成功", "itemlist.aspx"); } else { Jscript.ShowMsg("申请失败", this); } }
public void update() { if (this.TextBox1.Text.Trim() == string.Empty) { Jscript.Alert("投票信息标题不能为空!", this.Page); } else if (this.Text1.Value.Trim() == string.Empty) { Jscript.Alert("到期时间不能为空!", this.Page); } else { HXD.SQLServerDAL.tb_U_TouPiao toupiaodal = new HXD.SQLServerDAL.tb_U_TouPiao(); //投票操作类 HXD.Model.tb_U_TouPiao toupiaomodel = new HXD.Model.tb_U_TouPiao(); //投票属性类 toupiaomodel.id = id; toupiaomodel.title = this.TextBox1.Text.Trim(); toupiaomodel.is_Examine = this.CheckBox1.Checked ? 1 : 0; //是否审核 toupiaomodel.is_Recommendation = this.CheckBox2.Checked ? 1 : 0; //是否推荐 toupiaomodel.end_time = Convert.ToDateTime(this.Text1.Value); toupiaomodel.VoteType = this.RadioButton1.Checked ? 1 : 2; if (toupiaodal.Update(toupiaomodel)) { Jscript.AlertAndRedirect("投票信息修改成功!", "TouPiaoList.aspx?Page=" + Pages); } else { Jscript.Alert("投票信息修改失败!", Page); return; } } }
protected void Button1_Click(object sender, EventArgs e) { if (this.TextBox1.Text.Trim() == string.Empty) { Jscript.Alert("投票信息标题不能为空!", this.Page); } else if (this.Text1.Value.Trim() == string.Empty) { Jscript.Alert("到期时间不能为空!", this.Page); } else { HXD.SQLServerDAL.tb_U_TouPiao toupiaodal = new HXD.SQLServerDAL.tb_U_TouPiao(); //投票操作类 HXD.Model.tb_U_TouPiao toupiaomodel = new HXD.Model.tb_U_TouPiao(); //投票属性类 toupiaomodel.title = this.TextBox1.Text.Trim(); toupiaomodel.is_Examine = this.CheckBox1.Checked ? 1 : 0; toupiaomodel.is_Recommendation = this.CheckBox2.Checked ? 1 : 0; toupiaomodel.end_time = Convert.ToDateTime(this.Text1.Value); toupiaomodel.VoteType = this.RadioButton1.Checked ? 1 : 2; if (toupiaodal.Add(toupiaomodel)) { Jscript.AlertAndRedirect("投票信息添加成功!", "TouPiaoList.aspx?Page=" + Pages); } else { Jscript.Alert("投票信息添加失败!", this.Page); } } }
protected void databind() { //获取个人信息,判断他的信息是否完善,如果不完善,跳转到个人资料页面进行填写。 E_Personal dataPersonal = new E_Personal(); dataPersonal.UserID = UserID; dataPersonal.PersonalID = PersonalID; dataPersonal = new T_Personal().GetModel(dataPersonal); if (dataPersonal == null) { Response.Redirect("../main.aspx"); } //判断资料是否完善 if (!new T_Personal().IsPerfect(dataPersonal)) { Jscript.AlertAndRedirect(this, "个人信息不完善", "../Modify.aspx"); return; } //获取文库目录分类 DataTable dt = new T_WenKuClass().GetList(); if (dt == null) { return; } //绑定目录分类 foreach (DataRow row in dt.Rows) { ddlCategory.Items.Add(new ListItem(row["WenKuClassName"].ToString(), row["WenKuClassID"].ToString())); } ddlCategory.Items.Add(new ListItem("其它", "0")); }
protected void btn_CreatTable_Click(object sender, EventArgs e) { SHUniversity.KPI.Model.Users u = (SHUniversity.KPI.Model.Users)Session["SHUUser"]; //lb_msg bool r = kpiBll.Exists(u.WorkID, DateTime.Now.Year); if (r) { Jscript.Alert("本年度已经创建了考核表,不能重复创建"); } else { SHUniversity.KPI.Model.UserKPI kpi = new SHUniversity.KPI.Model.UserKPI(); kpi.CreatDate = DateTime.Now; kpi.Creator = u.Name; kpi.KPINumber = SHUniversity.KPI.Common.CreatRandom(); kpi.KPIYear = DateTime.Now.Year; kpi.Status = 0;//0未审核1正在审核2审核通过3退回 kpi.WorkID = u.WorkID; int result = kpiBll.Add(kpi); if (result > 0) { Jscript.AlertAndRedirect("建表成功", "/Home.aspx"); } else { } } }
protected void databind() { //获取文库编号 int id; if (!int.TryParse(Request["id"], out id)) { Jscript.AlertAndRedirect(this, "参数错误", "List.aspx"); return; } //根据编号获取文库详情 E_WenKu data = new E_WenKu(); data.WenKuID = id; data = new T_WenKu().GetModel(data); if (data == null) { Jscript.ShowMsg("未获取对象", this); return; } //判断swf文件是否存在,若不存在,则直接返回 string flashpath = MLMGC.COMP.Config.GetWenKu("swf\\" + data.FileUrl.Substring(0, data.FileUrl.LastIndexOf(".")) + ".swf"); if (!File.Exists(flashpath)) { Jscript.CloseWindow("对应的文件未找到:"+flashpath); return; } lblCaption.Text = data.Caption; lblIntro.Text = data.Intro; lblKeyword.Text = data.Keywords; lblSize.Text = MLMGC.COMP.CommonMethod.FileSize(data.FileSize); FlashUrl = Config.GetWenKuUrl("swf/"+data.FileUrl.Substring(0, data.FileUrl.LastIndexOf(".")) + ".swf"); }
protected void Page_Load(object sender, EventArgs e) { if (Session["SHUUser"] == null) { Jscript.AlertAndRedirect("未登录或登录超时,请重新登录", "/Login.aspx"); Response.End(); } u = (SHUniversity.KPI.Model.Users)Session["SHUUser"]; if (!IsPostBack) { //lb_msg bool r = kpiBll.Exists(u.WorkID, DateTime.Now.Year); if (r) { lb_msg.Text = "已建表"; lb_msg.ForeColor = System.Drawing.Color.Green; btn_CreatTable.Enabled = false; } else { lb_msg.Text = "未建表"; lb_msg.ForeColor = System.Drawing.Color.Red; btn_CreatTable.Enabled = true; } rp_table.DataSource = kpiBll.GetList(" WorkID='" + u.WorkID + "'").Tables[0]; rp_table.DataBind(); } }
/// <summary> /// 判断是否已经登录,下面将验证是否具有一定的角色 /// </summary> /// <param name="isparent">表示当前页面为几级页面,如果为根目录一层就为0,为根目录文件夹下面一层的为1</param> public static void ReturnLogin(int isparent) { string url = "login.aspx"; switch (isparent) { case 0: url = "/Manager/" + url; break; case 1: url = "/Manager/" + url; break; case 2: url = "/Manager/" + url; break; case 3: url = "/Manager/" + url; break; case 4: url = "/Manager/" + url; break; } Jscript.AlertAndRedirect("您没有任何权限访问此页面!请您重新登录或者和管理员进行联系!!", url); }
/// <summary> /// 还原到共享池处理事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnRestore_Click(object sender, EventArgs e) { string ciids = hdClientInfoIDs.Value; hdClientInfoIDs.Value = ""; if (!MLMGC.COMP.StringUtil.IsStringArrayList(ciids))//判断格式是否正确 格式:1,21,321 { HttpContext.Current.Response.Write("参数错误"); return; } E_ClientInfo data = new E_ClientInfo(); data.EnterpriseID = EnterpriceID; data.Mode = EnumClientMode.共享; data.Status = EnumClientStatus.共享; data.EPUserTMRID = EPUserTMRID; data.ClientInfoIDs = ciids; bool flag = new T_ClientInfoHelper().LeaderRestore(data); if (flag) { Jscript.AlertAndRedirect(this, "还原成功", "Recycled.aspx"); } else { Jscript.ShowMsg("还原失败", this); } }
/// 发布资讯 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnRelease_Click(object sender, EventArgs e) { if (Session["loginUser"] == null) { Jscript.AlertAndRedirect("请登录", "/admin/login.aspx"); return; } string peopleCount = txtPeopleCount.Text.Trim(); if (peopleCount.Length == 0) { lblError.Text = "请输入招聘人数"; return; } Invite item = new Invite(); item.inviteType = 0; try { item.inviteType = Convert.ToInt32(txtPeopleCount.Text.Trim()); } catch (Exception je) { lblError.Text = "招聘人数输入错误"; return; } item.inviteName = txtTitle.Text.Trim(); item.inviteInfo = this.content1.Value; item.inviteDesc = txtZhaiYao.Value.Trim(); txtHidInfo.Text = item.inviteInfo; item.inforemark = txtHidInfo.Text.Trim(); txtHidInfo.Text = item.inviteDesc; item.descremark = txtHidInfo.Text; item.addTime = DateTime.Now; item.status = 0; if (id != 0) { item.id = id; if (InviteService.Update(item)) { Jscript.AlertAndRedirect("修改成功", "inviteInfo.aspx"); } else { Jscript.AlertAndRedirect("修改失败", "inviteInfo.aspx"); } } else { int num = InviteService.Add(item); if (num > 0) { Jscript.AlertAndRedirect("添加成功", "inviteInfo.aspx"); } else { Jscript.AlertAndRedirect("添加失败", "inviteInfo.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { //获取品搜用户数据 long userid = Requests.GetQueryLong("userid", 0); string username = Requests.GetQueryString("username"); E_PinsouUser data = new E_PinsouUser(); data.Pinsou_UserID = userid; data.UserName = username; //去品搜数据库验证用户编号和用户名是否正确 DataTable dt = new T_User().Pinsou_Verification(data); //判断用户编号和用户名是否正确 if (dt != null && dt.Rows.Count == 1) { DataRow row = dt.Rows[0]; string email = row["Email"].ToString(); //再判断邮箱是否存在 if (string.IsNullOrEmpty(email)) { Jscript.ShowMsg("邮箱不存在,无法注册!", this); return; } //验证通过后,继续注册 data.Pinsou_UserID = Convert.ToInt32(row["userid"]); data.Email = email; data.Password = EncryptString.EncryptPassword(row["password"].ToString()); data.Mobile = row["mobile"].ToString(); data.Fax = row["fax"].ToString(); int result = new T_User().Pinsou_AutoRegister(data); if (result == -1)//邮箱已存在 { Jscript.ShowMsg("邮箱不存在,无法注册!", this); return; } else if (result == 0) //注册失败 { Jscript.ShowMsg("注册失败!", this); return; } else //注册成功直接跳转 { E_PersonalUser dataPU = new E_PersonalUser(); dataPU.UserID = data.mlb_UserID; dataPU.PersonalID = data.PersonalID; dataPU.UserName = data.Email; dataPU.Password = data.Password; new MLMGC.Security.PersonalPage().Login(dataPU); Jscript.AlertAndRedirect(this, "注册成功", "../Personal/Default.aspx"); } } else { Jscript.ShowMsg("用户编号和用户名错误!", this); return; } }
/// <summary> /// 绑定页面数据 /// </summary> protected void databind() { int ciid = Requests.GetQueryInt("ciid", 0); //-----------------绑定基本信息------------------------------ E_ClientInfo data = new T_ClientInfo().GetModel(new E_ClientInfo() { EnterpriseID = EnterpriceID, ClientInfoID = ciid, EPUserTMRID = 0 }); if (data == null) { Jscript.AlertAndRedirect(this, "信息不存在", "ClientInfoSearch.aspx"); return; } ltClientName.Text = data.ClientName; ltAddress.Text = data.Address; ltZipCode.Text = data.ZipCode; ltLinkman.Text = data.Linkman; ltPosition.Text = data.Position; ltEmail.Text = data.Email; ltTel.Text = data.Tel; ltMobile.Text = data.Mobile; hlWebsite.NavigateUrl = data.Website.IndexOf("http://") == -1?"http://" + data.Website:data.Website; hlWebsite.Text = data.Website; ltFax.Text = data.Fax; ltRemark.Text = data.Remark; //-----------------绑定名录属性------------------------------ Property1.SourceID = data.SourceID; Property1.TradeID = data.TradeID; Property1.AreaID = data.AreaID; //-----------------绑定状态------------------------------ ltStatus.Text = data.Status.ToString(); //hdStatus.Value = ((int)data.Status).ToString(); ////----------------绑定沟通记录--------------------- //rpExchangeList.DataSource = new T_Exchange().GetList(new E_Exchange() { EnterpriseID = EnterpriceID, ClientItemID = ciid }); //rpExchangeList.DataBind(); //----------------调查问卷---------------- DataSet ds = new T_Question().List(new MLMGC.DataEntity.Enterprise.Material.E_Question() { EnterpriseID = EnterpriceID, ClientInfoID = ciid }); if (ds != null && ds.Tables.Count == 2) { dtItem = ds.Tables[1]; rpList.DataSource = ds.Tables[0]; rpList.DataBind(); } //----------------获取当前用户角色信息---------------- int roleid = new T_User().GetEPRoleID(new E_EnterpriseUser() { EnterpriseID = EnterpriceID, EPUserTMRID = EPUserTMRID }); btnMyGet.Visible = (roleid == (int)EnumRole.销售人员); IsShowExchange = !(roleid == (int)EnumRole.销售人员);//销售人员不能查看沟通记录 }
protected void Page_Load(object sender, EventArgs e) { string successMessage = IRequest.GetFormString("successMessage"); string successUrl = IRequest.GetFormString("successUrl"); string errorMessage = IRequest.GetFormString("errorMessage"); string errorCodeMessage = IRequest.GetFormString("errorCodeMessage"); bool hasValidCode = false; string ValidCode = string.Empty; for (int i = 0; i < Request.Form.Keys.Count; i++) { if (Request.Form.Keys[i].ToLower() == "validcode") { hasValidCode = true; ValidCode = IRequest.GetFormString("ValidCode"); break; } } if ((hasValidCode) && (ValidCode != Convert.ToString(SessionHelper.Get("ValidCode")))) { Jscript.AlertAndBack(errorCodeMessage); Response.End(); } if ((IRequest.GetFormString("User_Name").Trim().Length <= 1) || (IRequest.GetFormString("Password1").Trim().Length < 6) || (IRequest.GetFormString("Password1") != IRequest.GetFormString("Password2"))) { Jscript.AlertAndBack(errorMessage); } else { try { using (ISession session = dbContext.Current().GetContext("SqlDb").GetSession()) { SqlDb.Dcms_User user = new SqlDb.Dcms_User(); UpdateModelByForm(user, Request.Form); user.User_RegTime = DateTime.Now; user.User_InVisible = 1; user.User_PassWord = IRequest.GetFormString("Password1").Trim(); user.User_Gender = IRequest.GetFormString("User_Gender").Trim(); user.User_RegIp = Utility.GetIPAddress(); user.User_LastIp = Utility.GetIPAddress(); user.User_LastTime = DateTime.Now; user.User_BirthDay = DateTime.Now; session.Create(user); SessionHelper.Add("UserId", session.ExecuteScalar("select max(user_id) from dcms_user")); Utils.WriteCookie("UserId", session.ExecuteScalar("select max(user_id) from dcms_user")); SessionHelper.Add("UserName", IRequest.GetFormString("User_Name").Trim()); Utils.WriteCookie("UserNmae", IRequest.GetFormString("User_Name").Trim()); } Jscript.AlertAndRedirect(successMessage, successUrl); } catch { Jscript.AlertAndBack(errorMessage); } } }
protected void Page_Load(object sender, EventArgs e) { SHUniversity.KPI.Model.Users currUser = new SHUniversity.KPI.Model.Users(); if (Session["SHUAdmin"] == null && Session["SHUManage"] == null) { Jscript.AlertAndRedirect("未登录或登录超时,请重新登录", "/Login.aspx"); Response.End(); } else { currUser = Session["SHUUser"] as SHUniversity.KPI.Model.Users; } Tid = Common.StrToInt(Request.QueryString["id"], -1); if (Tid < 0) { Jscript.AlertAndRedirect("无法找到考核表信息", "../Home.aspx"); return; } List <SHUniversity.KPI.Model.KPIItems> list = bll.GetModelList(" KPINO= " + Tid); if (list.Count > 0) { rp_cxsy.DataSource = list.Where(m => m.ItemType == "大学生创新实验项目").ToList(); rp_cxsy.DataBind(); rp_xkjs.DataSource = list.Where(m => m.ItemType == "学科竞赛").ToList(); rp_xkjs.DataBind(); rp_dsz.DataSource = list.Where(m => m.ItemType == "导师制").ToList(); rp_dsz.DataBind(); rp_jxgg.DataSource = list.Where(m => m.ItemType == "教学改革").ToList(); rp_jxgg.DataBind(); rp_jxhj.DataSource = list.Where(m => m.ItemType == "教学获奖").ToList(); rp_jxhj.DataBind(); rp_jxlw.DataSource = list.Where(m => m.ItemType == "教学论文").ToList(); rp_jxlw.DataBind(); rp_KYXM.DataSource = list.Where(m => m.ItemType == "科研项目").ToList(); rp_KYXM.DataBind(); rp_KYLW.DataSource = list.Where(m => m.ItemType == "科研论文").ToList(); rp_KYLW.DataBind(); rp_KYCB.DataSource = list.Where(m => m.ItemType == "著作出版").ToList(); rp_KYCB.DataBind(); rp_KJJL.DataSource = list.Where(m => m.ItemType == "科技奖励").ToList();// rp_KJJL.DataBind(); rp_KL.DataSource = list.Where(m => m.ItemType == "专利").ToList(); rp_KL.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { string successMessage = IRequest.GetFormString("successMessage"); string successUrl = IRequest.GetFormString("successUrl"); string errorMessage = IRequest.GetFormString("errorMessage"); string errorCodeMessage = IRequest.GetFormString("errorCodeMessage"); bool hasValidCode = false; string ValidCode = string.Empty; for (int i = 0; i < Request.Form.Keys.Count; i++) { if (Request.Form.Keys[i].ToLower() == "validcode") { hasValidCode = true; ValidCode = IRequest.GetFormString("ValidCode"); break; } } if ((hasValidCode) && (ValidCode != Convert.ToString(SessionHelper.Get("ValidCode")))) { Jscript.AlertAndBack(errorCodeMessage); Response.End(); } if ((IRequest.GetFormString("GuestBook_UserName").Length <= 1) || (IRequest.GetFormString("GuestBook_Title").Length <= 1)) { Jscript.AlertAndBack(errorMessage); } else { try { using (ISession session = dbContext.Current().GetContext("SqlDb").GetSession()) { SqlDb.Dcms_GuestBook guestbook = new SqlDb.Dcms_GuestBook(); guestbook.GuestBook_AddTime = DateTime.Now; guestbook.GuestBook_State = "0"; UpdateModelByForm(guestbook, Request.Form); guestbook.GuestBook_UserIp = Utils.GetRealIP(); //StringBuilder sb = new StringBuilder(); //sb.Append(string.Format("标题:{0}<br />", guestbook.GuestBook_Title)); //sb.Append(string.Format("用户名:{0}<br />", guestbook.GuestBook_UserName)); //sb.Append(string.Format("邮箱:{0}<br />", guestbook.GuestBook_UserEmail)); //sb.Append(string.Format("电话:{0}<br />", guestbook.GuestBook_UserTel)); //sb.Append(string.Format("QQ/MSN:{0}<br />", guestbook.GuestBook_UserIM)); //sb.Append(string.Format("内容:{0}<br />", guestbook.GuestBook_Content)); //sendMail("***@35.cn", title, sb.ToString(), "***@35.cn","***@35.cn","******","mail.35.cn"); session.Create(guestbook); } Jscript.AlertAndRedirect(successMessage, successUrl); } catch { Jscript.AlertAndBack(errorMessage); } } }
/// <summary> /// 点击确定按钮处理事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSubmit_Click(object sender, EventArgs e) { string name = txtName.Text.Trim(); string password = txtPassword.Text.Trim(); string confirm = txtConfirm.Text.Trim(); if (string.IsNullOrEmpty(name)) { Jscript.ShowMsg("请输入用户名", this); return; } if (string.IsNullOrEmpty(password) & type == "add") { Jscript.ShowMsg("添加用户时必须输入密码", this); return; } if (password != confirm) { Jscript.ShowMsg("两次密码输入不一致", this); return; } E_Admin data = new E_Admin(); data.AdminID = id; data.UserName = name; data.Password = string.IsNullOrEmpty(password) ? "" : EncryptString.EncryptPassword(password); //先判断一下用户名是否存在 bool b = new T_Admin().Exists(data); if (b) { Jscript.ShowMsg("用户名已存在", this); return; } bool flag = false; if (type == "add") { flag = new T_Admin().Add(data); } else if (type == "update") { flag = new T_Admin().Update(data); } if (flag) { Jscript.AlertAndRedirect(this, "操作成功", "adminlist.aspx"); } else { Jscript.ShowMsg("操作失败", this); } }
protected void Button1_Click(object sender, EventArgs e) { if (Page.IsValid) { try { this.Label1.Text = ""; string pathid = this.DropDownList1.Text; string name_cn = getSafeTextBoxText(Name_Cn); string name_en = getSafeTextBoxText(Name_En); string title_cn = getSafeTextBoxText(Title_cn); string title_en = getSafeTextBoxText(Title_en); string zy_cn = getSafeTextBoxText(Zy_Cn); string zy_en = getSafeTextBoxText(Zy_en); string research_cn = getSafeTextBoxText(Research_cn); string research_en = getSafeTextBoxText(Research_en); string sequence = getSafeTextBoxText(Sequence); string intro_cn = this.Editor1.Value.Replace("'", "''"); string intro_en = this.Editor2.Value.Replace("'", "''"); string user_name = getSafeTextBoxText(User_name); string password = getSafeTextBoxText(Password); password = StringUtil.EncryptPassword(password, "MD5"); string photo = this.Photo.Text; if (name_cn == "") { this.Label1.Text = "<div class=\"boxdiv2\">姓名必须填写!</div>"; return; } if (QueryString.GetId == null) { string sql = "insert into [tm_teacher] (user_name,password,name_cn,name_en,photo,title_cn,zy_cn,research_cn,intro_cn,title_en,zy_en,research_en,intro_en,sequence,pathid) values('" + user_name + "','" + password + "','" + name_cn + "','" + name_en + "','" + photo + "','" + title_cn + "','" + zy_cn + "','" + research_cn + "','" + intro_cn + "','" + title_en + "','" + zy_en + "','" + research_en + "','" + intro_en + "','" + sequence + "','" + pathid + "')"; da.RunSql(sql); } else { string sql = "update tm_teacher set user_name='" + user_name + "',name_cn='" + name_cn + "',name_en='" + name_en + "',photo='" + photo + "',title_cn='" + title_cn + "',zy_cn='" + zy_cn + "',research_cn='" + research_cn + "',intro_cn='" + intro_cn + "',title_en='" + title_en + "',zy_en='" + zy_en + "',research_en='" + research_en + "',intro_en='" + intro_en + "',sequence='" + sequence + "',pathid='" + pathid + "' where id = " + QueryString.GetId; da.RunSql(sql); if (getSafeTextBoxText(Password) != "") { da.RunSql("update tm_teacher set password = '******' where id=" + QueryString.GetId); } } Jscript.AlertAndRedirect("保存成功!", "Teacher_List.aspx"); } catch { this.Label1.Text = "<div class=\"boxdiv2\">提交失败!</div>"; } finally { this.Image1.ImageUrl = "include/images/nonebig.gif"; } } }
/// <summary> /// 判断是否已经登录,下面将验证是否具有一定的角色 /// </summary> /// <param name="isparent">表示当前页面为几级页面,如果为根目录一层就为0,为根目录文件夹下面一层的为1</param> public static bool CheckLogin(int isparent) { string cname = ConfigHelper.GetConfigString("AdminLogin"); Cookie c = new Cookie(); string str = c.getCookie(cname); if (str == "") { string url = "LuntanLogin.aspx.aspx"; switch (isparent) { case 0: url = "/Proscenium/Pass/" + url; break; case 1: url = "/Proscenium/Pass/" + url; break; case 2: url = "/Proscenium/Pass/" + url; break; case 3: url = "/Proscenium/Pass/" + url; break; case 4: url = "/Proscenium/Pass/" + url; break; case -1: url = "/Proscenium/Pass/" + url; break; } if (isparent == -1) { Jscript.RedirectTo(url); return(false); } else if (isparent == -2) //判断是否通过登录验证 { return(false); } else { Jscript.AlertAndRedirect("您未登录或者您的身份验证已经过期,请您重新登录或者与管理员联系!!", url); return(false); } } else { return(true); } }
protected void Page_Load(object sender, EventArgs e) { UserAuthorizationModel userInfo = UserAuthorization.userLogin(this.Page); if (userInfo.openId == null || userInfo.openId == "") { member = userInfo.mobile; } else { member = userInfo.openId; } ticketId = (string.IsNullOrEmpty(Request.QueryString["ticketId"]) ? 0 : int.Parse(Request.QueryString["ticketId"])); //预定数量 reserverCount = (string.IsNullOrEmpty(Request.QueryString["reserverCount"]) ? 0 : int.Parse(Request.QueryString["reserverCount"])); if (!IsPostBack) { var bll = new LVWEIBA.DAL.ProviderSpot(); ViewState["ticketId"] = ticketId; if (ticketId == 0 || reserverCount == 0) { Jscript.AlertAndRedirect("请选择合适的票数", "ticket.aspx"); } else { LVWEIBA.Model.ProviderSpot providerSpot = bll.GetModel(ticketId); ticketTitle = providerSpot.SpotName; ticketId = providerSpot.ID; startDate = Convert.ToDateTime(providerSpot.BeginTime).ToString("yyyy年MM月dd号"); endDate = Convert.ToDateTime(providerSpot.EndTime).ToString("yyyy年MM月dd号"); orderPriceLbl.Text = "¥" + providerSpot.ZkPrice; string priceDetailStr = reserverCount + "张"; int maketPrice = (int)providerSpot.TicketPrice * reserverCount; int zkPrice = (int)providerSpot.ZkPrice * reserverCount; string str = string.Format(@"<p>市场价:¥{0}({1})</p> <p>优惠价:¥{2}({3})</p>", maketPrice, priceDetailStr, zkPrice, priceDetailStr); this.priceDetailLbl.Text = str; this.hid_count.Value = reserverCount.ToString(); this.hid_price_sc.Value = maketPrice.ToString(); this.hid_price_yh.Value = zkPrice.ToString(); this.hid_ticket_id.Value = ticketId.ToString(); this.hid_price_jj.Value = providerSpot.SellPrice.ToString(); HiddenFieldBZ.Value = str.Replace("<p>", "").Replace("</p>", ""); LVWEIBA.BLL.MemberHotel bllhotel = new LVWEIBA.BLL.MemberHotel(); List <LVWEIBA.Model.MemberHotel> lsthotel = bllhotel.GetModelList(" member='" + userInfo.mobile + "' or member='" + userInfo.openId + "'"); string strhotel = ""; foreach (MemberHotel item in lsthotel) { strhotel += string.Format(" <input id='Checkbox1' name='hotel' class='hotel' type='checkbox' value='{0}' />{1}", item.Id, item.Name); } contactPersonsLiteral.Text = strhotel; } } }
/// <summary> /// 绑定数据 /// </summary> protected void databind() { //判断用户是否已经申请过退出,若申请过,不允许再申请 bool flag = new T_ItemApply().Exists(new E_ItemApply() { ItemID = itemid, UserID = UserID, ApplyType = EnumApplyType.申请退出 }); if (flag) { Jscript.AlertAndRedirect(this, "你已经提交了退出申请,请耐心等待!", "itemlist.aspx"); } }
protected void databind() { //获取企业购买用户数量 int userAmount = (int)new MLMGC.BLL.Enterprise.T_Enterprise().Get(new MLMGC.DataEntity.Enterprise.E_Enterprise() { EnterpriseID = base.EnterpriceID }).UserAmount; ltUserAmount.Text = userAmount.ToString(); T_TeamModel blltm = new T_TeamModel(); E_TeamModel data = blltm.GetTeamScale(new E_TeamModel() { EnterpriseID = base.EnterpriceID }); if (data == null) { Jscript.AlertAndRedirect(this, "请先设置团队模型", "TeamModelSetUp.aspx"); return; } XmlDocument doc = new XmlDocument(); doc.LoadXml(data.TeamScaleXml); XmlNodeList root = doc.SelectNodes("root/item"); StringBuilder sb = new StringBuilder(); sb.Append("<table>"); foreach (XmlNode n in root) //遍历所有property节点 { if (n.Attributes["roleID"].Value.Equals("6")) //录入人员 { continue; } //dt.Columns.Add(n.Attributes["key"].Value); sb.Append(string.Format("<tr><td class='name'>{0}:</td>", n.ChildNodes[0].InnerText)); //增加名称 if (n.Attributes["readonly"].Value == "true") //显示数量不修改 { sb.Append("<td>" + n.ChildNodes[1].InnerText + "个</td>"); } else//否则为输入框供管理员修改部门数量 { sb.Append(string.Format("<td><input type='text' name='txtAmount{1}' class='inputAmount txt1 w50' value='{0}'/>个</td>", n.ChildNodes[1].InnerText, n.Attributes["roleID"].Value)); } sb.Append("</tr>"); } sb.Append("</table>"); LtSetting.Text = sb.ToString(); btnSubmit.Visible = root.Count > 2; }
/// <summary> /// 数据绑定 /// </summary> protected void databind() { E_EnterpriseDB data = new E_EnterpriseDB(); data.EnterpriseDBID = dbid; data = new T_EnterpriseDB().GetModel(data); if (data == null) { Jscript.AlertAndRedirect(this, "没有找到对象!", "List.aspx"); return; } txtDBName.Text = data.DBName; txtMaxNum.Text = data.MaxNum.ToString(); }
/// <summary> /// 点击确定按钮事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSubmit_Click(object sender, EventArgs e) { //获取界面数据 string name = txtItemName.Text.Trim(); string intro = txtItemIntro.Text.Trim(); string signature = txtSignature.Text.Trim(); string content = txtContent.Content; string established = txtEstablished.Text.Trim(); if (string.IsNullOrEmpty(name) || string.IsNullOrEmpty(content)) { Jscript.ShowMsg("请认真填写以上内容!", this); return; } E_Item data = new E_Item(); data.EnterpriseID = eid; data.ItemName = name; data.ItemIntro = intro; data.Signature = signature; data.ItemContent = content; data.SetStatus = Convert.ToInt32(rbStatus.SelectedValue); data.Photo = hdUrl.Value.Substring(hdUrl.Value.LastIndexOf("/") + 1); if (!string.IsNullOrEmpty(established)) { data.Established = Convert.ToDateTime(txtEstablished.Text.Trim()); } else { data.Established = DateTime.Now; } data.CityID = region.RegionID; bool flag = new T_Item().Update(data); //Jscript.ShowMsg(string.Format("保存{0}",flag?"成功":"失败"), this); if (flag) { //Jscript.ShowMsg("保存成功", this); databind(); Jscript.AlertAndRedirect(this, "修改成功", "ItemList.aspx?page=" + Requests.GetQueryString("page")); } else { Jscript.ShowMsg("保存失败", this); } }
/// <summary> /// 点击确定按钮事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnSubmit_Click(object sender, EventArgs e) { //获取界面数据 string name = txtDBName.Text.Trim(); //获取界面数据 int num; if (!int.TryParse(txtMaxNum.Text.Trim(), out num)) { Jscript.ShowMsg("参数错误", this); return; } E_EnterpriseDB data = new E_EnterpriseDB(); data.DBName = name; data.MaxNum = num; bool flag = false; if (type == "update") { data.EnterpriseDBID = dbid; flag = new T_EnterpriseDB().UpdateMaxNum(data); } else { //获取数据库文件存放位置 data.Path = Config.GetAppSettings("DBFilePath"); if (string.IsNullOrEmpty(data.Path)) { Jscript.ShowMsg("配置文件错误,没有找到DBFilePath", this); return; } flag = new T_EnterpriseDB().Add(data); } if (flag) { Jscript.AlertAndRedirect(this, "操作成功", "list.aspx"); } else { Jscript.ShowMsg("操作失败", this); } }
protected void Delete(int type) { E_Log data = new E_Log(); data.EnterpriseID = EnterpriceID; data.Type = type; bool flag = new T_Log().Delete(data); if (flag) { Jscript.AlertAndRedirect(this, "删除成功", "LogList.aspx"); } else { Jscript.ShowMsg("删除失败", this); } }
protected void Page_Load(object sender, EventArgs e) { string successMessage = IRequest.GetFormString("successMessage"); string successUrl = IRequest.GetFormString("successUrl"); string errorMessage = IRequest.GetFormString("errorMessage"); int UId = Utils.StrToInt(SessionHelper.Get("UserId"), 0); if (UId <= 0) { Jscript.AlertAndBack("登录超时"); return; } try { using (ISession session = dbContext.Current().GetContext("SqlDb").GetSession()) { SqlDb.Dcms_User user = new SqlDb.Dcms_User(); user.User_Id = UId; string UserPwd = IRequest.GetFormString("Password1").Trim(); string UserPwd1 = IRequest.GetFormString("Password2").Trim(); if (!UserPwd.Equals(UserPwd1)) { Jscript.AlertAndBack("二次输入的密码不相同."); return; } IQuery query = session.GetQuery(user).Where(SqlDb.Dcms_User._USER_ID_.EqulesExp()); List <SqlDb.Dcms_User> userList = query.GetList <SqlDb.Dcms_User>(); if (userList.Count == 1) { user = userList[0]; user.User_PassWord = UserPwd; session.Update(user); Jscript.AlertAndRedirect(successMessage, successUrl); } else { Jscript.AlertAndBack("修改失败."); } } } catch { Jscript.AlertAndBack(errorMessage); } }
/// <summary> /// 删除所有名录 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnDeleteAll_Click(object sender, EventArgs e) { E_ItemClientInfo data = new E_ItemClientInfo(); data.EnterpriseID = EnterpriceID; bool flag = new T_ItemClientInfo().ThoroughDeleteAll(data); if (flag) { Jscript.AlertAndRedirect(this, "删除成功", "Recycled.aspx"); } else { Jscript.ShowMsg("删除失败", this); } }