Beispiel #1
0
 /// <summary>
 /// 提交留言
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void Button1_Click(object sender, EventArgs e)
 {
     if (CheckBox_issend.Checked)
     {
         try
         {
             guestBookModel.ID       = commonId.GetGUID();
             guestBookModel.TITLES   = TextBox_email.Text.ToString();
             guestBookModel.CLASSID  = TextBox_tel.Text.ToString();
             guestBookModel.CONTENTS = TextBox2_content.Text;
             guestBookModel.DATETIME = DateTime.Now;
             guestBookModel.STATUS   = 0;
             guestBookModel.WRITER   = TextBox1_Writer.Text.ToString();
             guestBookModel.DELFLAG  = 0;
             guestBookModel.COURSEID = TextBox_compan.Text.ToString();
             guestBookBll.Add(guestBookModel);
             Label_notice.Text       = "√提交成功,请等待管理员回复!";
             CheckBox_issend.Checked = false;
         }
         catch
         {
             Label_notice.Text = "×提交失败,请重新操作!";
         }
     }
     else
     {
         Label_notice.Text = "!请先勾选“确定提交以上内容”,谢谢!";
     }
 }
Beispiel #2
0
        /// <summary>
        /// 确定添加新用户组
        /// 1.添加新人员前要检测该用户组的名称是否已经在系统中注册,如果注册过了,则提醒用户重复,要求用户重新命名
        /// 2.添加该用户进数据库
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Button_queding_Click(object sender, EventArgs e)
        {
            try
            {
                string username = TB_USERNAME.Text.ToString();//获取到用户名

                //检查该名称是否有了
                if (username != "")
                {
                    //检查是否有该用户组名称
                    bool checkName = pageControl.Exists_Name("USER_Users", "USERNAME", username, "ID", "");

                    if (checkName)
                    {
                        tag.Text = "该用户名已经存在,请修改!";
                    }
                    else
                    {
                        //部门ID
                        string DepartMentID = "";
                        //部门名称
                        string DepartMentName = "";
                        foreach (ListItem item in CheckBox_DEPARTMENT.Items)
                        {
                            if (item.Selected == true)
                            {
                                DepartMentID   += item.Value + ",";
                                DepartMentName += item.Text + ",";
                            }
                        }
                        if (DepartMentID != null && DepartMentID != "")
                        {
                            users_Model.ID = commons.GetGUID();//获取到GUID作为ID
                            //用户名
                            users_Model.USERNAME = TB_USERNAME.Text.ToString();
                            //密码
                            users_Model.PASSWORD = commons.GetMD5(TB_PASSWORD.Text.Trim());
                            //真实姓名
                            users_Model.REALNAME = TB_REALNAME.Text;
                            //性别
                            users_Model.SEX = RadioButtonList_SEX.SelectedValue.ToString();
                            //是否为项目经理
                            users_Model.IsManager = int.Parse(RadioButtonList_IsManager.SelectedValue.ToString());
                            //部门
                            users_Model.DepartMentID = DepartMentID.Remove(DepartMentID.LastIndexOf(","));
                            //部门名称
                            users_Model.DepartMentName = DepartMentName.Remove(DepartMentName.LastIndexOf(","));
                            //岗位
                            users_Model.StationID = DDL_Station.SelectedValue.ToString();
                            //联系电话
                            users_Model.TEL = TB_TEL.Text;
                            //移动电话
                            users_Model.TEMP1 = TextBox_TEMP1.Text;
                            //邮箱
                            users_Model.EMAIL = TB_EMAIL.Text;
                            //在职状态
                            users_Model.WorkStats = DDL_WorkStats.SelectedValue.ToString();
                            //入职时间
                            if (null == TB_DatesEmployed.Value || TB_DatesEmployed.Value.ToString().Equals(""))
                            {
                                users_Model.DatesEmployed = null;
                            }
                            else
                            {
                                users_Model.DatesEmployed = Convert.ToDateTime(TB_DatesEmployed.Value.ToString());
                            }

                            //离职时间
                            if (null == TB_LeaveDates.Value || TB_LeaveDates.Value.ToString().Equals(""))
                            {
                                users_Model.LeaveDates = null;
                            }
                            else
                            {
                                //离职时间
                                users_Model.LeaveDates = Convert.ToDateTime(TB_LeaveDates.Value.ToString());
                            }
                            //生日
                            if (TB_BIRTHDAY.Value == null || TB_BIRTHDAY.Value.ToString().Equals(""))
                            {
                                users_Model.BIRTHDAY = "";
                            }
                            else
                            {
                                users_Model.BIRTHDAY = TB_BIRTHDAY.Value.ToString();
                            }

                            //籍贯
                            users_Model.NativePlace = TB_NativePlace.Text;
                            //学历
                            users_Model.EducationLevel = DDL_EducationLevel.SelectedValue.ToString();
                            //住址
                            users_Model.ADDRESS = TB_ADDRESS.Text.ToString();
                            //毕业学校
                            users_Model.GraduateSchool = TB_GraduateSchool.Text;
                            //专业
                            users_Model.Major = TB_Major.Text;
                            //工作履历
                            users_Model.TrackRecord = TB_TrackRecord.Text;
                            //时间
                            users_Model.DATETIME = Convert.ToDateTime(DateTime.Now.ToShortDateString().ToString());
                            //工作组
                            string    sql_groups = "SELECT ID FROM USER_Groups WHERE (ISMOREN = '1') AND (TAGS = '普通组')";
                            DataTable dt         = pageControl.doSql(sql_groups).Tables[0];

                            users_Model.GROUPS = dt.Rows[0]["ID"].ToString();

                            //头像
                            users_Model.IMAGES = "";
                            //删除标记
                            users_Model.DELFLAG = 0;

                            users_Bll.Add(users_Model);
                            new ajax().UpdateUserRemoteInfoWithJAVAWebService(users_Model, EnumRemoteOperation.Import);
                            //人员信息添加成功以后,要向Document_Folder中添加一个当前用户的顶级档案目录

                            int docfolderid = docfolder_bll.GetMaxId();

                            docfolder_model.ID = docfolderid;
                            //目录名称
                            docfolder_model.FolderName = users_Model.USERNAME + "_" + users_Model.REALNAME;
                            //上级目录
                            docfolder_model.UpID = -1;
                            //文件夹的属性
                            docfolder_model.Types = "private";
                            //所属人ID
                            docfolder_model.UserID = users_Model.ID;
                            //是否共享
                            docfolder_model.IsShare = 0;
                            //删除标记
                            docfolder_model.DELFLAG = 0;
                            //当前时间
                            docfolder_model.DATETIME = Convert.ToDateTime(DateTime.Now.ToShortDateString());
                            //栏目的路径记录(用/来隔开)
                            docfolder_model.COLUMNSPATH = "-1/" + docfolder_model.ID;
                            //栏目显示的顺序
                            docfolder_model.SHUNXU = 0;
                            //栏目的路径名称
                            docfolder_model.PNAMES = "我的文档";
                            //当前文件夹中文件的大小
                            docfolder_model.SizeOf = "0";

                            docfolder_bll.Add(docfolder_model);


                            //人员信息添加成功以后,要向Document_Folder中默认添加一个收藏夹

                            docfolder_model.ID = docfolder_bll.GetMaxId();
                            //目录名称
                            docfolder_model.FolderName = "收藏夹";
                            //上级目录
                            docfolder_model.UpID = docfolderid;
                            //文件夹的属性
                            docfolder_model.Types = "private";
                            //所属人ID
                            docfolder_model.UserID = users_Model.ID;
                            //是否共享
                            docfolder_model.IsShare = 0;
                            //删除标记
                            docfolder_model.DELFLAG = 0;
                            //当前时间
                            docfolder_model.DATETIME = Convert.ToDateTime(DateTime.Now.ToShortDateString());
                            //栏目的路径记录(用/来隔开)
                            docfolder_model.COLUMNSPATH = "-1/" + docfolder_model.UpID + "/" + docfolder_model.ID;
                            //栏目显示的顺序
                            docfolder_model.SHUNXU = 0;
                            //栏目的路径名称
                            docfolder_model.PNAMES = "我的档案>收藏夹";
                            //当前文件夹中文件的大小
                            docfolder_model.SizeOf = "0";

                            docfolder_bll.Add(docfolder_model);


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

                            string coutws = "<script language=\"javascript\" type=\"text/javascript\">alert(\"操作成功!现在进入列表页面\"); location.href = \"manage.aspx" + "\";</script>";


                            Response.Write(coutws);

                            //添加操作日志

                            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 + ")" + "成功");
                            //添加操作日志
                        }
                        else
                        {
                            this.Page.ClientScript.RegisterClientScriptBlock(GetType(), "key", "alert('请选择部门!')", true);
                        }
                    }
                }
            }
            catch
            {
                tag.Text = "操作失败,请重试!";
            }
        }
