protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
        {
            JumbotOA.Entity.UserEntity userEntity = new JumbotOA.Entity.UserEntity();

                //可以添加
                JumbotOA.Entity.MessageEntity message = new JumbotOA.Entity.MessageEntity();
                message.Content = this.FCKeditor1.Value;
                message.FromUid = UserId;
                message.Addtime = System.DateTime.Now;
                message.Mtitle = this.txtTitle.Text;
                if (mes != 0)
                {
                    message.ToUid = _uid;
                }
                else
                {
                 if (DropDownList1.SelectedValue =="-1")
                   {
                     System.Web.UI.Page page = (System.Web.UI.Page)System.Web.HttpContext.Current.Handler;
                     page.ClientScript.RegisterStartupScript(page.GetType(), "clientScript", "<script language='javascript'>alert('请选择收信人!');</script>");
                     return;
                   }else
                     message.ToUid = Convert.ToInt32(DropDownList2.SelectedValue.ToString());
                }
            int i = new JumbotOA.BLL.MessageBLL().Add(message);
                if (i > 0)
                {
                    JumbotOA.BLL.OA_SysMessageIn.ADDsysMessage(0, "," + message.ToUid + ",", "新短信", JumbotOA.Utils.Strings.Left(JumbotOA.Utils.Strings.delhtml(txtTitle.Text.Trim()), 53), "Message_Show.aspx?id=" + i.ToString());
                    FinalMessage("短信发送成功", "Message_MySend.aspx", 0);
                }
                else
                {
                    FinalMessage("短信发送失败", "Message_MySend.aspx", 0);
                }
        }
        //判断是否自动登录
        void Autologin()
        {
            if (JumbotOA.Utils.Cookie.GetValue("oa_user") != null)
            {
                if (JumbotOA.Utils.Cookie.GetValue("oa_user", "ip") == Request.UserHostAddress)
                {
                    JumbotOA.Entity.UserEntity model = new JumbotOA.Entity.UserEntity();
                    model = new JumbotOA.BLL.UserBLL().GetEntity(Convert.ToInt32(JumbotOA.Utils.Cookie.GetValue("oa_user", "id")));
                    int pid = model.Pid;
                    new BLL.UserBLL().UpdateTime(model.Uid);
                    switch (pid)
                    {
                    case 1:
                        Response.Redirect("Home1.aspx");
                        break;

                    case 2:
                        Response.Redirect("Home2.aspx");
                        break;

                    case 3:
                        Response.Redirect("Home3.aspx");
                        break;

                    case 4:
                        Response.Redirect("Home4.aspx");
                        break;
                    }
                }
            }
        }
 //数据绑定
 void Bind()
 {
     int uid = Str2Int(q("id"), 0);
     JumbotOA.Entity.UserEntity model = new JumbotOA.Entity.UserEntity();
     model = new JumbotOA.BLL.UserBLL().GetEntity(uid);
     this.txtUname.Text = model.Uname;
 }
 /// <summary>
 /// 验证登陆
 /// </summary>
 private void chkLogin(string go2Url, int BackStep)
 {
     if (JumbotOA.Utils.Cookie.GetValue("oa_user") != null)
     {
         UserId   = Validator.StrToInt(JumbotOA.Utils.Cookie.GetValue("oa_user", "id"), 0);
         UserName = JumbotOA.Utils.Cookie.GetValue("oa_user", "name");
         if (UserId != 0 && UserName.Length != 0)
         {
             JumbotOA.Entity.UserEntity model = new JumbotOA.Entity.UserEntity();
             model = new BLL.UserBLL().GetEntity(UserId);
             if (model.Uipaddress.Length > 0)
             {
                 if (Request.UserHostAddress != model.Uipaddress)
                 {
                     showErrMsg("非法IP地址登录", go2Url, BackStep);
                     return;
                 }
             }
             this.UserIsLogin = true;
             UserPosition     = model.Position;
             UserPowerId      = model.Pid;
             UserDepartmentId = model.Did;
             UserSetting      = model.Setting;
         }
     }
 }
