Esempio n. 1
0
 /// <summary>
 /// 根据用户的ID,显示用户的基本信息
 /// </summary>
 /// <param name="userid"></param>
 private void showUserinfo(string userid)
 {
     try
     {
         users_model = users_bll.GetModel(userid);
         if (users_model != null)
         {
             HiddenField_userid.Value = userid;
             Label_userinfo.Text      = users_model.REALNAME.ToString() + "(" + users_model.USERNAME.ToString() + ")";
             showGroups(users_model.GROUPS.ToString());
         }
     }
     catch
     {
     }
 }
Esempio n. 2
0
        /// <summary>
        /// 返回指定ID用户的在开始时间和结束时间范围内的项目任务
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="startDay"></param>
        /// <param name="endData"></param>
        /// <returns></returns>
        private string getProject_Plan(string userId, DateTime startDay)
        {
            string couw = "";

            try
            {
                userModel = usersBll.GetModel(userId);
                if (userModel != null)
                {
                    string    sql = "select  * from vProject_Task where Pro_DELFLAG='0' and Pro_Status=1 and  '" + startDay.ToString("yyyy-MM-dd") + "'  BETWEEN CAST(CONVERT(varchar(10), StartTime, 120) + ' 00:00:00' AS datetime) AND CAST(CONVERT(varchar(10), endTime, 120) + ' 23:59:59' AS datetime)  and delflag = '0' and Status <> 2 and userInfo Like '%" + userModel.REALNAME.ToString() + "(" + userModel.USERNAME.ToString() + ")" + "%' order by StartTime asc";
                    DataTable dt  = dosql.doSql(sql).Tables[0];
                    if (dt != null && dt.Rows.Count > 0)
                    {
                        couw = "<task>";
                        for (int i = 0; i < dt.Rows.Count; i++)
                        {
                            couw = couw + "<info startTime=\"" + DateTime.Parse(dt.Rows[i]["StartTime"].ToString()).ToString("yyyy-MM-dd HH:mm:ss") + "\" endTime=\"" + DateTime.Parse(dt.Rows[i]["endTime"].ToString()).ToString("yyyy-MM-dd HH:mm:ss") + "\" url=\"/Admin/personalProjectManage/OAtask/manage.aspx?ID=" + dt.Rows[i]["ProjectID"].ToString() + "\" status=\"" + dt.Rows[i]["Status"].ToString() + "\">" + dt.Rows[i]["NAMES"].ToString() + "</info>";
                        }
                        couw = couw + "</task>";
                    }
                }
            }
            catch
            {
            }
            return(couw);
        }
Esempio n. 3
0
        /// <summary>
        /// 点击删除按钮触发的事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Button_delete_onclick(object sender, EventArgs e)
        {
            int num  = 0;
            int rows = GridView1.Rows.Count;

            if (rows > 0)
            {
                for (int i = 0; i < rows; i++)
                {
                    CheckBox cb = (CheckBox)GridView1.Rows[i].Cells[0].FindControl("CheckBox_choose");
                    if (cb.Checked)
                    {
                        num = num + 1;
                    }
                }

                if (num == 0)
                {
                    tag.Text = "删除时最少选择一条数据!";
                }
                else
                {
                    tag.Text = "";
                    for (int j = 0; j < rows; j++)
                    {
                        CheckBox    cb1 = (CheckBox)GridView1.Rows[j].Cells[0].FindControl("CheckBox_choose");
                        HiddenField hid = (HiddenField)GridView1.Rows[j].Cells[0].FindControl("Hid_ID");

                        if (cb1.Checked)
                        {
                            //获取到当前人员的基本信息
                            users_model = users_bll.GetModel(hid.Value.ToString());
                            //将删除标记设为1
                            users_model.DELFLAG = 1;

                            users_bll.Update(users_model);

                            //TODO:  new ajax().UpdateUserRemoteInfoWithJAVAWebService(users_model, EnumRemoteOperation.Edit);

                            //添加操作日志

                            Dianda.BLL.SYS_LogsExt bsyslog    = new Dianda.BLL.SYS_LogsExt();
                            Model.USER_Users       user_model = (Model.USER_Users)Session["USER_Users"];

                            bsyslog.addlogs(user_model.REALNAME + "(" + user_model.USERNAME + ")", "删除人员信息", "删除" + users_model.REALNAME + "(" + user_model.USERNAME + ")" + "成功");

                            //添加操作日志
                        }
                    }

                    //tag.Text = "操作成功!";

                    // string coutws = "<script language=\"javascript\" type=\"text/javascript\">alert(\"操作成功!现在进入列表页面\"); location.href = \"manage.aspx?pageindex=" + Request["pageindex"] + "&depart=" + DDL_Depart.SelectedValue.ToString() + "&workstatus=" + DDL_Status.SelectedValue.ToString() + "\";</script>";
                    // Response.Write(coutws);

                    ScriptManager.RegisterStartupScript(this, this.GetType(), "ok", "<script>alert('操作成功!现在进入我的列表页面');javascript:location='manage.aspx?pageindex=" + Request["pageindex"] + "&depart=" + DDL_Depart.SelectedValue.ToString() + "&workstatus=" + DDL_Status.SelectedValue.ToString() + "';</script>", false);
                }
            }
        }
