public string GetUserFace(string UserID) { BLL.CCOM.User_property bll = new BLL.CCOM.User_property(); String facePath = ""; try { Model.CCOM.User_property model = bll.GetModel(" User_id='" + UserID + "'"); facePath = model.UP_picture.Trim(); } catch { facePath = "/images/login/logo_left1.png"; } if (facePath.Trim() != "" && facePath.Trim().StartsWith("http")) { return("<img style=\"width:48px;\" src=\"" + facePath.Trim() + "\" alt=\"\" />"); } else { if (facePath.Trim() != "") { return("<img style=\"width:48px;\" src=\"" + DataDic.FILE_URL + facePath.Trim() + "\" alt=\"\" />"); } else { return("<img style=\"width:48px;\" src=\"/images/login/logo_left1.png\" alt=\"\" />"); } } }
protected void BindAllSubject() { userId = GetAdminInfo_CCOM().User_id; BLL.CCOM.User_property pbll = new BLL.CCOM.User_property(); Model.CCOM.User_property pmodel = pbll.GetModel("User_id=" + userId); int majorId = pmodel.Agency_id; //科目字典 BLL.CCOM.Subject bll = new BLL.CCOM.Subject(); try { List <Model.CCOM.Subject> subjectList = bll.GetModelList("Major_Agency_id=" + majorId); foreach (Model.CCOM.Subject subject in subjectList) { subjectDic.Add(subject.Subject_id, subject); } } catch (Exception e) { return; } //旧值字典 BLL.CCOM.User_subject_value vbll = new BLL.CCOM.User_subject_value(); try { List <Model.CCOM.User_subject_value> valueList = vbll.GetModelList("User_id=" + GetAdminInfo_CCOM().User_id); foreach (Model.CCOM.User_subject_value value in valueList) { if (!oldDic.ContainsKey(value.Subject_id)) { oldDic.Add(value.Subject_id, new Dictionary <int, Model.CCOM.User_subject_value>()); } if (value.Usv_children == null) { oldDic[value.Subject_id].Add(0, value); } else { oldDic[value.Subject_id].Add((int)value.Usv_children, value); } } } catch (Exception e) { return; } root = bll.GetModel("Major_Agency_id=" + majorId + "and Subject_level=0"); foreach (Model.CCOM.Subject Cmodel in subjectDic.Values) { if (Cmodel.Fs_id == root.Subject_id) { BindTest(Cmodel); } } }
public void Bind() { model = new BLL.CCOM.User_property().GetModel(" User_id = " + user_id); string text = ""; text += model.UP_CCOM_number + " " + new BLL.CCOM.User_infomation().GetModel(GetAdminInfo_CCOM().User_id).User_realname + " 同学"; this.div_msg.InnerHtml = text; text = "你今年报考是 " + getMajorName(); this.div_major.InnerHtml = text; text = getSubjectScore(); this.div_AEE.InnerHtml = text; }
public void Bind() { model = new BLL.CCOM.User_property().GetModel(" User_id = " + user_id); string text = ""; text += model.UP_CCOM_number + " " + new BLL.CCOM.User_infomation().GetModel(GetAdminInfo_CCOM().User_id).User_realname + " 同学"; this.div_msg.InnerHtml = text; text = "你今年报考是 " + getMajorName(); this.div_major.InnerHtml = text; int type = (int)model.UP_calculation_status; this.div_AEE.InnerHtml = getStudentStatus(type); }
public string GetAgency(string UserID) { BLL.CCOM.User_property bll = new BLL.CCOM.User_property(); string str = string.Empty; try { Model.CCOM.User_property model = bll.GetModel(" User_id='" + UserID + "'"); str = new BLL.CCOM.Agency().GetModel((int)model.Agency_id).Agency_name; } catch { str = "未设置"; } return(str); }
public string GetPolitics(string UserID) { BLL.CCOM.User_property bll = new BLL.CCOM.User_property(); string str = string.Empty; try { Model.CCOM.User_property model = bll.GetModel(" User_id='" + UserID + "'"); str = new BLL.CCOM.Politics().GetModel((int)model.UP_politics).Politics_name; } catch { str = "未设置"; } return(str); }
public string GetExamNumber(string UserID) { BLL.CCOM.User_property bll = new BLL.CCOM.User_property(); string str = string.Empty; try { Model.CCOM.User_property model = bll.GetModel(" User_id='" + UserID + "'"); str = model.UP_CEE_number; } catch { str = "未设置"; } return(str); }
protected void btnSubmit_Click(object sender, EventArgs e) { string phoneNumber = this.txtPhoneNumber.Text.Trim(); string password = this.txtUserPwd.Text.Trim(); string password_confer = this.txtUser_pasword_confer.Text.Trim(); if (phoneNumber.Length <= 0) { lblTip.Visible = true; lblTip.Text = "请填写手机号"; return; } if (phoneNumber.Length > 14 || !IsNumber(phoneNumber)) { lblTip.Visible = true; lblTip.Text = "请正确填写手机号"; return; } if (Tools.CheckParams(phoneNumber)) { lblTip.Visible = true; lblTip.Text = "手机号包含非法字符,请修改"; return; } //查询数据库中是否已经注册过 BLL.CCOM.User_infomation bll = new BLL.CCOM.User_infomation(); if (bll.GetRecordCount(" User_mobile='" + phoneNumber + "'") > 0) { lblTip.Visible = true; lblTip.Text = "该账号已被注册"; return; } if (password.Length <= 0) { lblTip.Visible = true; lblTip.Text = "请填写密码"; return; } if (password.Length < 6 || password.Length > 16 || !IsNumAndEnCh(password)) { lblTip.Visible = true; lblTip.Text = "请正确填写密码"; return; } if (Tools.CheckParams(password)) { lblTip.Visible = true; lblTip.Text = "密码包含非法字符,请修改"; return; } if (!password.Equals(password_confer)) { lblTip.Visible = true; lblTip.Text = "密码前后不一,请确认"; return; } if (Session[MyKeys.SESSION_PHONE_CODE] == null) { lblTip.Visible = true; lblTip.Text = "请获取手机验证码"; return; } if (Session[MyKeys.SESSION_PHONE_CODE].ToString() != this.txtSmsCode.Text) { lblTip.Visible = true; lblTip.Text = "手机验证码不正确"; return; } BLL.CCOM.Period period_bll = new BLL.CCOM.Period(); int open_year = DateTime.Now.Year; var period_model = period_bll.GetModel(" Period_state=1"); if (period_model != null) { try { open_year = int.Parse(period_model.Period_year); } catch { } } else { lblTip.Visible = true; lblTip.Text = "当前暂未开启注册"; return; } Model.CCOM.User_infomation UserModel = new Model.CCOM.User_infomation(); UserModel.User_mobile = phoneNumber; UserModel.User_password = DESEncrypt.MD5Encrypt(password); UserModel.User_type = 1; //默认为大陆考生 UserModel.User_status = true; //默认为启用状态 UserModel.User_addtime = DateTime.Now; UserModel.User_gender = false; //默认为男 UserModel.User_realname = "请填写姓名"; BLL.CCOM.User_infomation user_bll = new BLL.CCOM.User_infomation(); long _id = user_bll.Add(UserModel);//这里不知为什么返回值不是User_id; if (_id > 0) { //鉴于上述问题,这里重新查询User_id; DataTable user_table = user_bll.GetList(1, "", " User_id DESC").Tables[0]; _id = long.Parse(user_table.Rows[0]["User_id"].ToString()); lblTip.Visible = false; BLL.CCOM.User_property User_property_bll = new BLL.CCOM.User_property(); Model.CCOM.User_property User_property_model = new Model.CCOM.User_property(); User_property_model.User_id = _id; User_property_model.Period_id = period_bll.GetModel(" Period_year=" + open_year).Period_id; BLL.CCOM.Temp_record temp_record_bll = new BLL.CCOM.Temp_record(); var temp_record_model = temp_record_bll.GetModel(" Period_year=" + open_year); //临时表中无该年度记录,则需创建该年度记录 if (temp_record_model == null) { string last_record = open_year + "B" + "0001"; Model.CCOM.Temp_record record_model = new Model.CCOM.Temp_record(); record_model.Last_CCOM_number = last_record; record_model.Period_year = open_year + ""; DataTable table = User_property_bll.GetList(1, "", "UP_id DESC").Tables[0]; if (table != null && table.Rows.Count > 0) { DataRow dr = table.Rows[0]; last_record = dr["UP_CCOM_number"].ToString(); record_model.Last_CCOM_number = open_year + "B" + (int.Parse(last_record.Substring(5)) + 1).ToString("0000"); } //插入最后一条记录到临时表 temp_record_bll.Add(record_model); //插入个人属性表 User_property_model.UP_CCOM_number = record_model.Last_CCOM_number; User_property_model.UP_calculation_status = 0; User_property_bll.Add(User_property_model); } else//临时表中有该年度记录,则直接取该年度记录 { int last_record = int.Parse(temp_record_model.Last_CCOM_number.Substring(5)); //更新临时表 temp_record_model.Last_CCOM_number = open_year + "B" + (last_record + 1).ToString("0000"); temp_record_bll.Update(temp_record_model); //插入个人属性表 User_property_model.UP_CCOM_number = temp_record_model.Last_CCOM_number; User_property_model.UP_calculation_status = 0; User_property_bll.Add(User_property_model); } //JscriptMsg("注册成功!", "/AdminMetro/login_page.aspx", "Success"); var user_notice_bll = new BLL.CCOM.User_notice(); var user_notice_model = new Model.CCOM.User_notice(); user_notice_model.User_id = _id; var notice_model = new BLL.CCOM.Notice().GetModel(" Notice_flag=1"); user_notice_model.Notice_id = notice_model.Notice_id.ToString(); user_notice_bll.Add(user_notice_model); Response.Write("<script>window.location.href='/AdminMetro/login_page.aspx';</script>"); } else { //JscriptMsg("注册失败!", "/AdminMetro/CCOM/register/Register.aspx", "Error"); Response.Write("<script>window.location.href='/AdminMetro/CCOM/register/Register.aspx';</script>"); } }
protected void showUserInfo() { BLL.CCOM.User_property user_bll = new BLL.CCOM.User_property(); Model.CCOM.User_property user_model = user_bll.GetModel(_id); BLL.CCOM.Period user_bll_period = new BLL.CCOM.Period(); Model.CCOM.Period user_model_period = user_bll_period.GetModel(user_model.Period_id); if (user_model == null) { InnerRedirect(MyEnums.RediirectErrorEnum.ParameterError); } //国籍 this.ddl_UP_nation.Text = user_model.UP_nation.ToString(); //民族 this.ddl_UP_nationality.Text = user_model.UP_nationality.ToString(); //政治面貌 this.ddl_UP_politics.Text = user_model.UP_politics.ToString(); //文化程度 this.ddl_UP_degree.Text = user_model.UP_degree.ToString(); //高中毕业院校 this.txt_UP_high_school.Text = user_model.UP_high_school; //高考报名号 this.txt_UP_CEE_number.Text = user_model.UP_CEE_number; //省艺术联考考生号 this.txt_UP_AEE_number.Text = user_model.UP_AEE_number; //专业考试期间移动电话 this.txt_UP_PE_Iphone.Text = user_model.UP_PE_Iphone; //常规移动电话 this.txt_UP_PE_Aphone.Text = user_model.UP_PE_Aphone; //高考所在地 this.ddl_UP_province.Text = user_model.UP_province.ToString(); //录取通知书地址 this.txt_UP_address.Text = user_model.UP_address; //收件人 this.txt_UP_receiver.Text = user_model.UP_receiver; //收件人电话 this.txt_UP_receiver_phone.Text = user_model.UP_receiver_phone; //邮编 this.txt_UP_postal_code.Text = user_model.UP_postal_code; //证件复印图片 string UP_ID_picture_path = user_model.UP_ID_picture.ToString(); if (UP_ID_picture_path != "") { this.img_UP_ID_picture.Src = UP_ID_picture_path; this.txt_UP_ID_picture.Text = UP_ID_picture_path; } else { this.img_UP_ID_picture.Src = ""; this.txt_UP_ID_picture.Text = ""; } //近期免冠照片 string UP_picture_path = user_model.UP_picture.ToString(); if (UP_picture_path != "") { this.img_UP_picture.Src = UP_picture_path; this.txt_UP_picture.Text = UP_picture_path; } else { this.img_UP_picture.Src = ""; this.txt_UP_picture.Text = ""; } //省联考合格证 string UP_AEE_picture_path = user_model.UP_AEE_picture.ToString(); if (UP_AEE_picture_path != "") { this.img_UP_AEE_picture.Src = UP_AEE_picture_path; this.txt_UP_AEE_picture.Text = UP_AEE_picture_path; } else { this.img_UP_AEE_picture.Src = ""; this.txt_UP_AEE_picture.Text = ""; } //所属周期 this.txt_Period_id.Text = user_model_period.Period_year.ToString(); }
private bool DoUpdateUserInfo(long _id) { BLL.CCOM.User_property user_bll = new BLL.CCOM.User_property(); Model.CCOM.User_property user_model = user_bll.GetModel(_id); bool result = false; //国籍 user_model.UP_nation = Convert.ToInt32(this.ddl_UP_nation.SelectedValue); //民族 user_model.UP_nationality = Convert.ToInt32(this.ddl_UP_nationality.SelectedValue); //政治面貌 user_model.UP_politics = Convert.ToInt32(this.ddl_UP_politics.SelectedValue); //文化程度 user_model.UP_degree = Convert.ToInt32(this.ddl_UP_degree.SelectedValue); //高中毕业院校 user_model.UP_high_school = this.txt_UP_high_school.Text; //高考报名号 user_model.UP_CEE_number = this.txt_UP_CEE_number.Text; //省艺术联考考生号 user_model.UP_AEE_number = this.txt_UP_AEE_number.Text; //专业考试期间移动电话 user_model.UP_PE_Iphone = this.txt_UP_PE_Iphone.Text; //常规移动电话 user_model.UP_PE_Aphone = this.txt_UP_PE_Aphone.Text; //高考所在地 user_model.UP_province = Convert.ToInt32(this.ddl_UP_province.SelectedValue); //录取通知书地址 user_model.UP_address = this.txt_UP_address.Text; //收件人 user_model.UP_receiver = this.txt_UP_receiver.Text; //收件人电话 this.txt_UP_receiver_phone.Text = user_model.UP_receiver_phone; //邮编 user_model.UP_postal_code = this.txt_UP_postal_code.Text; //复印件证件图片 if (this.txt_UP_ID_picture.Text != "") { user_model.UP_ID_picture = Utils.Filter(this.txt_UP_ID_picture.Text.Trim()); } if (!String.IsNullOrEmpty(user_model.UP_ID_picture)) { //创建文件夹 FileOperate.FolderCreate(Utils.GetMapPath(DataDic.UP_ID_picture_Path)); //图片处理 String toFilePath = DataDic.UP_ID_picture_Path + DateTime.Now.Ticks.ToString() + FileOperate.GetPostfixStr(user_model.UP_ID_picture); FileOperate.FileMove(Server.MapPath(user_model.UP_ID_picture), Server.MapPath(toFilePath)); user_model.UP_ID_picture = toFilePath; } //上传近期免冠照片 if (this.txt_UP_picture.Text != "") { user_model.UP_picture = Utils.Filter(this.txt_UP_picture.Text.Trim()); } if (!String.IsNullOrEmpty(user_model.UP_picture)) { //创建文件夹 FileOperate.FolderCreate(Utils.GetMapPath(DataDic.UP_picture_Path)); //图片处理 String toFilePath = DataDic.UP_picture_Path + DateTime.Now.Ticks.ToString() + FileOperate.GetPostfixStr(user_model.UP_picture); FileOperate.FileMove(Server.MapPath(user_model.UP_picture), Server.MapPath(toFilePath)); user_model.UP_picture = toFilePath; } //上传省联考合格证 if (this.txt_UP_AEE_picture.Text != "") { user_model.UP_AEE_picture = Utils.Filter(this.txt_UP_AEE_picture.Text.Trim()); } if (!String.IsNullOrEmpty(user_model.UP_AEE_picture)) { //创建文件夹 FileOperate.FolderCreate(Utils.GetMapPath(DataDic.UP_AEE_picture_Path)); //图片处理 String toFilePath = DataDic.UP_AEE_picture_Path + DateTime.Now.Ticks.ToString() + FileOperate.GetPostfixStr(user_model.UP_AEE_picture); FileOperate.FileMove(Server.MapPath(user_model.UP_AEE_picture), Server.MapPath(toFilePath)); user_model.UP_AEE_picture = toFilePath; } //更新的状态 try { bool res = user_bll.Update(user_model); if (res == true) { return(res); } } catch { result = false; } return(result); }
protected void GetPwdByPhone() { if (Session[MyKeys.SESSION_PHONE_CODE] == null) { this.lblReInfo.Text = "请输入手机验证码!"; return; } if (Session[MyKeys.SESSION_PHONE_CODE].ToString() != this.txtPhoneCode.Text) { this.lblReInfo.Text = "验证码输入不正确!"; return; } String userName = this.txtUserName1.Text.Trim(); String phone = this.txtPhone.Text.Trim(); if (userName == "") { this.lblReInfo.Text = "用户名为空!"; return; } if (userName.Length > 50 || !Common.Utils.IsSafeSqlString(userName)) { this.lblReInfo.Text = "用户名不合法!"; return; } if (!Validator.IsMobile(phone)) { this.lblReInfo.Text = "手机号不合法!"; return; } //判断用户是否存在 BLL.CCOM.User_information bll = new BLL.CCOM.User_information(); Model.CCOM.User_information model = bll.GetModel(" User_number='" + phone + "'"); if (model == null) { this.lblReInfo.Text = "用户信息不匹配!"; return; } BLL.CCOM.User_property userEx_bll = new BLL.CCOM.User_property(); Model.CCOM.User_property userEx_model = userEx_bll.GetModel(" User_id=" + model.User_id); if (userEx_model == null) { if (!model.User_realname.Equals(userName)) { this.lblReInfo.Text = "用户信息不匹配!"; return; } } else { if (!model.User_realname.Equals(userName) && !userEx_model.UP_CEE_number.Equals(userName)) { this.lblReInfo.Text = "用户信息不匹配!"; return; } } //更改密码 String newPwd = Utils.Number(6); model.User_password = DESEncrypt.MD5Encrypt(newPwd);//敏感字段 bll.Update(model); ManDaoSMS.SendSMS(phone, GetChangePwdSms(model.User_realname, newPwd)); this.lblReInfo.Text = "新密码已发送您的手机,请查看!"; }
protected void btnPhoneCode_Click(object sender, EventArgs e) { String userName = this.txtUserName1.Text.Trim(); String phone = this.txtPhone.Text.Trim(); if (userName == "") { this.lblReInfo.Text = "用户名为空!"; return; } if (userName.Length > 50 || !Common.Utils.IsSafeSqlString(userName)) { this.lblReInfo.Text = "用户名不合法!"; return; } if (!Validator.IsMobile(phone)) { this.lblReInfo.Text = "手机号不合法!"; return; } BLL.CCOM.User_information bll = new BLL.CCOM.User_information(); Model.CCOM.User_information model = bll.GetModel(" User_number='" + phone + "'"); if (model == null) { this.lblReInfo.Text = "用户信息不匹配!"; return; } BLL.CCOM.User_property userEx_bll = new BLL.CCOM.User_property(); Model.CCOM.User_property userEx_model = userEx_bll.GetModel(" User_id=" + model.User_id); if (userEx_model == null) { if (!model.User_realname.Equals(userName)) { this.lblReInfo.Text = "用户信息不匹配!"; return; } } else { if (!model.User_realname.Equals(userName) && !userEx_model.UP_CEE_number.Equals(userName)) { this.lblReInfo.Text = "用户信息不匹配!"; return; } } if (Session[MyKeys.SESSION_PHONE_CODE_TIME] != null) { DateTime dt = (DateTime)Session[MyKeys.SESSION_PHONE_CODE_TIME]; if (dt.Add(new TimeSpan(0, 0, 60)) > DateTime.Now) { this.lblReInfo.Text = "请您60秒后再获取手机验证码!"; return; } } //发送验证码 String code = Utils.Number(6); Session[MyKeys.SESSION_PHONE_CODE] = code; Session[MyKeys.SESSION_PHONE_CODE_TIME] = DateTime.Now; ManDaoSMS.SendSMS(phone, GetVCodeSms(model.User_realname, code)); this.lblReInfo.Text = "手机验证码已发送到您的手机!"; this.hidIsTick.Value = "1"; }