Esempio n. 5
0
        //数据绑定
        void Bind()
        {
            int uid = Str2Int(q("id"), 0);

            JumbotOA.Entity.UserEntity model = new JumbotOA.Entity.UserEntity();
            model = new JumbotOA.BLL.UserBLL().GetEntity(uid);
            this.txtUname.Text = model.Uname;
        }
Esempio n. 6
0
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(JumbotOA.Entity.UserEntity model)
        {
            if (Exists(model.Uname))//已经存在该用户
            {
                return(0);
            }
            StringBuilder strSql  = new StringBuilder();
            StringBuilder strSql1 = new StringBuilder();
            StringBuilder strSql2 = new StringBuilder();

            strSql1.Append("Pid,");
            strSql2.Append("" + model.Pid + ",");
            strSql1.Append("Did,");
            strSql2.Append("" + model.Did + ",");

            if (model.Uname != null)
            {
                strSql1.Append("Uname,");
                strSql2.Append("'" + model.Uname + "',");
            }
            if (model.Upwd != null)
            {
                strSql1.Append("Upwd,");
                strSql2.Append("'" + model.Upwd + "',");
            }
            if (model.Uipaddress != null)
            {
                strSql1.Append("Uipaddress,");
                strSql2.Append("'" + model.Uipaddress + "',");
            }
            if (model.Position != null)
            {
                strSql1.Append("Position,");
                strSql2.Append("'" + model.Position + "',");
            }
            if (model.Setting != null)
            {
                strSql1.Append("Setting,");
                strSql2.Append("'" + model.Setting + "',");
            }
            strSql.Append("insert into [OA_User](");
            strSql.Append(strSql1.ToString().Remove(strSql1.Length - 1));
            strSql.Append(")");
            strSql.Append(" values (");
            strSql.Append(strSql2.ToString().Remove(strSql2.Length - 1));
            strSql.Append(")");
            strSql.Append(";select @@IDENTITY");
            object obj = DbHelperSQL.GetSingle(strSql.ToString());

            if (obj == null)
            {
                return(1);
            }
            else
            {
                return(Convert.ToInt32(obj));
            }
        }
        // 登录
        protected void ibLogin_Click(object sender, ImageClickEventArgs e)
        {
            // 记录其IP地址,下次登录时验证,IP为空则记录,IP不为空则验证
            string uname = this.tbUname.Value;
            string upwd  = this.tbPwd.Value;
            string uid   = new JumbotOA.BLL.UserBLL().Existslongin(uname, JumbotOA.Utils.MD5.Lower32(upwd));

            if (uid != "")
            {
                JumbotOA.Entity.UserEntity model = new JumbotOA.Entity.UserEntity();
                model = new JumbotOA.BLL.UserBLL().GetEntity(int.Parse(uid));
                if (model.Uipaddress != "")
                {
                    if (model.Uipaddress != Page.Request.UserHostAddress)
                    {
                        Response.Write("<script>alert('非法IP,请在本机登陆!');</script>");
                        Response.End();
                    }
                }
                int iExpires = 0;
                //设置Cookies
                System.Collections.Specialized.NameValueCollection myCol = new System.Collections.Specialized.NameValueCollection();
                myCol.Add("id", uid.ToString());
                myCol.Add("name", uname);
                myCol.Add("ip", Request.UserHostAddress);
                new BLL.UserBLL().UpdateTime(model.Uid);
                int pid = model.Pid;
                myCol.Add("Powerid", pid.ToString());
                JumbotOA.Utils.Cookie.SetObj("oa_user", 60 * 60 * 15 * iExpires, myCol, "", "/");

                switch (pid)
                {
                case 1:
                    Response.Redirect("Home1.aspx");    //管理员
                    break;

                case 2:
                    Response.Redirect("Home2.aspx");    //管理组织层
                    break;

                case 3:
                    Response.Redirect("Home3.aspx");    //网站编辑
                    break;

                case 4:
                    Response.Redirect("Home4.aspx");    //美工和程序员
                    break;
                }
            }
            else
            {
                this.tbUname.Value = "";
                this.tbPwd.Value   = "";
                System.Web.UI.Page page = (System.Web.UI.Page)System.Web.HttpContext.Current.Handler;
                page.ClientScript.RegisterStartupScript(page.GetType(), "clientScript", "<script language='javascript'>alert('请正确填写用户名和密码!');</script>");
            }
        }
        // 登录
        protected void ibLogin_Click(object sender, ImageClickEventArgs e)
        {
            // 记录其IP地址,下次登录时验证,IP为空则记录,IP不为空则验证
            string uname = this.tbUname.Value;
            string upwd = this.tbPwd.Value;
            string uid = new JumbotOA.BLL.UserBLL().Existslongin(uname, JumbotOA.Utils.MD5.Lower32(upwd));
            if (uid != "")
            {
                JumbotOA.Entity.UserEntity model = new JumbotOA.Entity.UserEntity();
                model = new JumbotOA.BLL.UserBLL().GetEntity(int.Parse(uid));
                if (model.Uipaddress != "")
                {
                    if (model.Uipaddress != Page.Request.UserHostAddress)
                    {
                        Response.Write("<script>alert('非法IP,请在本机登陆!');</script>");
                        Response.End();
                    }
                }
                int iExpires = 0;
                //设置Cookies
                System.Collections.Specialized.NameValueCollection myCol = new System.Collections.Specialized.NameValueCollection();
                myCol.Add("id", uid.ToString());
                myCol.Add("name", uname);
                myCol.Add("ip", Request.UserHostAddress);
                new BLL.UserBLL().UpdateTime(model.Uid);
                int pid = model.Pid;
                myCol.Add("Powerid",pid.ToString());
                JumbotOA.Utils.Cookie.SetObj("oa_user", 60 * 60 * 15 * iExpires, myCol, "", "/");

                switch (pid)
                {
                    case 1:
                        Response.Redirect("Home1.aspx");//管理员
                        break;
                    case 2:
                        Response.Redirect("Home2.aspx");//管理组织层
                        break;
                    case 3:
                        Response.Redirect("Home3.aspx");//网站编辑
                        break;
                    case 4:
                        Response.Redirect("Home4.aspx");//美工和程序员
                        break;
                }
            }
            else
            {
                this.tbUname.Value = "";
                this.tbPwd.Value = "";
                System.Web.UI.Page page = (System.Web.UI.Page)System.Web.HttpContext.Current.Handler;
                page.ClientScript.RegisterStartupScript(page.GetType(), "clientScript", "<script language='javascript'>alert('请正确填写用户名和密码!');</script>");
            }
        }