Esempio n. 4
0
        protected void ShowUsersInfo(string id)
        {
            try
            {
                //获取到人员的详细信息
                users_Model = users_Bll.GetModel(id);

                //姓名
                TB_Name.Text = check(users_Model.REALNAME);
                //联系电话
                TB_TEL.Text = check(users_Model.TEL);
                //移动电话
                TextBox_TEMP1.Text = check(users_Model.TEMP1);
                //邮箱
                TB_EMAIL.Text = check(users_Model.EMAIL);
                //入职时间
                TB_DatesEmployed.Value = check2(users_Model.DatesEmployed);
                //离职时间
                TB_LeaveDates.Value = check2(users_Model.LeaveDates);
                //生日
                TB_BIRTHDAY.Value = check2(users_Model.BIRTHDAY);
                //籍贯
                TB_NativePlace.Text = check(users_Model.NativePlace);
                //住址
                TB_ADDRESS.Text = check(users_Model.ADDRESS);
                //毕业学校
                TB_GraduateSchool.Text = check(users_Model.GraduateSchool);
                //专业
                TB_Major.Text = check(users_Model.Major);
                //工作履历
                TB_TrackRecord.Text = check(users_Model.TrackRecord);

                //初始化下拉列表

                //部门下拉列表
                DataTable dt1  = new DataTable();
                string    sql1 = " SELECT ID,NAME FROM USER_Groups WHERE (TAGS = '部门') AND (DELFLAG = 0)  GROUP BY ID,NAME ";
                dt1 = pageControl.doSql(sql1).Tables[0];
                CheckBox_DEPARTMENT.DataSource     = dt1;
                CheckBox_DEPARTMENT.DataTextField  = "NAME";
                CheckBox_DEPARTMENT.DataValueField = "ID";
                CheckBox_DEPARTMENT.DataBind();
                //获取部门信息
                string[] Depart = users_Model.DepartMentID.Split(',');
                //将部门信息导出部门选项中
                foreach (ListItem item in CheckBox_DEPARTMENT.Items)
                {
                    for (int i = 0; i < Depart.Length; i++)
                    {
                        if (Depart[i] == item.Value)
                        {
                            item.Selected = true;
                        }
                    }
                }
                //for (int i = 0; i < dt1.Rows.Count; i++)
                //{
                //    string DepartName = dt1.Rows[i]["NAME"].ToString();
                //    string ID = dt1.Rows[i]["ID"].ToString();

                //    ListItem li = new ListItem(DepartName, ID);
                //    DDL_DEPARTMENT.Items.Add(li);

                //    if (ID.Equals(users_Model.DepartMentID))
                //    {
                //        li.Selected = true;
                //    }
                //}

                //岗位下拉列表
                DataTable dt2  = new DataTable();
                string    sql2 = " SELECT ID,NAME FROM USER_Groups WHERE (TAGS = '岗位') AND (DELFLAG = 0)  GROUP BY ID,NAME ";
                dt2 = pageControl.doSql(sql2).Tables[0];

                for (int k = 0; k < dt2.Rows.Count; k++)
                {
                    string Station = dt2.Rows[k]["NAME"].ToString();
                    string ID      = dt2.Rows[k]["ID"].ToString();

                    ListItem li = new ListItem(Station, ID);
                    DDL_Station.Items.Add(li);

                    if (ID.Equals(users_Model.StationID))
                    {
                        li.Selected = true;
                    }
                }

                //状态
                DataTable dt3  = new DataTable();
                string    sql3 = " SELECT ID, WorkStataName FROM USER_WorkStats_Base WHERE (DELFLAG = '0') ";
                dt3 = pageControl.doSql(sql3).Tables[0];

                for (int j = 0; j < dt3.Rows.Count; j++)
                {
                    string   WorkStats = dt3.Rows[j]["WorkStataName"].ToString();
                    string   ID        = dt3.Rows[j]["ID"].ToString();
                    ListItem li        = new ListItem(WorkStats, ID);
                    DDL_WorkStats.Items.Add(li);

                    if (ID.Equals(users_Model.WorkStats))
                    {
                        li.Selected = true;
                    }
                }

                //性别
                for (int i = 0; i < RadioButtonList_SEX.Items.Count; i++)
                {
                    if (RadioButtonList_SEX.Items[i].Value.Equals(users_Model.SEX))
                    {
                        RadioButtonList_SEX.Items[i].Selected = true;
                    }
                }

                //是否为项目经理
                RadioButtonList_IsManager.SelectedValue = users_Model.IsManager.ToString();

                //学历
                DataTable dt4  = new DataTable();
                string    sql4 = " SELECT ID, EducationLevel FROM USER_EducationLevel_Base ";
                dt4 = pageControl.doSql(sql4).Tables[0];

                for (int t = 0; t < dt4.Rows.Count; t++)
                {
                    string   EducationLevel = dt4.Rows[t]["EducationLevel"].ToString();
                    string   ID             = dt4.Rows[t]["ID"].ToString();
                    ListItem li             = new ListItem(EducationLevel, ID);
                    DDL_EducationLevel.Items.Add(li);

                    if (ID.Equals(users_Model.EducationLevel))
                    {
                        li.Selected = true;
                    }
                }
            }
            catch
            {
                Response.Write("<script>alert('出错!')</script>");
            }
        }