Beispiel #3
0
        /// <summary>
        /// 确定添加新用户组
        /// 1.添加新用户组前要检测该用户组的名称是否已经在系统中注册,如果注册过了,则提醒用户重复,要求用户重新命名
        /// 2.添加该用户进数据库
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Button_queding_Click(object sender, EventArgs e)
        {
            try
            {
                string NAME_1     = NAME.Text.ToString();    //获取到用户组的名字
                string CONTENTS_1 = CONTENT.Text.ToString(); //获取到用户组的说明

                //检查该名称是否有了
                if (NAME_1 != "")
                {
                    bool checkName = user_groupsext.Exists_Name(NAME_1, "");//检查是否有该用户组名称
                    if (checkName)
                    {
                        tag.Text = "该" + Request["tags"] + "名称与已有的部门或岗位名称相同,请修改!";
                    }
                    else
                    {
                        userGroupModel.ID       = commonID.GetGUID();//获取到GUID作为ID
                        userGroupModel.CONTENTS = CONTENTS_1;
                        userGroupModel.DELFLAG  = 0;
                        userGroupModel.ISMOREN  = 0;
                        userGroupModel.NAME     = NAME_1;
                        //userGroupModel.ROLE = selectRoles;
                        if (Request["tags"].ToString().Equals("部门"))
                        {
                            userGroupModel.TAGS = "部门";
                            userGroups.Add(userGroupModel);

                            //部门添加成功以后往信息栏目表中添加一条记录
                            Dianda.BLL.News_ColumnsExt columnext_bll = new Dianda.BLL.News_ColumnsExt();
                            columnext_bll.addCloumns(userGroupModel.NAME, "DEPARTMENT", userGroupModel.ID, 3);

                            ////ID
                            //newcolumns_model.ID = newcolumns_bll.GetMaxId();
                            ////名称=部门的名称
                            //newcolumns_model.NAME = userGroupModel.NAME;
                            ////PARENTID
                            //newcolumns_model.PARENTID = -1;
                            ////栏目的归属
                            //newcolumns_model.ForItems = "DEPARTMENT";
                            ////如果栏目是部门的栏目,则这边保存部门的ID
                            //newcolumns_model.ItemsID = userGroupModel.ID;
                            ////时间
                            //newcolumns_model.DATETIME = Convert.ToDateTime(DateTime.Now.ToShortDateString().ToString());
                            ////是否显示发布人的信息
                            //newcolumns_model.ISMENU = 0;
                            ////是否需要审核
                            //newcolumns_model.ISSHENHE = 0;
                            ////单条新闻
                            //newcolumns_model.ONLYONE = 0;
                            ////新闻删除标记
                            //newcolumns_model.DELFLAG = 0;
                            ////栏目的路径记录
                            //newcolumns_model.COLUMNSPATH = "0/" + newcolumns_model.ID;
                            ////栏目显示的顺序
                            //newcolumns_model.SHUNXU = 0;
                            ////栏目的图片
                            //newcolumns_model.IMAGEURL = "";
                            ////栏目的路径名称
                            //newcolumns_model.PNAMES = userGroupModel.NAME;

                            //newcolumns_bll.Add(newcolumns_model);
                        }
                        else
                        {
                            userGroupModel.TAGS = "岗位";
                            userGroups.Add(userGroupModel);
                        }

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

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


                        Response.Write(coutws);

                        //添加操作日志

                        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 + ")", "添加新" + Request["tags"].ToString(), "添加" + newcolumns_model.NAME + "成功");
                        //添加操作日志
                    }
                }
            }
            catch
            {
                tag.Text = "操作失败,请重试!";
            }
        }
        /// <summary>
        /// 确定添加新建项目负责人
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Button1_Click(object sender, EventArgs e)
        {
            try
            {
                string username = TextBox_UserName.Text.ToString();//获取到用户名

                //检查该名称是否有了
                if (username != "")
                {
                    //检查是否有该用户组名称
                    bool checkName = pageControl.Exists_Name("USER_Users", "USERNAME", username, "ID", "");

                    if (checkName)
                    {
                        tag.Text = "该用户名已经存在,请修改!";
                    }
                    else
                    {
                        users_Model.ID          = commons.GetGUID();//获取到GUID作为ID
                        Session["new_leaderid"] = users_Model.ID;
                        //用户名
                        users_Model.USERNAME = TextBox_UserName.Text.ToString();
                        //密码
                        users_Model.PASSWORD = commons.GetMD5(TextBox_Pwd.Text.Trim());
                        //真实姓名
                        users_Model.REALNAME = TextBox_Rlname.Text;
                        //性别
                        users_Model.SEX = RadioButtonList_Sex.SelectedValue.ToString();
                        //是否为项目经理
                        users_Model.IsManager = 9;
                        //部门
                        users_Model.DepartMentID = ConfigurationManager.AppSettings["departmentid_temp"];
                        //部门名称
                        string    sql_groups = "SELECT ID,name FROM USER_Groups WHERE id='" + ConfigurationManager.AppSettings["departmentid_temp"] + "'";
                        DataTable dt         = pageControl.doSql(sql_groups).Tables[0];
                        users_Model.DepartMentName = dt.Rows[0]["name"].ToString();
                        //岗位
                        users_Model.StationID = ConfigurationManager.AppSettings["positionid_temp"];
                        //联系电话
                        users_Model.TEL = "";
                        //移动电话
                        users_Model.TEMP1 = "";
                        //邮箱
                        users_Model.EMAIL = "*****@*****.**";
                        //在职状态
                        users_Model.WorkStats = "1";
                        //籍贯
                        users_Model.NativePlace = "上海";
                        //学历
                        users_Model.EducationLevel = "4";
                        //时间
                        users_Model.DATETIME = Convert.ToDateTime(DateTime.Now.ToShortDateString().ToString());
                        //工作组
                        users_Model.GROUPS = ConfigurationManager.AppSettings["manageid_temp"];
                        //删除标记
                        users_Model.DELFLAG = 0;
                        users_Bll.Add(users_Model);
                        tag.Text = "操作成功!";

                        //添加操作日志
                        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 + ")" + "成功");

                        Label la = (Label)this.Parent.Parent.FindControl("Label_NewLeader");
                        la.Text = "--[" + TextBox_Rlname.Text + "(" + TextBox_UserName.Text + ")]";
                    }
                }
            }
            catch
            {
                tag.Text = "操作失败,请重试!";
            }
        }