Esempio n. 9
0
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public void Update(JumbotOA.Entity.UserEntity model)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("update [OA_User] set ");
            strSql.Append("Pid=" + model.Pid + ",");
            strSql.Append("Uname='" + model.Uname + "',");
            strSql.Append("Did='" + model.Did + "',");
            strSql.Append("Upwd='" + model.Upwd + "',");
            strSql.Append("Position='" + model.Position + "',");
            strSql.Append("Setting='" + model.Setting + "',");
            strSql.Append("Uipaddress='" + model.Uipaddress + "'");
            strSql.Append(" where Uid=" + model.Uid + " ");
            DbHelperSQL.ExecuteSql(strSql.ToString());
        }
 //信息绑定
 void Bind()
 {
     JumbotOA.Entity.TaskEntity model = new JumbotOA.Entity.TaskEntity();
     model = new BLL.TaskBLL().GetEntity(Str2Int(q("id")));
     if (model.Ttype == "锁定")
     {
         Response.Redirect("Locked.aspx");
     }
     JumbotOA.Entity.UserEntity userEntity = new JumbotOA.Entity.UserEntity();
     userEntity                   = new BLL.UserBLL().GetEntity(model.Uid);
     this.txtBegintime.Text       = model.Nowtime.ToString();
     this.txtEndtime.Text         = model.Plantime.ToString();
     this.txtTitle.Text           = model.Tasktitle;
     this.ddlWorker.SelectedValue = userEntity.Uid.ToString();
     txt.Text                   = model.Content;
     questext.Text              = model.Question;
     this.ddlWorker.Enabled     = false;
     this.classse.SelectedValue = model.Classse;
 }
