public void ShowTeacherInfo() { var user_view_model = new BLL.CCOM.View_User().GetModel(" User_id=" + UserID); var user_model = new BLL.CCOM.User_information().GetModel(UserID); var teacher_model = new BLL.CCOM.Tutor().GetModel(" User_id=" + UserID); this.lblNumber.InnerText = user_view_model.User_number; this.lblName.InnerText = user_view_model.User_realname; this.ddlGender.SelectedValue = (Boolean)user_view_model.User_gender ? "1" : "0"; this.lblAgency.InnerText = user_view_model.Agency_name; this.txtPhone.Value = user_model.User_phone; DataSet ds = new BLL.CCOM.Title().GetList(""); this.ddlTitle.DataSource = ds.Tables[0].DefaultView; this.ddlTitle.DataTextField = "Title_name"; this.ddlTitle.DataValueField = "Title_id"; this.ddlTitle.DataBind(); this.ddlTitle.Items.Add(new ListItem("未设置", "0")); if (teacher_model != null) { if (teacher_model.Title_id != null) { this.ddlTitle.SelectedValue = teacher_model.Title_id.ToString(); } else { this.ddlTitle.SelectedValue = "0"; } this.txtSubject.Value = teacher_model.Subject; this.txtEmail.Value = teacher_model.Tutor_email; this.txtFixedPhone.Value = teacher_model.Tutor_fixedphone; this.txtPlace.Value = teacher_model.Tutor_location; this.txtIntroduce.Value = teacher_model.Tutor_introduce; } }
/// <summary> //根据用户Id列表发送短信 /// </summary> /// <param name="userIdList"></param> /// <param name="content"></param> public static String SendSmsNotice(List <string> userIdList, String content, long userId) { var userName = new BLL.CCOM.User_information().GetModel(userId).User_realname; if (userName != "") { userName = "******" + userName + ")"; } if (new BLL.CCOM.User_sms().GetModel(" User_id=" + userId).User_sms_left > 0) { var ml = new BLL.CCOM.User_information().GetModelList(" User_id in(" + String.Join(",", userIdList.ToArray()) + ")"); var phoneList = new List <String>(); foreach (var m in ml) { phoneList.Add(m.User_phone); } var res = ManDaoSMS.SendSMS(String.Join(",", phoneList.ToArray()), content + userName); if (res == ManDaoSMS.RESULT_SUCCESS) { //扣费 //ReduceUserSmsNumber(userId, phoneList.Count, content); } return(res); } return("no sms"); }
public void ShowStudentInfo() { var user_view_model = new BLL.CCOM.View_User().GetModel(" User_id=" + UserID); var user_model = new BLL.CCOM.User_information().GetModel(UserID); this.lblOtherNumber.InnerText = user_view_model.User_number; this.lblOtherName.InnerText = user_view_model.User_realname; this.ddlOtherGender.SelectedValue = (Boolean)user_view_model.User_gender ? "1" : "0"; this.txtOtherPhone.Value = user_model.User_phone; this.lblClass.InnerText = user_view_model.Agency_name; if (user_view_model.User_birthday != null) { this.txtBirthday.Text = user_view_model.User_birthday.Value.ToString("yyyy-MM-dd"); } new BLL.CCOM.Nationality().BindDDL(this.ddlNationality); this.ddlNationality.Items.Add(new ListItem("未设置", "0")); if (user_model.Nationality_id != null) { this.ddlNationality.SelectedValue = user_model.Nationality_id.ToString(); } else { this.ddlNationality.SelectedValue = "0"; } new BLL.CCOM.Politics().BindDDL(this.ddlPolitic); this.ddlPolitic.Items.Add(new ListItem("未设置", "0")); if (user_model.Politic_id != null) { this.ddlPolitic.SelectedValue = user_model.Politic_id.ToString(); } else { this.ddlPolitic.SelectedValue = "0"; } }
private void BindNoticeUser(string ids) { var userIdList = new List <long>(); var nameNodeList = new Hashtable(); string[] receivers_id = ids.Split(','); for (int i = 0; i < receivers_id.Length; i++) { userIdList.Add(long.Parse(receivers_id[i])); var model = new BLL.CCOM.User_information().GetModel(long.Parse(receivers_id[i])); if (model != null) { string realName = model.User_realname; //加入返回的节点集合中,格式为(type|id, name) if (!nameNodeList.Contains(USER_TYPE + "|" + receivers_id[i])) { nameNodeList.Add(USER_TYPE + "|" + receivers_id[i], realName); } if (i > 300) { nameNodeList.Add(USER_TYPE + "|" + 0, "..."); break; } } } //调用前台js函数,将结果返回父页面 var js = "selectUserDeptCallBack('', '', '" + String.Join(",", userIdList.ToArray()) + "', '" + LitJson.JsonMapper.ToJson(nameNodeList) + "', '" + userIdList.Count + "');"; JscriptReponse(js); }
private void showInfo() { BLL.CCOM.User_information user_bll = new BLL.CCOM.User_information(); Model.CCOM.User_information user_model = user_bll.GetModel(id); if (user_model == null) { InnerRedirect(MyEnums.RediirectErrorEnum.ParameterError); } //this.txt_identity_number.Text = user_model.User_ID_number; this.txt_realname.Text = user_model.User_realname; if (user_model.User_birthday != null) { this.txtBirthday.Value = Convert.ToDateTime(user_model.User_birthday).ToString("yyyy-MM-dd"); } this.lbl_phone_number.Text = user_model.User_number; //this.ddl_identity_type.SelectedValue = user_model.User_ID_number_type.ToString(); if ((Boolean)user_model.User_gender) { this.ddl_Sex.SelectedIndex = 1; } //this.ddl_user_type.SelectedValue = user_model.User_type.ToString(); this.lbl_register_time.Text = Convert.ToDateTime(user_model.User_addtime).ToString("yyyy-MM-dd"); }
//删除 protected void lbtSingleDelete_Click(object sender, EventArgs e) { BLL.CCOM.User_information bll = new BLL.CCOM.User_information(); var lbtn = sender as LinkButton; if (lbtn != null) { var id = Int32.Parse(DESEncrypt.Decrypt(lbtn.ToolTip.ToString())); bool result = true; try { result = bll.Delete(id); } catch { result = false; } string keywords = MyRequest.GetQueryString("keywords"); int page = MyRequest.GetQueryInt("page", 1); if (result == true) { //JscriptMsg("删除成功!", Utils.CombUrlTxt("ManagerList.aspx", "fun_id={0}&keywords={1}&page={2}", // DESEncrypt.Encrypt(this.fun_id), keywords, page.ToString()), "Success"); JscriptMsg("删除成功!", "ManagerList.aspx", "Success"); Response.Redirect("StudentList.aspx?fun_id=" + get_fun_id("CCOM/StudentManage/StudentList.aspx")); } else { JscriptMsg("删除失败!", Utils.CombUrlTxt("StudentList.aspx", "fun_id={0}&keywords={1}&page={2}", DESEncrypt.Encrypt(this.fun_id), keywords, page.ToString()), "Error"); } } }
//保存 protected void btn_Submit_Click(object sender, EventArgs e) { var student_models = new BLL.CCOM.User_information().GetModelList(" Role_id=3"); foreach (var student_model in student_models) { if (!new BLL.CCOM.User_information().Delete(student_model.User_id)) { JscriptMsg("删除学生:" + student_model.User_realname + "时,发生异常!", "", "Error"); return; } } var topic_models = new BLL.CCOM.Topic().GetModelList(""); foreach (var topic_model in topic_models) { if (!new BLL.CCOM.Topic().Delete(topic_model.Topic_id)) { JscriptMsg("删除选题:" + topic_model.Topic_name + "时,发生异常!", "", "Error"); return; } } var teachweek_models = new BLL.CCOM.Teach_week().GetModelList(""); foreach (var teachweek_model in teachweek_models) { if (!new BLL.CCOM.Teach_week().Delete(teachweek_model.TeachWeek_id)) { JscriptMsg("删除异常!", "", "Error"); return; } } var reply_models = new BLL.CCOM.Reply_group().GetModelList(""); foreach (var reply_model in reply_models) { if (!new BLL.CCOM.Reply_group().Delete(reply_model.Group_id)) { JscriptMsg("删除答辩组:" + reply_model.Group_name + "时,发生异常!", "", "Error"); return; } } var user_models = new BLL.CCOM.User_information().GetModelList(" Role_id!=1"); foreach (var student_model in user_models) { if (!new BLL.CCOM.User_information().Delete(student_model.User_id)) { JscriptMsg("删除用户:" + student_model.User_realname + "时,发生异常!", "", "Error"); return; } } JscriptMsg("初始化成功!", "InitSystem.aspx?fun_id=" + DESEncrypt.Encrypt(this.fun_id), "Success"); }
protected int ShowInfo() { Model.CCOM.User_information model = GetAdminInfo_CCOM(); long _id = model.User_id; int score_t = -1, score_c = -1, score_s = -1; BLL.CCOM.User_information user_bll = new BLL.CCOM.User_information(); Model.CCOM.User_information user_model = user_bll.GetModel(_id); if (user_model == null) { InnerRedirect(MyEnums.RediirectErrorEnum.ParameterError); } var relation_model = new BLL.CCOM.Topic_relation().GetModel(" Student_id=" + _id); if (relation_model == null) { return(-1); } var comment_model = new BLL.CCOM.Comment().GetModel(" Topic_relation_id=" + relation_model.Topic_relation_id); try { score_t = (int)comment_model.Teacher_score; } catch { score_t = -1; } try { score_c = (int)comment_model.Reply_score; } catch { score_c = -1; } try { var soft_model = new BLL.CCOM.Software_accept().GetModel(" Topic_relation_id=" + relation_model.Topic_relation_id); score_s = (int)soft_model.Conclusion; } catch { score_s = -1; } if (score_c >= 0 && score_s >= 0 && score_t >= 0) { return(1); } else { return(0); } }
private bool UpdateOtherInfo() { BLL.CCOM.User_information user_bll = new BLL.CCOM.User_information(); Model.CCOM.User_information user_model = user_bll.GetModel(UserID); bool result = false; //更新姓名 if (txt_User_realname.Text == "") { JscriptMsg("请填写真实姓名!", "", "Error"); return(false); } else { user_model.User_realname = this.txt_User_realname.Text; } //更新手机号,内容不变 user_model.User_number = this.txt_User_number.Text; //更新性别 if (this.rbl_User_gender.SelectedIndex == 0) { user_model.User_gender = false; } else { user_model.User_gender = true; } //更新出生日期 try { user_model.User_birthday = Convert.ToDateTime(this.txt_User_birthday.Text); } catch { user_model.User_birthday = null; } //更新的状态 try { bool res = user_bll.Update(user_model); if (res == true) { return(res); } } catch { result = false; } return(result); }
protected string GetCreatorName(long creator_id) { var model = new BLL.CCOM.User_information().GetModel(creator_id); if (model != null) { return(model.User_realname); } return(""); }
public void ShowOtherInfo() { BLL.CCOM.User_information user_bll = new BLL.CCOM.User_information(); Model.CCOM.User_information user_model = user_bll.GetModel(UserID); if (user_model == null) { InnerRedirect(MyEnums.RediirectErrorEnum.ParameterError); } //真实姓名 if (user_model.User_realname == null) { txt_User_realname.Text = "请填写真实姓名"; } else { this.txt_User_realname.Text = user_model.User_realname; } int agency_id = 0; agency_id = user_model.Agency_id; BLL.CCOM.Agency user_agency_bll = new BLL.CCOM.Agency(); Model.CCOM.Agency user_agency_model = user_agency_bll.GetModel(agency_id); if (user_agency_model.Agency_id != 0) { txt_Agency.Text = user_agency_model.Agency_name; } else { div_user_agency.Visible = false; } //移动电话 this.txt_User_number.Text = user_model.User_number; //性别 if ((Boolean)user_model.User_gender) { this.rbl_User_gender.SelectedIndex = 1; } //出生日期 if (user_model.User_birthday == null) { txt_User_birthday.Text = "请填写出生日期"; } else { this.txt_User_birthday.Text = Convert.ToDateTime(user_model.User_birthday).ToString("yyyy-MM-dd"); } //添加日期 this.txt_User_addtime.Text = Convert.ToDateTime(user_model.User_addtime).ToString("yyyy-MM-dd"); }
protected string Pass(HttpContext context) { JsonData data = new JsonData(); string _schooluserid = MyRequest.GetString("schooluserid"); string Pass = MyRequest.GetString("pass"); string PassConfirm = MyRequest.GetString("passconfirm"); string msg = ""; if (Tools.CheckParams(Pass + PassConfirm)) { msg = "传输异常,存在非法字符!"; } else { if (Pass.Length < 6 || Pass.Length > 16) { msg = "密码长度请控制在6-16位!"; } else if (Pass != PassConfirm) { msg = "两次密码输入不一致!"; } else { try { BLL.CCOM.User_information bll = new BLL.CCOM.User_information(); long schooluserid = long.Parse(DESEncrypt.Decrypt(_schooluserid)); Model.CCOM.User_information model = bll.GetModel(schooluserid); model.User_password = DESEncrypt.MD5Encrypt(Pass); bool res = bll.Update(model); if (res == false) { msg = "修改失败,参数发生异常!"; } } catch (Exception) { msg = "修改发生异常!"; } } } if (msg == "") { data["msg"] = "修改成功"; data["code"] = 1; } else { data["msg"] = msg; data["code"] = 0; } return(data.ToJson()); }
public static void CreateWebNewsHtml(String newsId, String fileName, bool checkExists) { if ((!checkExists) || (!System.IO.File.Exists(fileName))) { var news = new BLL.CCOM.News().GetModel(Int32.Parse(newsId)); if (news != null) { // 读取模板文件 string temp = HttpContext.Current.Server.MapPath("news_temp.html"); String newsStr = FileOperate.ReadFile(temp); newsStr = newsStr.Replace("titlexxx", news.News_title); StringBuilder sb = new StringBuilder(); int creator_id = news.News_creator_id; string realname = new BLL.CCOM.User_information().GetModel(creator_id).User_realname; if (realname != "请填写真实姓名") { sb.Append("<span>发布者:").Append(realname).Append("</span>"); } sb.Append(" "); sb.Append(news.News_date); //sb.Append(" ").Append("阅读次数:").Append(news.NI_ReadNum); newsStr = newsStr.Replace("desxxx", sb.ToString()); String content = HttpContext.Current.Server.HtmlDecode(news.News_content); newsStr = newsStr.Replace("contentxxx", content); sb.Clear(); //var newsAttach = new BLL.news.News_NewsInfo().GetModel(Int64.Parse(newsId)).NewsAttach; string strWhere = " News_id=" + newsId; var newsAttach = new BLL.CCOM.News_attach().GetModelList(strWhere); if (newsAttach != null && newsAttach.Count > 0) { sb.Append("<p class='attachTitle'>附件:</p>"); var itemCnt = 1; foreach (var item in newsAttach) { sb.Append("<p class='attachItem'>(").Append(itemCnt).Append(") <a href='") .Append("/home/news/Attach.aspx?id=").Append(DESEncrypt.Encrypt(item.News_attach_id.ToString())) .Append("&address=").Append(HttpUtility.UrlEncode(item.News_attach_address)) .Append("&name=").Append(HttpUtility.UrlEncode(item.News_attach_name)) .Append("' target='_blank' >") .Append(item.News_attach_name) .Append("</a>") .Append(OnlineViewHelper.GetOnlineViewWrapLink(item.News_attach_address, item.News_attach_name)) .Append("</p>"); itemCnt++; } } newsStr = newsStr.Replace("attachxxx", sb.ToString()); ////写文件 FileOperate.WriteNewFile(fileName, newsStr); } } }
protected string GetLastEditorName(string last_editor_id) { if (!string.IsNullOrEmpty(last_editor_id)) { var model = new BLL.CCOM.User_information().GetModel(long.Parse(last_editor_id)); if (model != null) { return(model.User_realname); } } return("--"); }
public string GetTeacherName(long id) { try { BLL.CCOM.User_information bll = new BLL.CCOM.User_information(); Model.CCOM.User_information model = bll.GetModel(id); return(model.User_realname); } catch { return("该教师用户不存在"); } }
private bool UpdateStudentInfo() { BLL.CCOM.User_information user_bll = new BLL.CCOM.User_information(); Model.CCOM.User_information user_model = user_bll.GetModel(UserID); bool result = false; if (this.ddlOtherGender.SelectedValue == "0") { user_model.User_gender = false; } else { user_model.User_gender = true; } if (this.txtOtherPhone.Value != "") { user_model.User_phone = this.txtOtherPhone.Value; } if (this.txtBirthday.Text != "") { user_model.User_birthday = Convert.ToDateTime(this.txtBirthday.Text); } if (this.ddlNationality.SelectedValue != "0") { user_model.Nationality_id = int.Parse(this.ddlNationality.SelectedValue); } if (this.ddlPolitic.SelectedValue != "0") { user_model.Politic_id = int.Parse(this.ddlPolitic.SelectedValue); } try { bool res = user_bll.Update(user_model); if (res == true) { return(res); } } catch { result = false; } return(result); }
public string GetTeacherName(string UserID) { BLL.CCOM.User_information user_bll = new BLL.CCOM.User_information(); string str = string.Empty; try { Model.CCOM.User_information user_model = user_bll.GetModel(" User_id='" + UserID + "'"); str = user_model.User_realname; } catch { str = "未设置"; } return(str); }
////设置分页数量 //protected void txtPageNum_TextChanged(object sender, EventArgs e) //{ // int _pagesize; // if (int.TryParse(txtPageNum.Text.Trim(), out _pagesize)) // { // if (_pagesize > 0) // { // Utils.WriteCookie("Exam_Student_page_size", _pagesize.ToString(), 43200); // } // } // Response.Redirect(Utils.CombUrlTxt("AddTeacher.aspx", "fun_id={0}&keywords={1}&id={2}", MyRequest.GetQueryString("fun_id"), txtKeywords.Text, MyRequest.GetQueryString("id"))); //} protected String GetUserStatus(long userId) { var model = new BLL.CCOM.User_information().GetModel(userId); if (model != null) { if (model.User_status) { return("<b style=\"color: green;\">可用</b>"); } else { return("<b style=\"color: red;\">停用</b>"); } } return("--"); }
//public void BindRole() //{ // string sql = "Role_status = 1"; // BLL.CCOM.Role bll = new BLL.CCOM.Role(); // DataSet ds = bll.GetList(sql); // this.ddlRole.DataSource = ds.Tables[0].DefaultView; // this.ddlRole.DataTextField = "Role_name"; // this.ddlRole.DataValueField = "Role_id"; // this.ddlRole.DataBind(); // ListItem item = new ListItem("--请选择角色--", "#"); // this.ddlRole.Items.Insert(0, item); //} #region 赋值操作================================= private void ShowInfo(long UserId) { var bll = new BLL.CCOM.User_information(); var model = bll.GetModel("User_id=" + UserId); this.rblSex.SelectedIndex = (model.User_gender == true) ? 1 : 0; this.txtMobile.Text = model.User_number; this.txtRealname.Text = model.User_realname; //if (model.User_ID_number_type != null) // this.ddlIdType.SelectedIndex = model.User_ID_number_type.Value; //this.txtIdNumber.Text = model.User_ID_number; if (model.User_birthday != null) { this.txtBirthday.Value = ((DateTime)model.User_birthday).ToString("yyyy-MM-dd"); } this.ddlAgency.SelectedValue = model.Agency_id.ToString(); this.ddlRole.SelectedValue = model.Role_id.ToString(); }
/// <summary> /// 判断管理员是否已经登录(解决Session超时问题) /// </summary> public bool IsAdminLogin() { //如果Session为Null if (Session[MyKeys.SESSION_ADMIN_INFO] != null) { return(true); } else { //检查Cookies //Cookie存储 时间,ID 加密后的内容 手动计算过期时间 string CookieID = Utils.GetCookie("UniversityLoginInfo"); if (CookieID != "") { CookieID = DESEncrypt.Decrypt(CookieID); try { DateTime dt = Convert.ToDateTime(CookieID.Split(',')[0]); if (dt.Date.Date == DateTime.Now.Date) { CookieID = CookieID.Split(',')[1]; BLL.CCOM.User_information bll = new BLL.CCOM.User_information(); Model.CCOM.User_information model = bll.GetModel(Convert.ToInt64(CookieID)); /* * Model.admin.View_AdminUser model = new BLL.admin.View_AdminUser().GetModel(Convert.ToInt64(CookieID)); */ if (model != null) { Session[MyKeys.SESSION_ADMIN_INFO] = model; Session[MyKeys.SESSION_USER_STATUSID] = model.User_id.ToString(); return(true); } return(true); } } catch { } } } return(false); }
protected void showStudentInfo() { BLL.CCOM.User_information ubll = new BLL.CCOM.User_information(); BLL.CCOM.User_property pbll = new BLL.CCOM.User_property(); List <Model.CCOM.Examination_arrangement_detail> EadList = new BLL.CCOM.Examination_arrangement_detail().GetModelList(" Ea_id=" + examId); int num = 0; TableRow studentRow = new TableRow(); foreach (Model.CCOM.Examination_arrangement_detail EadModel in EadList) { num++; var umodel = ubll.GetModel(EadModel.User_id); var pmodel = pbll.GetModel("User_id=" + EadModel.User_id); TableCell studentCell = new TableCell(); studentCell.HorizontalAlign = HorizontalAlign.Center; studentRow.Cells.Add(studentCell); Image upPicture = new Image(); upPicture.ImageUrl = "../../.." + pmodel.UP_picture; upPicture.Width = 60; studentCell.Controls.Add(upPicture); Panel panel1 = new Panel(); studentCell.Controls.Add(panel1); Label upCcomNum = new Label(); upCcomNum.Text = pmodel.UP_CCOM_number; panel1.Controls.Add(upCcomNum); Panel panel2 = new Panel(); studentCell.Controls.Add(panel2); Label name = new Label(); name.Text = umodel.User_realname; panel2.Controls.Add(name); if (num % 6 == 0) { studentTable.Rows.Add(studentRow); studentRow = new TableRow(); } } if (num % 6 != 0) { studentTable.Rows.Add(studentRow); } }
protected void InitView() { Model.CCOM.Reply_group model = new BLL.CCOM.Reply_group().GetModel(Group_id); if (model != null) { try { BLL.CCOM.User_information user_bll = new BLL.CCOM.User_information(); Model.CCOM.User_information user_model = new Model.CCOM.User_information(); this.txtGroupName.Text = model.Group_name; this.txtReplyTime.Value = model.Reply_time.ToString("yyyy-MM-dd HH:mm:ss"); this.txtReplyRoom.Text = model.Reply_room; user_model = user_bll.GetModel(model.User_id); this.txtTeaNumber.Text = user_model.User_number; this.ddltype.SelectedValue = model.Group_type.ToString(); } catch { } } }
//根据用户手机号列表发送 public static String SendSmsByPhone(List <String> phoneList, String content, long userId) { var userName = new BLL.CCOM.User_information().GetModel(userId).User_realname; if (userName != "") { userName = "******" + userName + ")"; } if (new BLL.CCOM.User_sms().GetModel(" User_id=" + userId).User_sms_left > 0) { var res = ManDaoSMS.SendSMS(String.Join(",", phoneList.ToArray()), content + userName); if (res == ManDaoSMS.RESULT_SUCCESS) { //扣费 //ReduceUserSmsNumber(userId, phoneList.Count, content); } return(res); } return("no sms"); }
protected void showStudentInfo() { BLL.CCOM.User_information ubll = new BLL.CCOM.User_information(); BLL.CCOM.User_property pbll = new BLL.CCOM.User_property(); List <Model.CCOM.Examination_arrangement_detail> EadList = new BLL.CCOM.Examination_arrangement_detail().GetModelList(" Ea_id=" + examId); int num = 0; foreach (Model.CCOM.Examination_arrangement_detail EadModel in EadList) { TableRow studentRow = new TableRow(); studentTable.Rows.Add(studentRow); var umodel = ubll.GetModel(EadModel.User_id); var pmodel = pbll.GetModel("User_id=" + EadModel.User_id); TableCell numCell = new TableCell(); numCell.HorizontalAlign = HorizontalAlign.Center; studentRow.Cells.Add(numCell); TableCell idCell = new TableCell(); idCell.HorizontalAlign = HorizontalAlign.Center; studentRow.Cells.Add(idCell); TableCell nameCell = new TableCell(); nameCell.HorizontalAlign = HorizontalAlign.Center; studentRow.Cells.Add(nameCell); TableCell scoreCell = new TableCell(); scoreCell.HorizontalAlign = HorizontalAlign.Center; studentRow.Cells.Add(scoreCell); TableCell chapterCell = new TableCell(); studentRow.Cells.Add(chapterCell); Label numLabel = new Label(); numLabel.Text = (++num).ToString(); numCell.Controls.Add(numLabel); Label upCcomNum = new Label(); upCcomNum.Text = pmodel.UP_CCOM_number; idCell.Controls.Add(upCcomNum); Label name = new Label(); name.Text = umodel.User_realname; nameCell.Controls.Add(name); Label chapter = newChapterLabel(umodel.User_id); chapterCell.Controls.Add(chapter); } }
protected void lbtAble_Click(object sender, EventArgs e) { var bll = new BLL.CCOM.User_information(); var lbtn = sender as LinkButton; if (lbtn != null) { var id = Int64.Parse(DESEncrypt.Decrypt(lbtn.ToolTip.ToString())); bool isOn = false; bool result = true; try { var m = bll.GetModel("User_id=" + id); isOn = m.User_status == true; m.User_status = isOn ^ true; if (bll.Update(m) == false) { result = false; } } catch { result = false; } string keywords = MyRequest.GetQueryString("keywords"); int page = MyRequest.GetQueryInt("page", 1); if (result == true) { JscriptMsg(isOn ? "禁用成功!" : "启用成功!", Utils.CombUrlTxt("ManagerList.aspx", "fun_id={0}&keywords={1}&page={2}", DESEncrypt.Encrypt(this.fun_id), keywords, page.ToString()), "Success"); } else { JscriptMsg(isOn ? "禁用失败!" : "启用失败!", Utils.CombUrlTxt("ManagerList.aspx", "fun_id={0}&keywords={1}&page={2}", DESEncrypt.Encrypt(this.fun_id), keywords, page.ToString()), "Error"); } RptBind(CombSqlTxt(this.keywords), " User_id desc "); } }
//计算选中的推送用户数 private int GetTotalUserCount(List <string> deptIdList, List <string> groupIdList, List <string> userIdList, Hashtable nameNodeList) { //list参数是引用传递,会影响原来的值,不能直接加入到userIdList List <string> idList = new List <string>(userIdList); var period = new BLL.CCOM.Period().GetModel(" Period_state=1"); //加入机构列表包含的所有UserId if (deptIdList != null && deptIdList.Count > 0) { } //加入通讯组列表包含的所有UserId if (groupIdList != null && groupIdList.Count > 0) { for (int i = 0; i < groupIdList.Count; i++) { var model_list = new BLL.CCOM.User_property().GetModelList(" Agency_id=" + groupIdList[i] + " and Period_id=" + period.Period_id); if (model_list != null && model_list.Count > 0) { for (int j = 0; j < model_list.Count; j++) { if (!userIdList.Contains(model_list[j].User_id.ToString())) { idList.Add(model_list[j].User_id.ToString()); userIdList.Add(model_list[j].User_id.ToString()); var _model = new BLL.CCOM.User_information().GetModel("User_id=" + model_list[j].User_id); if (_model != null) { string realname = _model.User_realname; nameNodeList.Add(USER_TYPE + "|" + model_list[j].User_id, realname); } } } } } } return(idList.Count); }
protected string Pass(string Pass, string PassConfirm) { string msg = ""; if (Tools.CheckParams(Pass + PassConfirm)) { msg = "传输异常,存在非法字符!"; } else { if (Pass.Length < 6 || Pass.Length > 16) { msg = "密码长度请控制在6-16位!"; } else if (Pass != PassConfirm) { msg = "两次密码输入不一致!"; } else { try { BLL.CCOM.User_information bll = new BLL.CCOM.User_information(); Model.CCOM.User_information model = GetAdminInfo_CCOM(); model.User_password = DESEncrypt.MD5Encrypt(Pass); bool res = bll.Update(model); if (res == false) { msg = "修改失败,参数发生异常!"; } } catch (Exception) { msg = "修改发生异常!"; } } } return(msg); }
public void ShowInfo() { var user_model = new BLL.CCOM.View_User().GetModel(" User_id=" + StudentID); this.lblNumber.InnerText = user_model.User_number; this.lblName.InnerText = user_model.User_realname; this.lblGender.InnerText = user_model.User_gender ? "女" : "男"; this.lblPhone.InnerText = new BLL.CCOM.User_information().GetModel(StudentID).User_phone; this.lblAgency.InnerText = user_model.Agency_name; if (user_model.User_birthday != null) { this.lblBirthday.InnerText = user_model.User_birthday.Value.ToString("yyyy年MM月dd日"); } else { this.lblBirthday.InnerText = "--"; } var user = new BLL.CCOM.User_information().GetModel(StudentID); if (user.Nationality_id != null) { this.lblNationality.InnerText = new BLL.CCOM.Nationality().GetModel((int)user.Nationality_id).Nationality_name; } else { this.lblNationality.InnerText = "--"; } if (user.Politic_id != null) { this.lblPolitic.InnerText = new BLL.CCOM.Politics().GetModel((int)user.Politic_id).Politics_name; } else { this.lblPolitic.InnerText = "--"; } }
private string DoAction() { string result = ""; BLL.CCOM.User_information bll = new BLL.CCOM.User_information(); Model.CCOM.User_information model; if (action != MyEnums.ActionEnum.Edit.ToString()) { model = new Model.CCOM.User_information(); } else { model = bll.GetModel("User_id=" + userId); } string Sex = this.rblSex.SelectedValue; string Mobile = this.txtMobile.Text.Trim(); string Pass1 = this.txtPass1.Text.Trim(); string Pass2 = this.txtPass2.Text.Trim(); // string IdNumberType = this.ddlIdType.SelectedItem.Value; //string IdNumber = this.txtIdNumber.Text.Trim(); string Realname = this.txtRealname.Text.Trim(); string Agency = this.ddlAgency.SelectedItem.Value; // string Role = this.ddlRole.SelectedItem.Value; //必填部分 if (Tools.CheckParams(Mobile + Realname + Pass1 + Pass2)) { return("请勿输入非法字符"); } if (Realname == "") { return("请填写真实姓名"); } model.User_realname = Realname; if (Mobile == "") { return("请填写学号/工号"); } if (!Validator.IsMobile(Mobile)) { return("学号/工号不合法"); } if (action != MyEnums.ActionEnum.Edit.ToString() && bll.GetRecordCount(" User_number='" + Mobile + "'") > 0) { return("该学号/工号已被添加"); } model.User_number = Mobile; if (action != MyEnums.ActionEnum.Edit.ToString()) { if (Pass1 == "") { return("请填写密码"); } if (Pass2 == "") { return("请填写确认密码"); } } if (Pass1.Length > 0 || Pass2.Length > 0) { if (Pass1.Length < 6 || Pass1.Length > 16) { return("密码长度请控制在6-16位"); } if (Pass1 != Pass2) { return("两次输入密码不符"); } } model.User_password = DESEncrypt.MD5Encrypt(Pass1); model.User_addtime = DateTime.Now; model.User_status = true; model.Role_id = 1; if (Agency == "#") { return("请选择机构"); } model.Agency_id = Convert.ToInt32(Agency); //if (Role == "#") //{ // return "请选择角色"; //} //model.Role_id = Convert.ToInt32(Role); //选填部分 model.User_gender = Convert.ToInt32(Sex) == 0; //if (IdNumber != "") //{ // if (IdNumberType == "#") // { // return "请选择证件类型"; // } // //验证身份证信息,只能验证身份证 // else if (Convert.ToInt32(IdNumberType) == 1) // { // bool check = false; // if (IdNumber.Length == 18) // { // check = CheckIDCard18(IdNumber); // } // else if (IdNumber.Length == 15) // { // check = CheckIDCard15(IdNumber); // } // if (check) // { // if (action != MyEnums.ActionEnum.Edit.ToString() && bll.GetRecordCount(" User_ID_number='" + IdNumber + "'") > 0) // { // return "该证件号已被添加"; // } // model.User_ID_number_type = Convert.ToInt32(IdNumberType); // model.User_ID_number = IdNumber; // } // else // { // return "请检查身份证号码是否正确"; // } // } //} if (this.txtBirthday.Value != "") { DateTime Birthday = Convert.ToDateTime(this.txtBirthday.Value); model.User_birthday = Birthday; } try { if (action == MyEnums.ActionEnum.Edit.ToString()) //修改 { bll.Update(model); } else { bll.Add(model); } } catch (Exception ex) { result = action == MyEnums.ActionEnum.Edit.ToString() ? "修改失败" : "添加失败" + ex.Message.ToString(); } return(result); }
protected void ShowInfo() { int score_t = -1, score_c = -1, score_s = -1; BLL.CCOM.User_information user_bll = new BLL.CCOM.User_information(); Model.CCOM.User_information user_model = user_bll.GetModel(_id); if (user_model == null) { InnerRedirect(MyEnums.RediirectErrorEnum.ParameterError); } //真实姓名 if (user_model.User_realname == null) { txt_User_realname.Text = "请填写真实姓名"; } else { this.txt_User_realname.Text = user_model.User_realname; } this.txt_User_number.Text = user_model.User_number; var relation_model = new BLL.CCOM.Topic_relation().GetModel(" Student_id=" + _id); if (relation_model == null) { return; } var comment_model = new BLL.CCOM.Comment().GetModel(" Topic_relation_id=" + relation_model.Topic_relation_id); try { score_t = (int)comment_model.Teacher_score; this.txtTeacherScore.Text = comment_model.Teacher_score.ToString(); } catch { this.txtTeacherScore.Text = "未评分"; } try { score_c = (int)comment_model.Reply_score; float sc = GetUser_CommentScore(_id); if (sc != -1) { this.txtCommentScore.Text = sc.ToString(); } else { this.txtCommentScore.Text = "未评分"; } this.lblComment.HRef = "CommentPage.aspx?userId=" + DESEncrypt.Encrypt(_id.ToString()); } catch { this.txtCommentScore.Text = "未评分"; } try { var soft_model = new BLL.CCOM.Software_accept().GetModel(" Topic_relation_id=" + relation_model.Topic_relation_id); score_s = (int)soft_model.Conclusion; this.txtScoftwareScore.Text = soft_model.Conclusion.ToString(); this.lblSoft.HRef = "SoftwarePage.aspx?userId=" + DESEncrypt.Encrypt(_id.ToString()); } catch { this.txtScoftwareScore.Text = "未评分"; } if (score_c >= 0 && score_s >= 0 && score_t >= 0) { var model = new BLL.CCOM.Comput_score().GetModel(1); decimal score = 0; if (model.Ratio_software == 0) { score = score_t * model.Ratio_teacher + (int)((score_s < score_c ? score_s : score_c) * model.Ratio_review); } else { score = score_t * model.Ratio_teacher + (int)((score_s > score_c ? score_s : score_c) * model.Ratio_review); } this.txtScore.Text = score.ToString(); } }