protected void TaskAdd_Btn_Click(object sender, EventArgs e) { M_User_Plat upMod = B_User_Plat.GetLogin(); M_Plat_Task taskMod = new M_Plat_Task(); if (Mid > 0) { taskMod = taskBll.SelReturnModel(Mid); } taskMod.TaskName = TaskName_T.Text; taskMod.TaskContent = TaskContent_T.Text; taskMod.LeaderIDS = manage_hid.Value; taskMod.PartTakeIDS = member_hid.Value; taskMod.Color = AddColor_Hid.Value; taskMod.EndTime = Convert.ToDateTime(EndTime_T.Text); if (taskMod.ID > 0) { taskBll.UpdateByID(taskMod); } else { taskMod.TaskType = 1; taskMod.Status = 1; taskMod.BeginTime = DateTime.Now; taskMod.CreateUser = upMod.UserID; taskMod.CreateUName = upMod.UserName; taskBll.Insert(taskMod); } function.WriteSuccessMsg("操作成功", "/Plat/Task/Default.aspx"); }
private void MyBind() { M_User_Plat upMod = B_User_Plat.GetLogin(); if (Mid > 0) { M_Common_Notify comMod = comBll.SelReturnModel(Mid); if (comMod.CUser != upMod.UserID) { function.WriteErrMsg("你无权修改该信息"); } MsgID = comMod.InfoID; Title_T.Text = comMod.Title; Content_T.Text = comMod.Content; BeginDate_T.Text = comMod.BeginDate.ToString("yyyy-MM-dd HH:mm:ss"); manage_hid.Value = buser.SelByIDS(comMod.ReceOrgin); function.Script(this, "SetRadVal('zstatus_rad'," + comMod.ZStatus + ");"); } else { msgMod = msgBll.SelReturnModel(MsgID); Title_T.Text = msgMod.Title; Content_T.Text = msgMod.MsgContent; BeginDate_T.Text = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); manage_hid.Value = buser.SelByIDS(upMod.UserID.ToString()); } RPT.DataSource = comBll.Blog_Sel(MsgID, -100); RPT.DataBind(); }
protected void Save_Btn_Click(object sender, EventArgs e) { M_User_Plat upMod = B_User_Plat.GetLogin(); M_Common_Notify comMod = new M_Common_Notify(); if (Mid > 0) { comMod = comBll.SelReturnModel(Mid); } comMod.Title = Title_T.Text; comMod.Content = Content_T.Text; comMod.BeginDate = Convert.ToDateTime(BeginDate_T.Text); if (!comMod.ReceOrgin.Equals(manage_hid.Value)) { comMod.ReceOrgin = StrHelper.IdsFormat(manage_hid.Value); comMod.ReceUsers = StrHelper.IdsFormat(StrHelper.RemoveRepeat(comMod.ReceOrgin.Split(','), comMod.ReadedUsers.Split(','))); } if (Mid > 0) { comBll.UpdateByID(comMod); } else { comMod.NType = 2; comMod.InfoID = MsgID; comMod.CUser = upMod.UserID; comMod.CUName = upMod.UserName; comBll.Insert(comMod); } function.WriteSuccessMsg("操作成功"); }
private void MyBind() { //如果企业已认证过,或其不是企业的创始人,则无权修改 upMod = B_User_Plat.GetLogin(); compMod = compBll.SelReturnModel(upMod.CompID); err_div.Visible = true; if (compMod.Status != 0) { err_div.InnerHtml = "该企业已经认证过了"; } else if (compMod.CreateUser != upMod.UserID) { err_div.InnerHtml = "你没有提交认证的权限"; } else if (ualyBll.CompCert_Sel((int)ZLEnum.ConStatus.UnAudit, "", upMod.UserID).Rows.Count > 0) { //检测是否已提交过申请 err_div.InnerHtml = "你已经提交过申请了,请等待管理员处理"; } else { err_div.Visible = false; ok_div.Visible = true; } }
protected void Save_Btn_Click(object sender, EventArgs e) { string telephone = Telephone_T.Text.Replace(" ", ""); string mobile = Mobile_T.Text.Replace(" ", ""); if (string.IsNullOrEmpty(telephone) && string.IsNullOrEmpty(mobile)) { function.Script(this, "alert('电话和手机不能同时为空!');"); return; } upMod = B_User_Plat.GetLogin(); JObject json = new JObject(); json.Add("mail", Mails_T.Text); json.Add("mobile", mobile); json.Add("telephone", telephone); json.Add("compid", upMod.CompID); json.Add("compshort", CompShort_T.Text); ualyMod = new M_Common_UserApply(); ualyMod.ZType = "plat_compcert"; ualyMod.UserID = upMod.UserID; ualyMod.UserName = upMod.UserName; ualyMod.Remind = CompName_T.Text; ualyMod.UserRemind = JsonConvert.SerializeObject(json); ualyBll.Insert(ualyMod); function.WriteSuccessMsg("申请已提交,请等待管理员审核", "/Plat/"); }
private void MyBind() { DataTable dt = urBll.SelByCompID(B_User_Plat.GetLogin().CompID); EGV.DataSource = dt; EGV.DataBind(); }
public void MyBind() { DataTable dt = new DataTable(); if (Source.Equals("plat"))//能力中心 { Pid_Field = "PGroup"; ID_Field = "ID"; Name_Field = "GroupName"; dt = pgroupBll.SelByCompID(B_User_Plat.GetLogin().CompID); string attlp = "<label style='margin-bottom:0px;'>@groupname<input type='checkbox' name='plat_group_chk' data-gid='@groupid' data-gname='@groupname' style='margin-left:2px;'></label>"; hasChild_tlp = ""; childs_tlp = "<div class='userlist_item group_item' data-gid='@groupid'><div class='item_face pull-left'>@depth<img src='/Images/TreeLineImages/group.gif'></div><div class='pull-left item_name'>" + attlp + "</div><div class='pull-right item_add'><a href='javascript:;' title='查看用户'><i class='fa fa-user' style='font-size:16px;'></i> 查看用户</a></div><div style='clear:both;'></div></div>"; } else if (Source.Equals("oa"))//oa组织结构 { Pid_Field = "ParentID"; ID_Field = "ID"; Name_Field = "Name"; dt = struBll.Sel(); } else { Pid_Field = "ParentGroupID"; ID_Field = "GroupID"; Name_Field = "GroupName"; dt = groupBll.Select_All(); } Group_Lit.Text = GetAllDT(dt, 0); }
/* * 父页面需要实现三个JS方法,详见示例页 * 关闭与清空chk方法,必须放在父页面调用,该页面只允许实现,选择会员,并返回Json数据. * 清空调用本页ClearChk(); */ protected void Page_Load(object sender, EventArgs e) { upMod = B_User_Plat.GetLogin(); if ((upMod == null)) { function.WriteErrMsg("无权访问该页面"); } compID = upMod.CompID; if (!IsPostBack) { DataTable dt = gpBll.SelByCompID(compID); FilterID = Request.QueryString["fid"]; dt = dt.DefaultView.ToTable(); AllInfo_Div.Visible = true; //将空的单列一组 string dli = "<li><a href='javascript:;' onclick='hiddenul(this);FilterTr(0,"全部用户")'>全部用户</a></li>"; dli += "<li><a href='javascript:;' onclick='hiddenul(this);FilterTr(-1,"未分组")'>未分组</a></li>"; AllInfo_Litral.Text = "<ul id='GroupSel'>" + dli + GetTable(dt, disType.AllInfo) + "</ul>"; if (dt != null && dt.Rows.Count > 0) { GroupID = dt.Rows[0]["ID"].ToString(); } MyBind(); } }
private void MyBind() { M_User_Plat upMod = upBll.SelReturnModel(UserID); M_Plat_Comp compMod = compBll.SelReturnModel(upMod.CompID); if (upMod.CompID != B_User_Plat.GetLogin().CompID) { function.WriteErrMsg("用户不存在"); } HoneyName_L.InnerHtml = B_User.GetUserName(upMod.UserName, upMod.TrueName); Post_L.InnerHtml = GetInfo(upMod.Post); CompName_l.InnerHtml = upMod.CompName; if (!string.IsNullOrEmpty(upMod.UserFace)) { uface_img.Src = upMod.UserFace; } //--------- Mobile_L.Text = GetInfo(upMod.Mobile); Mail_L.Text = GetInfo(""); WorkNum_L.Text = GetInfo(""); Work_L.Text = GetInfo(""); Home_L.Text = GetInfo(""); BirthDay_L.Text = GetInfo(""); uid_hid.Value = upMod.UserID.ToString(); }
protected void Save_Btn_Click(object sender, EventArgs e) { string info = ""; int id = Convert.ToInt32(string.IsNullOrEmpty(Request.QueryString["ID"]) ? "0" : Request.QueryString["ID"].ToString()); if (id > 0) { urMod = urBll.SelReturnModel(id); urMod.RoleName = RoleName_T.Text; urMod.RoleDesc = RoleDesc_T.Text; info = urBll.UpdateByID(urMod) ? "修改成功!" : "修改失败!"; } else { M_User_Plat upMod = B_User_Plat.GetLogin(); urMod.RoleName = RoleName_T.Text; urMod.RoleDesc = RoleDesc_T.Text; urMod.RoleAuth = ""; urMod.UserID = upMod.UserID; urMod.CompID = upMod.CompID; urMod.CreateTime = DateTime.Now; info = urBll.Insert(urMod) > 0 ? "添加成功!" : "添加失败!"; } function.Script(this, "alert('" + info + "');location='UserRole.aspx';"); }
//产生邀请链接 public string GetULink() { M_User_Plat upMod = B_User_Plat.GetLogin(); string code = B_Plat_Common.GetTimeStamp(upMod.CompID.ToString()); string ulink = SiteConfig.SiteInfo.SiteUrl + "/User/RegPlat?Invite=" + code; return(ulink); }
public DataTable GetUserDT() { if (Session["Plat_Default_UserFace"] == null) { Session["Plat_Default_UserFace"] = upBll.SelUserFaceDT(B_User_Plat.GetLogin().CompID); } return(Session["Plat_Default_UserFace"] as DataTable); }
private void MyBind() { M_User_Plat upMod = B_User_Plat.GetLogin(); M_Plat_Comp compMod = compBll.SelReturnModel(upMod.CompID); Title_T.Text = compMod.CompName + "办公平台"; //--------------获取本月日程数据,并转为JSON,方便绑定 myplan_hid.Value = sdlBll.SelMonthToJson(DateTime.Now, upMod.UserID); //--------------平台 M_User_Token tokenMod = tokenBll.SelModelByUid(upMod.UserID); bool flag = false; if (tokenMod != null) { if (!string.IsNullOrWhiteSpace(tokenMod.SinaToken)) { sinaBll = new SinaHelper(tokenMod.SinaToken); sina_li.Visible = true; flag = true; if (!sinaBll.CheckToken())//Token有效 { sina_li.InnerHtml = sina_li.InnerHtml + "<span class='r_red'>(已失效)</span>"; sina_li.Attributes.Add("title", "点击重新绑定"); sina_li.Attributes.Add("onclick", "OpenWin(2);"); } } if (!string.IsNullOrWhiteSpace(tokenMod.QQToken)) { qqBll = new QQHelper(tokenMod.QQToken, tokenMod.QQOpenID); qqblog_li.Visible = true; flag = true; if (!qqBll.TokenIsValid()) { qqblog_li.InnerHtml = qqblog_li.InnerHtml + "<span class='r_red'>(已失效)</span>"; qqblog_li.Attributes.Add("title", "点击重新绑定"); qqblog_li.Attributes.Add("onclick", "OpenWin(2);"); } } } bloglist.Visible = flag; noplat_div.Visible = !flag; //----------- GroupRpt.DataSource = groupBll.SelGroupByAuth(upMod.UserID); GroupRpt.DataBind(); DataTable cateDT = barBll.SelBlogCate(upMod.CompID); if (cateDT.Rows.Count > 0) { Cate_RPT.DataSource = cateDT; Cate_RPT.DataBind(); } else { Cart_RPT_Empty.Visible = true; } EndDate_T.Text = DateTime.Now.AddDays(1).ToString("yyyy/MM/dd HH:mm"); UserInfo_Hid.Value = upMod.TrueName + ":" + upMod.UserFace + ":" + upMod.UserID; ////--最近的投票 //newvote_Rep.DataSource = (from t in dt.AsEnumerable() // where t.Field<int>("MsgType") == 2 // orderby t.Field<DateTime>("CDate") // select new { Title = t.Field<string>("Title"), CDate = t.Field<DateTime>("CDate"), UserFace = t.Field<string>("UserFace") }).Take(5); //newvote_Rep.DataBind(); }
/*------------------------------------------------------------------------------*/ public string GetUserLike() { string ids = string.IsNullOrEmpty(ids_Hid.Value.Trim(',')) ? "0" : ids_Hid.Value.Trim(','); string uid = B_User_Plat.GetLogin().UserID.ToString(); string result = ""; result = "<span id=\"showlike_span\" data-init=\"" + (ids.Contains(uid) ? "1" : "0") + "\" style=\"margin-left:-5px;" + (ids.Contains(uid) ? "display:inline;" : "display:none;") + "\">1</span>"; return(result); }
private void MyBind() { //未关联部门的用户 upMod = B_User_Plat.GetLogin(); UserDT = upBll.SelByCompany(upMod.CompID); RPT.DataSource = GetGroupDT(); RPT.DataBind(); System.Web.UI.HtmlControls.HtmlGenericControl usercount_sp = new System.Web.UI.HtmlControls.HtmlGenericControl(); usercount_sp.InnerHtml = UserDT.Rows.Count.ToString(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { M_User_Plat upMod = B_User_Plat.GetLogin(); int id = DataConvert.CLng(Request.QueryString["id"]); M_Blog_Msg msgMod = msgBll.SelReturnModel(id); Response.Write(msgMod.MsgContent); Response.Flush(); Response.End(); } }
private void MyBind() { M_User_Plat upMod = B_User_Plat.GetLogin(); CompName_L.Text = upMod.CompName; DataTable dt = gpBll.SelByCompID(B_User_Plat.GetLogin().CompID); RPT.DataSource = dt; RPT.DataBind(); }
private void MyBind() { M_User_Plat upMod = B_User_Plat.GetLogin(); GroupDT = groupBll.SelByCompID(upMod.CompID); //-----------------权限校验 if (CurProID > 0) { if (!proBll.HasAuth(upMod.UserID, CurProID)) { function.WriteErrMsg("你没有权限访问该项目!!"); } } int pageCount = 0; DataTable dt = msgBll.SelByPid(psize, CPage, out pageCount, 0, upMod, upMod.Gid, CurProID, Filter, MsgType, Skey, Uids, DateStr, Mid); //LikesDt string msgids = ""; foreach (DataRow dr in dt.Rows) { msgids += dr["ID"].ToString().Trim('-') + ","; } if (!string.IsNullOrEmpty(msgids)) { LikesDt = likeBll.SelByMsgIDS(msgids.Trim(','), "plat"); } if (Filter.Contains("atuser"))//移除@ { upBll.RemoveAtCount(upMod.UserID); } //-------------------针对时间线进行处理 if (LView.Equals("timeline") || LView.Equals("tomht")) { if (CPage > 1) { Page.FindControl("ttitle_div").Visible = false; } DateTime TimeLine = DateTime.MinValue; dt.Columns.Add("timeline", typeof(string)); foreach (DataRow dr in dt.Rows) { if (TimeLine == DateTime.MinValue || DateHelper.IsMoreThanOne(TimeLine, Convert.ToDateTime(dr["cdate"]))) { TimeLine = Convert.ToDateTime(dr["cdate"]); dr["timeline"] = "date"; } else { dr["timeline"] = "time"; } } } MsgRepeater.DataSource = dt; MsgRepeater.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (B_User_Plat.GetLogin().CompID < 1) { function.WriteErrMsg("您还不是企业会员,请加入企业再使用考勤功能!"); } MyBind(); } }
protected void Del_Link_Click(object sender, EventArgs e) { taskMod = taskBll.SelReturnModel(TaskID); if (taskMod.CreateUser != B_User_Plat.GetLogin().UserID) { function.Script(this, "alert('你无权删除该任务');"); } else { taskBll.Del(TaskID); } }
public void MyBind() { DataTable dt = gpBll.SelByCompID(B_User_Plat.GetLogin().CompID); string attlp = "<label style='margin-bottom:0px;'>@groupname<input type='checkbox' name='plat_group_chk' data-gid='@groupid' data-gname='@groupname' style='margin-left:2px;'></label>"; string childs_tlp = "<div class='userlist_item group_item' data-gid='@groupid'><div class='pull-left'><i class='fa fa-users' style='color:#03a9f4;margin-right:5px;'></i></div><div class='pull-left item_name'>" + attlp + "</div><div class='pull-right item_add'><a href='javascript:;' title='查看用户'><i class='fa fa-user' style='font-size:16px;'></i> 查看用户</a></div><div style='clear:both;'></div></div>"; //Group_Lit.Text = GetAllDT(dt, 0); foreach (DataRow dr in dt.Rows) { Group_Lit.Text += TlpReplace(childs_tlp, dr); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (Pid < 0) { function.WriteErrMsg("参数不正确"); } M_User_Plat upMod = B_User_Plat.GetLogin(); RPT.DataSource = gpBll.SelByCompID(upMod.CompID, Pid); RPT.DataBind(); } }
private void MyBind() { int pcount = 0; upMod = B_User_Plat.GetLogin(); DataTable dt = topicBll.SelByPage(CPage, PSize, out pcount, upMod.CompID, upMod.UserID, Filter, Skey); RPT.DataSource = dt; RPT.DataBind(); string hrefTlp = "<a href='javascript:;' onclick='topic.load(\"" + Filter + "\",\"@query\",@page);' title=''>@text</a>"; Page_L.Text = PageCommon.CreatePageHtml(pcount, CPage, PSize, hrefTlp); }
private void MyBind() { DataTable dt = upBll.SelByCompany(B_User_Plat.GetLogin().CompID); if (!string.IsNullOrEmpty(SearchKey)) { string key = "'%" + SearchKey + "%'"; dt.DefaultView.RowFilter = "UserName like " + key + "Or GroupName like " + key; dt = dt.DefaultView.ToTable(); } EGV.DataSource = dt; EGV.DataBind(); }
public void GetTable(int year, int month) { int days = DateTime.DaysInMonth(year, month);//这个月有多少天 DateTime st = Convert.ToDateTime(year + "-" + month + "-01"); DateTime myst = new DateTime(); DataTable dt = null; if (UserID > 0) { dt = signBll.SelUserByMonth(st, UserID); } else { dt = signBll.SelUserByMonth(st, B_User_Plat.GetLogin().UserID); } int first = (int)st.DayOfWeek, index = 0; //日期标识,当前进行到了多少天 for (int i = 1; i <= 7; i++) //首周需要特殊处理 { Literal lit = DateBody.FindControl("Rep_W1_D" + i) as Literal; if (i < first) { lit.Text = GetEmptyHtml(st.AddDays(i - first)); } else { myst = st.AddDays(index); lit.Text = GetHtml(GetOneDay(dt, myst), myst); index++; } } for (int w = 2; w <= 5; w++) //第二周开始循环处理 { for (int i = 1; i <= 7; i++) //周内日循环 { Literal lit = DateBody.FindControl("Rep_W" + w + "_D" + i) as Literal; myst = st.AddDays(index); if (myst.Month > month) { lit.Text = GetEmptyHtml(myst); } else { lit.Text = GetHtml(GetOneDay(dt, myst), myst); } index++; } } }
//申请加入公司(一张表用于存其)//ZL_Plat_JoinCompApply protected void AddComp_Btn_Click(object sender, EventArgs e) { M_User_Plat upMod = B_User_Plat.GetLogin(); //记录用户信息并写入 M_Common_UserApply ualyMod = new M_Common_UserApply(); B_Common_UserApply ualyBll = new B_Common_UserApply(); ualyMod.UserID = upMod.UserID; ualyMod.ZType = "plat_joincomp"; ualyMod.UserName = upMod.UserName + "(" + upMod.TrueName + ")"; ualyMod.Remind = CompID.ToString(); ualyMod.IP = IPScaner.GetUserIP(); ualyBll.Insert(ualyMod); function.WriteSuccessMsg("申请成功,请等待管理员审核", "/Plat/"); }
public void MyBind(string search = "") { int compid = B_User_Plat.GetLogin().CompID; DataTable dt = upBll.SelByCompany(compid); EGV.DataSource = dt; string wherestr = "1=1"; if (!string.IsNullOrEmpty(search.Trim())) { wherestr += " AND UserName LIKE '%" + search + "%'"; } dt.DefaultView.RowFilter = wherestr; EGV.DataBind(); }
//添加一条留言 public M_Plat_TaskMsg FillMsg() { M_User_Plat upMod = B_User_Plat.GetLogin(); M_Plat_TaskMsg msgMod = new M_Plat_TaskMsg(); msgMod.TaskID = TaskID; msgMod.UserID = upMod.UserID; msgMod.UserName = upMod.TrueName; msgMod.MsgContent = MsgContent_T.Text; msgMod.Attach = ""; msgMod.CreateTime = DateTime.Now; msgMod.Status = 1; msgMod.MsgType = 1; return(msgMod); }
protected void BatAgree_Btn_Click(object sender, EventArgs e) { string ids = Request.Form["idchk"]; upMod = B_User_Plat.GetLogin(); //修改选定的会员的公司信息 DataTable dt = ualyBll.JoinComp_Sel(upMod.CompID.ToString(), (int)ZLEnum.ConStatus.UnAudit, ids); foreach (DataRow dr in dt.Rows) { DBCenter.UpdateSQL("ZL_User_Plat", "CompID=" + upMod.CompID + ",Plat_Role=''", "UserID=" + dr["UserID"]); } ualyBll.ChangeByIDS(ids, (int)ZLEnum.ConStatus.Audited); function.WriteSuccessMsg("批量同意完成"); }
//创建新文件夹 protected void NewFolder_Btn_Click(object sender, EventArgs e) { DirName_T.Text = DirName_T.Text.Replace(" ", ""); if (!string.IsNullOrEmpty(DirName_T.Text)) { SafeSC.CreateDir(CurPPath, DirName_T.Text); M_User_Plat upMod = B_User_Plat.GetLogin(); M_Plat_File fileMod = new M_Plat_File() { FileType = 2, CompID = upMod.CompID, UserID = upMod.UserID.ToString(), VPath = CurVPath, FileName = DirName_T.Text }; fileBll.Insert(fileMod); DirName_T.Text = ""; MyBind(); } }