Esempio n. 11
0
        protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
        {
            JumbotOA.Entity.UserEntity userEntity = new JumbotOA.Entity.UserEntity();

            //可以添加
            JumbotOA.Entity.MessageEntity message = new JumbotOA.Entity.MessageEntity();
            message.Content = this.FCKeditor1.Value;
            message.FromUid = UserId;
            message.Addtime = System.DateTime.Now;
            message.Mtitle  = this.txtTitle.Text;
            if (mes != 0)
            {
                message.ToUid = _uid;
            }
            else
            {
                if (DropDownList1.SelectedValue == "-1")
                {
                    System.Web.UI.Page page = (System.Web.UI.Page)System.Web.HttpContext.Current.Handler;
                    page.ClientScript.RegisterStartupScript(page.GetType(), "clientScript", "<script language='javascript'>alert('请选择收信人!');</script>");
                    return;
                }
                else
                {
                    message.ToUid = Convert.ToInt32(DropDownList2.SelectedValue.ToString());
                }
            }
            int i = new JumbotOA.BLL.MessageBLL().Add(message);

            if (i > 0)
            {
                JumbotOA.BLL.OA_SysMessageIn.ADDsysMessage(0, "," + message.ToUid + ",", "新短信", JumbotOA.Utils.Strings.Left(JumbotOA.Utils.Strings.delhtml(txtTitle.Text.Trim()), 53), "Message_Show.aspx?id=" + i.ToString());
                FinalMessage("短信发送成功", "Message_MySend.aspx", 0);
            }
            else
            {
                FinalMessage("短信发送失败", "Message_MySend.aspx", 0);
            }
        }
Esempio n. 12
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public JumbotOA.Entity.UserEntity GetEntity(int Uid)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1  ");
            strSql.Append(" Uid,Pid,Did,Uname,Upwd,Uipaddress,Position,Setting ");
            strSql.Append(" FROM [OA_User] ");
            strSql.Append(" where Uid=" + Uid + " ");
            JumbotOA.Entity.UserEntity model = new JumbotOA.Entity.UserEntity();
            DataSet ds = DbHelperSQL.Query(strSql.ToString());

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["Uid"].ToString() != "")
                {
                    model.Uid = int.Parse(ds.Tables[0].Rows[0]["Uid"].ToString());
                }
                if (ds.Tables[0].Rows[0]["Did"].ToString() != "")
                {
                    model.Did = int.Parse(ds.Tables[0].Rows[0]["Did"].ToString());
                }
                if (ds.Tables[0].Rows[0]["Pid"].ToString() != "")
                {
                    model.Pid = int.Parse(ds.Tables[0].Rows[0]["Pid"].ToString());
                }
                model.Uname      = ds.Tables[0].Rows[0]["Uname"].ToString();
                model.Upwd       = ds.Tables[0].Rows[0]["Upwd"].ToString();
                model.Uipaddress = ds.Tables[0].Rows[0]["Uipaddress"].ToString();
                model.Position   = ds.Tables[0].Rows[0]["Position"].ToString();
                model.Setting    = ds.Tables[0].Rows[0]["Setting"].ToString();
                return(model);
            }
            else
            {
                return(null);
            }
        }
