public string GetOrgName(int OrgID) { Hi.Model.BD_Org org = new Hi.BLL.BD_Org().GetModel(OrgID); if (org != null) { return(org.OrgName); } else { return(""); } }
public void DataBinds() { if (KeyID > 0) { Hi.Model.BD_Org Org = new Hi.BLL.BD_Org().GetModel(KeyID); if (Org != null) { if (UserType == 3 || UserType == 4) { if (Org.ID != OrgID) { Response.Write("数据错误"); Response.End(); } } Atitle.InnerText = "机构编辑"; txtOrgName.Value = Org.OrgName; txtPrincipal.Value = Org.Principal; txtPhone.Value = Org.Phone; if (Org.IsEnabled == 0) { rdEbleYes.Checked = false; rdEbleNo.Checked = true; } txtSortIndex.Value = Org.SortIndex; txtRemark.Value = Org.Remark; List <Hi.Model.SYS_AdminUser> user = new Hi.BLL.SYS_AdminUser().GetList("", " isnull(dr,0)=0 and orgid='" + KeyID + "' and usertype in(3)", ""); if (user.Count > 0) { txtUsername.Disabled = true; txtUserPhone.Disabled = true; txtUsername.Value = user[0].LoginName; txtUserPhone.Value = user[0].Phone; txtUserTrueName.Value = user[0].TrueName; txtUpwd.Attributes.Add("value", user[0].LoginPwd); txtUpwds.Attributes.Add("value", user[0].LoginPwd); } } else { Response.Write("数据错误"); Response.End(); } } else { txtUpwd.Attributes.Add("value", "123456"); txtUpwds.Attributes.Add("value", "123456"); } }
public void DataBinds() { Hi.Model.BD_Org Org = new Hi.BLL.BD_Org().GetModel(KeyID); if (Org != null) { if (UserType == 3 || UserType == 4) { if (Org.ID != OrgID) { Response.Write("数据错误"); Response.End(); } } if (Request["type"] == "3") { libtnUse.Visible = false; libtnNUse.Visible = false; libtnEdit.Visible = false; lblbtnback.Attributes["onclick"] = "javascript:window.location.href='OrgUserList.aspx?page=" + Request["page"] + "';"; } if (Request["type"] == "2") { Atitle.InnerText = "机构查看"; lblbtnback.Attributes["onclick"] = "javascript:window.location.href='OrgList.aspx?page=" + Request["page"] + "';"; } if (Org.IsEnabled == 1) { libtnUse.Visible = false; } else { libtnNUse.Visible = false; } lblOrgName.InnerText = Org.OrgName; lblPrincipal.InnerText = Org.Principal; lblPhone.InnerText = Org.Phone; lblRemark.InnerText = Org.Remark; lblIsEnabled.InnerHtml = Org.IsEnabled == 1 ? "启用" : "<i style='color:red'>禁用</i>"; } else { Response.Write("数据不存在"); Response.End(); } }
protected void btn_NUse(object sender, EventArgs e) { Hi.Model.BD_Org Org = new Hi.BLL.BD_Org().GetModel(KeyID); if (Org != null) { Org.IsEnabled = 0; Org.ts = DateTime.Now; Org.modifyuser = UserID; if (new Hi.BLL.BD_Org().Update(Org)) { List <Hi.Model.SYS_AdminUser> user = new Hi.BLL.SYS_AdminUser().GetList("", " isnull(dr,0)=0 and orgid=" + KeyID + "", ""); foreach (Hi.Model.SYS_AdminUser model1 in user) { model1.IsEnabled = 0; model1.ts = DateTime.Now; model1.modifyuser = UserID; new Hi.BLL.SYS_AdminUser().Update(model1); } JScript.AlertMsgMo(this, "用户禁用成功", "function(){ window.location.href='OrgList.aspx'; }"); } } }
public void DataBinds() { int pageCount = 0; int Counts = 0; if (this.txtPageSize.Value.ToString() != "" && int.TryParse(txtPageSize.Value.Trim(), out pageCount)) { if (this.txtPageSize.Value.Trim().Length >= 5) { Pager.PageSize = 100; this.txtPageSize.Value = "100"; } else { Pager.PageSize = this.txtPageSize.Value.Trim().ToInt(0); } } List <Hi.Model.BD_Org> Lorg = new Hi.BLL.BD_Org().GetList(Pager.PageSize, Pager.CurrentPageIndex, "id", false, SearchWhere(), out pageCount, out Counts); this.Rpt_Org.DataSource = Lorg; this.Rpt_Org.DataBind(); Pager.RecordCount = Counts; page = Pager.CurrentPageIndex.ToString(); }
private void Binds() { //待审的企业 List <Hi.Model.BD_Company> l = new Hi.BLL.BD_Company().GetList("id", "isnull(dr,0)=0 and orgid=" + OrgID + " and isenabled=1 and Auditstate<>2" + (this.OrgID == 0 ? "" : " and isnull(orgid,0)=" + this.OrgID), ""); this.lblCompcount.InnerText = l.Count.ToString(); //待处理留言 List <Hi.Model.SYS_UserMessage> l2 = new Hi.BLL.SYS_UserMessage().GetList("id", "isnull(dr,0)=0 and State=0", ""); this.lblMessage.InnerText = l2.Count.ToString(); //前台显示的企业 List <Hi.Model.BD_Company> ll = new Hi.BLL.BD_Company().GetList("id", "Auditstate=2 and orgid=" + OrgID + " and isenabled=1 and ISNULL(dr,0)=0 and FirstShow=1" + (this.OrgID == 0 ? "" : " and isnull(orgid,0)=" + this.OrgID), ""); this.lblShowcount.InnerText = ll.Count.ToString(); //机构 if (OrgID == 0) { } List <Hi.Model.BD_Org> lll = new Hi.BLL.BD_Org().GetList("id", "isenabled=1 and ISNULL(dr,0)=0", ""); this.lblOrgcount.InnerText = lll.Count.ToString(); NewsBind(); // 新闻公告 Bind(); //统计 }
protected void btnAdd_Click(object sender, EventArgs e) { if (KeyID > 0) { Hi.Model.BD_Org org = new Hi.BLL.BD_Org().GetModel(KeyID); if (org != null) { if (Common.OrgExistsAttribute("OrgName", txtOrgName.Value.Trim(), KeyID.ToString())) { JScript.AlertMsg(this, "该机构名称已存在。"); return; } org.OrgName = Common.NoHTML(txtOrgName.Value.Trim()); org.Principal = Common.NoHTML(txtPrincipal.Value.Trim()); org.Phone = Common.NoHTML(txtPhone.Value.Trim()); org.IsEnabled = rdEbleYes.Checked ? 1 : 0; org.SortIndex = Common.NoHTML(txtSortIndex.Value.Trim()); org.Remark = Common.NoHTML(txtRemark.Value.Trim()); org.ts = DateTime.Now; org.modifyuser = UserID; if (new Hi.BLL.BD_Org().Update(org)) { List <Hi.Model.SYS_AdminUser> user = new Hi.BLL.SYS_AdminUser().GetList("", " isnull(dr,0)=0 and orgid='" + KeyID + "' and usertype in(3)", ""); if (user.Count > 0) { if (user[0].LoginPwd != txtUpwd.Text.Trim()) { user[0].LoginPwd = Util.md5(txtUpwd.Text.Trim()); } user[0].TrueName = Common.NoHTML(txtUserTrueName.Value.Trim()); user[0].IsEnabled = rdEbleYes.Checked ? 1 : 0; user[0].ts = DateTime.Now; user[0].modifyuser = UserID; new Hi.BLL.SYS_AdminUser().Update(user[0]); Response.Redirect("OrgInfo.aspx?KeyID=" + KeyID + "&type=2&page=1"); } else { Hi.Model.SYS_AdminUser userModel = new Hi.Model.SYS_AdminUser(); userModel.OrgID = KeyID; userModel.UserType = 3; userModel.IsEnabled = rdEbleYes.Checked ? 1 : 0; userModel.LoginName = Common.NoHTML(txtUsername.Value.Trim()); userModel.LoginPwd = Util.md5(txtUpwd.Text.Trim()); userModel.Phone = Common.NoHTML(txtUserPhone.Value.Trim()); userModel.TrueName = Common.NoHTML(txtUserTrueName.Value.Trim()); userModel.CreateDate = DateTime.Now; userModel.CreateUserID = UserID; userModel.ts = DateTime.Now; userModel.modifyuser = UserID; if (new Hi.BLL.SYS_AdminUser().Add(userModel) > 0) { Response.Redirect("OrgInfo.aspx?KeyID=" + KeyID + "&type=2&page=1"); } else { new Hi.BLL.BD_Org().Delete(KeyID); } } } } } else { if (Common.OrgExistsAttribute("OrgName", txtOrgName.Value.Trim())) { JScript.AlertMsg(this, "该机构名称已存在。"); return; } if (Common.SysUserExistsAttribute("LoginName", txtUsername.Value.Trim())) { JScript.AlertMsg(this, "该登录帐号已存在。"); return; } Hi.Model.BD_Org org = new Hi.Model.BD_Org(); org.OrgName = Common.NoHTML(txtOrgName.Value.Trim()); org.Principal = Common.NoHTML(txtPrincipal.Value.Trim()); org.Phone = Common.NoHTML(txtPhone.Value.Trim()); org.IsEnabled = rdEbleYes.Checked ? 1 : 0; org.SortIndex = Common.NoHTML(txtSortIndex.Value.Trim()); org.Remark = Common.NoHTML(txtRemark.Value.Trim()); org.ts = DateTime.Now; org.modifyuser = UserID; int Orgid = 0; if ((Orgid = new Hi.BLL.BD_Org().Add(org)) > 0) { Hi.Model.SYS_AdminUser user = new Hi.Model.SYS_AdminUser(); user.OrgID = Orgid; user.UserType = 3; user.IsEnabled = rdEbleYes.Checked ? 1 : 0; user.LoginName = Common.NoHTML(txtUsername.Value.Trim()); user.LoginPwd = Util.md5(txtUpwd.Text.Trim()); user.Phone = Common.NoHTML(txtUserPhone.Value.Trim()); user.TrueName = Common.NoHTML(txtUserTrueName.Value.Trim()); user.CreateDate = DateTime.Now; user.CreateUserID = UserID; user.ts = DateTime.Now; user.modifyuser = UserID; if (new Hi.BLL.SYS_AdminUser().Add(user) > 0) { Response.Redirect("OrgInfo.aspx?KeyID=" + Orgid + "&type=2&page=1"); } else { new Hi.BLL.BD_Org().Delete(Orgid); } } } }