Esempio n. 13
0
 void showlist()
 {
     if (txtid.Text.Trim() != "")
     {
         qs.Visible = true;
         JumbotOA.Entity.TaskEntity model = new JumbotOA.Entity.TaskEntity();
         int id = Convert.ToInt32(txtid.Text.Trim());
         model = new BLL.TaskBLL().GetEntity(id);
         if (id == 4 || id == 8)
         {
             Workprogress.SelectedValue = model.Workprogress.ToString();
         }
         this.txtBegintime.Text = model.Nowtime.ToString();
         this.txtEndtime.Text   = model.Plantime.ToString();
         this.txtTitle.Text     = model.Tasktitle.ToString();
         JumbotOA.Entity.UserEntity userEntity = new JumbotOA.Entity.UserEntity();
         userEntity  = new BLL.UserBLL().GetEntity(model.Uid);
         Uidtxt.Text = userEntity.Uname.ToString();
     }
     else
     {
         qs.Visible = false;
     }
 }
        //数据绑定
        void Bind()
        {
            int uid = Str2Int(q("id"), 0);
            department();
            roless();

            JumbotOA.Entity.UserEntity model = new JumbotOA.Entity.UserEntity();
            model = new JumbotOA.BLL.UserBLL().GetEntity(uid);
            this.txtUname.Text = model.Uname;
            this.txtUname.ReadOnly = true;
               // this.txtPosition.Text = model.Position; //职位
            this.txtIpaddress.Text = model.Uipaddress;
            string user_setting = "";
            string[,] menu = null;
            if (pidtxt.Text != "")
            {
                Entity.PowerEntity powerEntity = new BLL.PowerBLL().GetEntity(Convert.ToInt32(pidtxt.Text.Trim()));
                user_setting = powerEntity.Setting;
                int pid = Convert.ToInt32(pidtxt.Text);

                if (depid.Text != "")
                    DropDownList1.SelectedValue = depid.Text.ToString();
                else
                { DropDownList1.SelectedValue = model.Did.ToString(); }
                DropDownList2.SelectedValue = pid.ToString();
                if(pid==1)
                 menu = powerMenu1();
                if (pid == 2)
                    menu = powerMenu2();
                else if (pid == 3)
                    menu = powerMenu3();
                else if (pid == 4)
                    menu = powerMenu4();
            }
            else
            {
                DropDownList1.SelectedValue = model.Did.ToString();

                DropDownList2.SelectedValue = model.Pid.ToString();
                user_setting = model.Setting;
                if (model.Pid == 1)
                    menu = powerMenu1();
                if (model.Pid == 2)
                    menu = powerMenu2();
                else if (model.Pid == 3)
                    menu = powerMenu3();
                else if (model.Pid == 4)
                    menu = powerMenu4();
            }

            StringBuilder sb = new StringBuilder();
            sb.Append("<table cellspacing=\"0\" width=\"100%\" cellpadding=\"0\" align=\"center\">");
            for (int i = 0; i < menu.GetLength(0); i++)
            {
                sb.Append("<tr><td width=\"260\" align=\"right\"><strong>" + menu[i, 0] + "</strong></td>");
                sb.Append("<td width=\"*\">");
                for (int j = 1; j < menu.GetLength(1); j++)
                {
                    if (menu[i, j] == null)
                        break;
                    string[] _split = menu[i, j].Split('|');
                    sb.Append("<span style='float:left;height:30px;margin-left:10px;padding-top:5px;' scope='col'><input id=\"user_setting_" + i + "_" + j + "\" type=checkbox class='checkbox' name=\"user_setting\" value=\"");
                    string tPower = _split[1];
                    sb.Append(tPower + "\"");
                    if (_split.Length > 2 && _split[2] == "1")
                        sb.Append(" onclick='if(!this.checked){this.checked=true;}else{this.checked=false;}'");
                    if (user_setting.Contains("," + tPower + ","))
                        sb.Append(" checked");
                    sb.Append("><label for=\"user_setting_" + i + "_" + j + "\">" + _split[0] + "</label>");
                    sb.Append("</span>\r\n");
                }
                sb.Append("</td></tr>");
            }
            sb.Append("</td></tr>");
            sb.Append("</table>");
            this.ltMasterSetting.Text = sb.ToString();
        }
 /// <summary>
 /// �õ�һ������ʵ��
 /// </summary>
 public JumbotOA.Entity.UserEntity GetEntity(int Uid)
 {
     StringBuilder strSql = new StringBuilder();
     strSql.Append("select  top 1  ");
     strSql.Append(" Uid,Pid,Did,Uname,Upwd,Uipaddress,Position,Setting ");
     strSql.Append(" FROM [OA_User] ");
     strSql.Append(" where Uid=" + Uid + " ");
     JumbotOA.Entity.UserEntity model = new JumbotOA.Entity.UserEntity();
     DataSet ds = DbHelperSQL.Query(strSql.ToString());
     if (ds.Tables[0].Rows.Count > 0)
     {
         if (ds.Tables[0].Rows[0]["Uid"].ToString() != "")
         {
             model.Uid = int.Parse(ds.Tables[0].Rows[0]["Uid"].ToString());
         }
         if (ds.Tables[0].Rows[0]["Did"].ToString() != "")
         {
             model.Did = int.Parse(ds.Tables[0].Rows[0]["Did"].ToString());
         }
         if (ds.Tables[0].Rows[0]["Pid"].ToString() != "")
         {
             model.Pid = int.Parse(ds.Tables[0].Rows[0]["Pid"].ToString());
         }
         model.Uname = ds.Tables[0].Rows[0]["Uname"].ToString();
         model.Upwd = ds.Tables[0].Rows[0]["Upwd"].ToString();
         model.Uipaddress = ds.Tables[0].Rows[0]["Uipaddress"].ToString();
         model.Position = ds.Tables[0].Rows[0]["Position"].ToString();
         model.Setting = ds.Tables[0].Rows[0]["Setting"].ToString();
         return model;
     }
     else
     {
         return null;
     }
 }
        //信息绑定
        void Bind()
        {
            JumbotOA.Entity.TaskEntity model = new JumbotOA.Entity.TaskEntity();
            model = new BLL.TaskBLL().GetEntity(Str2Int(q("id")));
            if (model.Ttype == "锁定")
            {
                Response.Redirect("Locked.aspx");

            }
            JumbotOA.Entity.UserEntity userEntity = new JumbotOA.Entity.UserEntity();
            userEntity = new BLL.UserBLL().GetEntity(model.Uid);
            this.txtBegintime.Text = model.Nowtime.ToString();
            this.txtEndtime.Text = model.Plantime.ToString();
            this.txtTitle.Text = model.Tasktitle;
            this.ddlWorker.SelectedValue = userEntity.Uid.ToString();
            txt.Text = model.Content;
            questext.Text = model.Question;
            this.ddlWorker.Enabled = false;
            this.classse.SelectedValue = model.Classse;
        }
Esempio n. 17
0
        //数据绑定
        void Bind()
        {
            int uid = Str2Int(q("id"), 0);

            department();
            roless();

            JumbotOA.Entity.UserEntity model = new JumbotOA.Entity.UserEntity();
            model = new JumbotOA.BLL.UserBLL().GetEntity(uid);
            this.txtUname.Text     = model.Uname;
            this.txtUname.ReadOnly = true;
            // this.txtPosition.Text = model.Position; //职位
            this.txtIpaddress.Text = model.Uipaddress;
            string user_setting = "";

            string[,] menu = null;
            if (pidtxt.Text != "")
            {
                Entity.PowerEntity powerEntity = new BLL.PowerBLL().GetEntity(Convert.ToInt32(pidtxt.Text.Trim()));
                user_setting = powerEntity.Setting;
                int pid = Convert.ToInt32(pidtxt.Text);

                if (depid.Text != "")
                {
                    DropDownList1.SelectedValue = depid.Text.ToString();
                }
                else
                {
                    DropDownList1.SelectedValue = model.Did.ToString();
                }
                DropDownList2.SelectedValue = pid.ToString();
                if (pid == 1)
                {
                    menu = powerMenu1();
                }
                if (pid == 2)
                {
                    menu = powerMenu2();
                }
                else if (pid == 3)
                {
                    menu = powerMenu3();
                }
                else if (pid == 4)
                {
                    menu = powerMenu4();
                }
            }
            else
            {
                DropDownList1.SelectedValue = model.Did.ToString();

                DropDownList2.SelectedValue = model.Pid.ToString();
                user_setting = model.Setting;
                if (model.Pid == 1)
                {
                    menu = powerMenu1();
                }
                if (model.Pid == 2)
                {
                    menu = powerMenu2();
                }
                else if (model.Pid == 3)
                {
                    menu = powerMenu3();
                }
                else if (model.Pid == 4)
                {
                    menu = powerMenu4();
                }
            }

            StringBuilder sb = new StringBuilder();

            sb.Append("<table cellspacing=\"0\" width=\"100%\" cellpadding=\"0\" align=\"center\">");
            for (int i = 0; i < menu.GetLength(0); i++)
            {
                sb.Append("<tr><td width=\"260\" align=\"right\"><strong>" + menu[i, 0] + "</strong></td>");
                sb.Append("<td width=\"*\">");
                for (int j = 1; j < menu.GetLength(1); j++)
                {
                    if (menu[i, j] == null)
                    {
                        break;
                    }
                    string[] _split = menu[i, j].Split('|');
                    sb.Append("<span style='float:left;height:30px;margin-left:10px;padding-top:5px;' scope='col'><input id=\"user_setting_" + i + "_" + j + "\" type=checkbox class='checkbox' name=\"user_setting\" value=\"");
                    string tPower = _split[1];
                    sb.Append(tPower + "\"");
                    if (_split.Length > 2 && _split[2] == "1")
                    {
                        sb.Append(" onclick='if(!this.checked){this.checked=true;}else{this.checked=false;}'");
                    }
                    if (user_setting.Contains("," + tPower + ","))
                    {
                        sb.Append(" checked");
                    }
                    sb.Append("><label for=\"user_setting_" + i + "_" + j + "\">" + _split[0] + "</label>");
                    sb.Append("</span>\r\n");
                }
                sb.Append("</td></tr>");
            }
            sb.Append("</td></tr>");
            sb.Append("</table>");
            this.ltMasterSetting.Text = sb.ToString();
        }
 //判断是否自动登录
 void Autologin()
 {
     if (JumbotOA.Utils.Cookie.GetValue("oa_user") != null)
     {
         if (JumbotOA.Utils.Cookie.GetValue("oa_user", "ip") == Request.UserHostAddress)
         {
             JumbotOA.Entity.UserEntity model = new JumbotOA.Entity.UserEntity();
             model = new JumbotOA.BLL.UserBLL().GetEntity(Convert.ToInt32(JumbotOA.Utils.Cookie.GetValue("oa_user", "id")));
             int pid = model.Pid;
             new BLL.UserBLL().UpdateTime(model.Uid);
             switch (pid)
             {
                 case 1:
                     Response.Redirect("Home1.aspx");
                     break;
                 case 2:
                     Response.Redirect("Home2.aspx");
                     break;
                 case 3:
                     Response.Redirect("Home3.aspx");
                     break;
                 case 4:
                     Response.Redirect("Home4.aspx");
                     break;
             }
         }
     }
 }
 /// <summary>
 /// 验证登陆
 /// </summary>
 private void chkLogin(string go2Url, int BackStep)
 {
     if (JumbotOA.Utils.Cookie.GetValue("oa_user") != null)
     {
         UserId = Validator.StrToInt(JumbotOA.Utils.Cookie.GetValue("oa_user", "id"), 0);
         UserName = JumbotOA.Utils.Cookie.GetValue("oa_user", "name");
         if (UserId != 0 && UserName.Length != 0)
         {
             JumbotOA.Entity.UserEntity model = new JumbotOA.Entity.UserEntity();
             model = new BLL.UserBLL().GetEntity(UserId);
             if (model.Uipaddress.Length > 0)
             {
                 if (Request.UserHostAddress != model.Uipaddress)
                 {
                     showErrMsg("非法IP地址登录", go2Url, BackStep);
                     return;
                 }
             }
             this.UserIsLogin = true;
             UserPosition = model.Position;
             UserPowerId = model.Pid;
             UserDepartmentId = model.Did;
             UserSetting = model.Setting;
         }
     }
 }
 void showlist()
 {
     if (txtid.Text.Trim() != "")
     {
         qs.Visible = true;
         JumbotOA.Entity.TaskEntity model = new JumbotOA.Entity.TaskEntity();
         int id = Convert.ToInt32(txtid.Text.Trim());
         model = new BLL.TaskBLL().GetEntity(id);
         if (id == 4 || id == 8)
         { Workprogress.SelectedValue = model.Workprogress.ToString(); }
         this.txtBegintime.Text = model.Nowtime.ToString();
         this.txtEndtime.Text = model.Plantime.ToString();
         this.txtTitle.Text = model.Tasktitle.ToString();
         JumbotOA.Entity.UserEntity userEntity = new JumbotOA.Entity.UserEntity();
         userEntity = new BLL.UserBLL().GetEntity(model.Uid);
         Uidtxt.Text = userEntity.Uname.ToString();
     }
     else
         qs.Visible = false;
 }