Exemple #1
0
        public void SaveChangeUserPass(string id)
        {
            CQGJUserViewData viewData = new CQGJUserViewData();
            if (Request.Form["NewuserPassword"] == null || Request.Form["ReNewuserPassword"] == null || Request.Form["userPassword"] == null
                || Request.Form["NewuserPassword"].ToString() == "" || Request.Form["ReNewuserPassword"].ToString() == "" || Request.Form["userPassword"].ToString() == "")
            {
                viewData.ActionSuccess = true;
                viewData.HtmlPage = "密码不能为空!";
                viewData.JavaScriptPage = "/admin/ChangeUserPass/" + id;
                RenderView("MessagePage", viewData);
            }

            if (id != null && !id.Equals(""))
            {
                int iID = 0;
                try
                {
                    iID = int.Parse(id);
                }
                catch
                {
                    //错误页面
                }
                string strPass = Request.Form["NewuserPassword"].ToString();
                string strPass2 = Request.Form["ReNewuserPassword"].ToString();
                string Password = Request.Form["userPassword"].ToString();

                if (strPass == strPass2)
                {
                    Password = Security.MD5Encrypt(Password);
                    viewData.Users = (from u in CQGJ.User
                                      where u.UserID == iID && u.Password == Password
                                      select u).ToList();

                    if (viewData.Users.Count > 0)
                    {
                        User user = viewData.Users[0];
                        user.Password = Security.MD5Encrypt(strPass2);
                        CQGJ.SaveChanges(true);

                        viewData.ActionSuccess = true;
                        viewData.HtmlPage = "密码修改成功!";
                        viewData.JavaScriptPage = "/admin/UserInfo/" + id;
                        RenderView("MessagePage", viewData);

                    }
                    else
                    {
                        viewData.ActionSuccess = true;
                        viewData.HtmlPage = "原密码错误!";
                        viewData.JavaScriptPage = "/admin/ChangeUserPass/" + id;
                        RenderView("MessagePage", viewData);
                    }
                }
                else
                {
                    viewData.ActionSuccess = true;
                    viewData.HtmlPage = "两次输入密码不一样!";
                    viewData.JavaScriptPage = "/admin/ChangeUserPass/" + id;
                    RenderView("MessagePage", viewData);
                }
            }
        }
Exemple #2
0
        public void OrgUserAddList(string id)
        {
            CQGJUserViewData viewData = new CQGJUserViewData();
            Bussiness.Global global = new CQGJ.Passport.Bussiness.Global();
            List<User> userlist = new List<User>();
            viewData.UsersInOrgs = new List<UsersInOrgs>();
            if (id != null && !id.Equals(""))
            {
                global.GetNotInOrgUser(ref userlist, id);

                viewData.Users = userlist;

                viewData.Org = (from b in CQGJ.b01
                                where b.b0111 == id
                                select b).First();
                viewData.HtmlPage2 = id;
                if (Response.Cookies["OrgID"] == null)
                {
                    Response.Cookies.Add(new HttpCookie("OrgID"));
                }

                Response.Cookies["OrgID"].Value = id;
                viewData.HtmlPage = "<a href='/admin/orginfo/" + id + "'>" + viewData.Org.b0104 + "</a>";
                RenderView("UserNoutInOrg", viewData);
            }
            else
            {
                // 错误页面
            }
        }
Exemple #3
0
        public void OrgUserEdit(string UserID, string ID)
        {
            int iID = 0;
            try
            {
                iID = int.Parse(UserID);
            }
            catch
            {
                //错误页面
            }
            var Querry = from u in CQGJ.User where u.UserID == iID select u;
            CQGJUserViewData viewData = new CQGJUserViewData();
            viewData.Users = Querry.ToList();

            if (viewData.Users.Count > 0)
            {
                viewData.User = viewData.Users[0];
                try
                {
                    try
                    {
                        viewData.UsersInOrg = (from uo in CQGJ.UsersInOrgs where (uo.b0111 == ID && uo.User.UserID == iID) select uo).First();
                        viewData.Org = (from o in CQGJ.b01 where (o.b0111 == ID) select o).First();
                    }
                    catch
                    {
                        //错误页面
                    }
                }
                catch
                {
                    viewData.HtmlPage = "无";
                    viewData.HtmlPage2 = "无";
                }

            }
            else
            {
                RedirectToAction("index");
            }

            RenderView("OrgUserEdit", viewData);
        }
Exemple #4
0
        public void OrgEdit(string id)
        {
            var Querry = from Org in CQGJ.b01 where Org.b0111 == id select Org;
            CQGJUserViewData viewData = new CQGJUserViewData();
            viewData.Orgs = Querry.ToList();
            if (viewData.Orgs.Count > 0)
            {
                viewData.Org = viewData.Orgs[0];

            }
            else
            {
                //错误
            }
            RenderView("OrgEdit", viewData);
        }
Exemple #5
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="OrgID">部门的标示</param>
        public void OrgList(string id)
        {
            CQGJUserViewData viewData = new CQGJUserViewData();
            Bussiness.Global global = new CQGJ.Passport.Bussiness.Global();
            if (id != null && !id.Equals(""))
            {
                viewData.Orgs = (from b in CQGJ.b01
                                 where (b.b0111.Length > 14 && b.b0111.Substring(0, 14) == id) || b.b0111_3 == id  //单位列表
                                 select b).ToList();
                List<b01> UpOrgList = new List<b01>();
                global.GetUpOrg(ref UpOrgList, id);
                b01 bTemp = (from o in CQGJ.b01 where o.b0111 == id select o).First();

                if (UpOrgList.Count > 0)
                {
                    for (int i = UpOrgList.Count; i > 0; --i)
                    {
                        viewData.HtmlPage += " >> <a href='/admin/orglist/" + UpOrgList[i - 1].b0111 + "'>" + UpOrgList[i - 1].b0104 + "</a>";
                    }
                }
                else
                {
                    viewData.HtmlPage = "";
                }
                viewData.HtmlPage += " >> " + bTemp.b0104;

            }
            else
            {
                viewData.Orgs = (from b in CQGJ.b01
                                 where b.b0111.Length == 14 && (b.b0111_3.Equals("") || b.b0111_3 == null)
                                 select b).ToList();
                viewData.HtmlPage = "";
            }

            for (int j = 0; j < viewData.Orgs.Count; ++j)
            {
                string OrgCode = viewData.Orgs[j].b0111;
                string UsersInOrgNub = "0";
                try
                {
                    UsersInOrgNub = (from uo in CQGJ.UsersInOrgs where uo.b0111 == OrgCode select uo).Count().ToString();
                }
                catch
                {

                }
                string TempHtml = "<a href='/admin/OrgUserList/" + OrgCode + "'>" + UsersInOrgNub + "</a>";
                viewData.AdditionalInfo.Add(TempHtml);

            }

            RenderView("OrgList", viewData);
        }
Exemple #6
0
        public void EduDel(string UserID, string ID)
        {
            int iID = 0;
            int iUserID = 0;
            try
            {
                iID = int.Parse(ID);
                iUserID = int.Parse(UserID);
            }
            catch
            {
                //错误页面
            }
            CQGJUserViewData viewData = new CQGJUserViewData();

            EduLevel edu = (from e in CQGJ.EduLevel where e.ELId == iID select e).First();
            viewData.User = (from u in CQGJ.User where u.UserID == iUserID select u).First();

            //if (viewData.Users.Count > 0)
            {
                //viewData.User = viewData.Users[0];

                if (edu.Sign == 1)
                {
                    CQGJ.DeleteObject(edu);
                    CQGJ.SaveChanges(true);
                    EduLevel EduFirst = (from e in CQGJ.EduLevel where e.User.UserID == iUserID select e).First();
                    EduFirst.Sign = 1;

                }
                else
                {
                    CQGJ.DeleteObject(edu);
                }

                var Querry = from e in CQGJ.EduLevel where e.User.UserID == iID select e;
                viewData.EduLevels = Querry.ToList();
                viewData.ActionSuccess = true;
                viewData.JavaScriptPage = " 删除";
                CQGJ.SaveChanges(true);
                RenderView("EduList", viewData);
            }
        }
Exemple #7
0
        public void EduList(string id)
        {
            int iID = 0;
            try
            {
                iID = int.Parse(id);
            }
            catch
            {
                //错误页面
            }
            CQGJUserViewData viewData = new CQGJUserViewData();
            var Querry = from e in CQGJ.EduLevel where e.User.UserID == iID select e;
            viewData.EduLevels = Querry.ToList();

            viewData.Users = (from u in CQGJ.User
                              where u.UserID == iID
                              select u).ToList();

            if (viewData.Users.Count > 0)
            {
                viewData.User = viewData.Users[0];
                RenderView("EduList", viewData);
            }
        }
Exemple #8
0
 /// <summary>
 /// 删除用户
 /// </summary>
 /// <param name="id">用户标示</param>
 public void userDel(string id)
 {
     CQGJUserViewData viewData = new CQGJUserViewData();
     int iID = 0;
     try
     {
         iID = int.Parse(id);
     }
     catch
     {
         //错误页面
     }
     User user = (from u in CQGJ.User
                  where u.UserID == iID
                  select u).First();
     viewData.DelSuccess = true;
     viewData.JavaScriptPage = "删除人员:" + user.Username;
     CQGJ.DeleteObject(user);
     CQGJ.SaveChanges(true);
     viewData.Users = (from u in CQGJ.User
                       select u).ToList();
     RenderView("UserList", viewData);
 }
Exemple #9
0
        /// <summary>
        /// 编辑用户信息
        /// </summary>
        /// <param name="id"></param>
        public void UserEdit(string id)
        {
            int iID = 0;
            try
            {
                iID = int.Parse(id);
            }
            catch
            {
                //错误页面
            }
            var Querry = from u in CQGJ.User where u.UserID == iID select u;
            CQGJUserViewData viewData = new CQGJUserViewData();
            viewData.Users = Querry.ToList();
            if (viewData.Users.Count > 0)
            {
                viewData.User = viewData.Users[0];

            }
            else
            {
                RedirectToAction("index");
            }

            try
            {
                HttpContext.Session["Photo"] = viewData.User.Photo;
                HttpContext.Session["PhotoType"] = viewData.User.PhotoType;
            }
            catch
            {
            }
            try
            {
                viewData.EduLevel = (from e in CQGJ.EduLevel
                                     where (e.User.UserID == iID && e.Sign == 1)
                                     select e).First();

                viewData.SchoolRecord = (from s in CQGJ.SchoolRecord
                                         where (s.User.UserID == iID && s.Sign == 1)
                                         select s).First();

                viewData.HtmlPage = viewData.EduLevel.ELName;

                viewData.HtmlPage2 = viewData.SchoolRecord.SRName;

            }
            catch
            {
                viewData.HtmlPage = "无";
                viewData.HtmlPage2 = "无";
            }

            RenderView("UserEdit", viewData);
        }
Exemple #10
0
        public void SetUserPass(string id)
        {
            CQGJUserViewData viewData = new CQGJUserViewData();
            if (id != null && !id.Equals(""))
            {
                int iID = 0;
                try
                {
                    iID = int.Parse(id);
                }
                catch
                {
                    //错误页面
                }
                viewData.Users = (from u in CQGJ.User
                                  where u.UserID == iID
                                  select u).ToList();

                if (viewData.Users.Count > 0)
                {
                    User user = viewData.Users[0];
                    user.Password = Security.MD5Encrypt("123456");
                    CQGJ.SaveChanges(true);

                    viewData.ActionSuccess = true;
                    viewData.HtmlPage = "密码重置成功(测试)(123456)!";
                    viewData.JavaScriptPage = "/admin/UserInfo/" + id;
                    RenderView("MessagePage", viewData);

                }

            }
        }
Exemple #11
0
        /// <summary>
        /// 根据单位代码显示用户列表(包括下级单位)
        /// </summary>
        /// <param name="id"></param>
        public void TreeUserList(string id)
        {
            CQGJUserViewData viewData = new CQGJUserViewData();
            Bussiness.Global global = new CQGJ.Passport.Bussiness.Global();
            List<User> userlist = new List<User>();
            viewData.UsersInOrgs = new List<UsersInOrgs>();

            global.GetOrgUser(ref userlist, id);

            foreach (User u in userlist)
            {
                UsersInOrgs uio = (from uo in CQGJ.UsersInOrgs where uo.b0111 == id && uo.User.UserID == u.UserID select uo).First();
                viewData.UsersInOrgs.Add(uio);
            }
            viewData.Users = userlist;

            viewData.Org = (from b in CQGJ.b01
                            where b.b0111 == id
                            select b).First();
            viewData.HtmlPage2 = id;
            if (Response.Cookies["OrgID"] == null)
            {
                Response.Cookies.Add(new HttpCookie("OrgID"));
            }

            Response.Cookies["OrgID"].Value = id;
            viewData.HtmlPage = "<a href='/admin/orginfo/" + id + "'>" + viewData.Org.b0104 + "</a>";
            RenderView("TreeUserList", viewData);
        }
Exemple #12
0
        /// <summary>
        /// 保存用户信息
        /// </summary>
        public void SaveUser()
        {
            if (Request.Form["UserID"] != null)
            {

                string strUserID = Request.Form["UserID"].ToString();
                int iID = 0;
                try
                {
                    iID = int.Parse(strUserID);
                }
                catch
                {
                    //错误页面
                }
                CQGJUserViewData viewData = new CQGJUserViewData();
                viewData.Users = (from u in CQGJ.User
                                  where u.UserID == iID
                                  select u).ToList();

                if (viewData.Users.Count > 0)
                {
                    User user = viewData.Users[0];
                    user.Username = Request.Form["UserName"].ToString();
                    user.Remark = Request.Form["AdminRemark"].ToString();
                    try
                    {
                        user.Status = int.Parse(Request.Form["AdminStatus"].ToString());
                    }
                    catch { }
                    user.Birthday = DateTime.Parse(Request.Form["Birthday"].ToString());
                    user.Cellphone = Request.Form["Cellphone"].ToString();
                    //user. = Request.Form["COUPost"].ToString();
                    //user.Degree = Request.Form["Degree"].ToString();
                    //user.Description = Request.Form["Description"].ToString();
                    //user.Edu = Request.Form["Edu"].ToString();
                    //user.Email = Request.Form["Email"].ToString();
                    user.Gender = Request.Form["Gender"].ToString();
                    user.IDCard = Request.Form["IDCard"].ToString();
                    try
                    {
                        user.JoinWorkDate = DateTime.Parse(Request.Form["JoinWorkDate"].ToString());
                    }
                    catch { }
                    user.Nation = Request.Form["Nation"].ToString();
                    //user.OtherLink = Request.Form["OtherLink"].ToString();
                    //user.Password = Request.Form["OtherLink"].ToString();
                    user.Politics = Request.Form["Politics"].ToString();
                    user.Position = Request.Form["Position"].ToString();

                    user.WorkTel = Request.Form["WorkTel"].ToString();
                    user.RelationsCode = Request.Form["OrgCode"].ToString();
                    user.RelationsName = Request.Form["OrgName"].ToString();
                    try
                    {
                        user.Photo = (byte[])HttpContext.Session["Photo"];
                        user.PhotoType = HttpContext.Session["PhotoType"].ToString();
                    }
                    catch
                    {
                    }
                    try
                    {
                        user.Class = Request.Form["Level"].ToString();
                    }
                    catch { }

                    CQGJ.SaveChanges(true);

                    viewData.ActionSuccess = true;
                    viewData.User = user;
                    RenderView("UserEdit", viewData);

                }
                else
                {
                    RedirectToAction("index");
                }

            }
        }
Exemple #13
0
        public void CreateEdu(string id)
        {
            int iID = 0;
            try
            {
                iID = int.Parse(id);
            }
            catch
            {
                //错误页面
            }
            CQGJUserViewData viewData = new CQGJUserViewData();

            viewData.Users = (from u in CQGJ.User
                              where u.UserID == iID
                              select u).ToList();

            if (viewData.Users.Count > 0)
            {
                viewData.User = viewData.Users[0];

                EduLevel edu = new EduLevel();
                edu.User = viewData.User;
                try
                {
                    string sign = Request.Form["Sign"].ToString();
                    edu.Sign = 1;
                    List<EduLevel> listEdu = (from e in CQGJ.EduLevel where e.User.UserID == iID select e).ToList();
                    foreach (EduLevel e in listEdu)
                    {
                        e.Sign = 0;
                    }
                }
                catch
                {
                    edu.Sign = 0;
                }
                edu.GiveUnit = Request.Form["GiveUnit"].ToString();
                edu.GiveDate = DateTime.Parse(Request.Form["GiveDate"].ToString());
                edu.GiveArea = Request.Form["GiveArea"].ToString();
                edu.ELCode = Request.Form["ELCode"].ToString();
                edu.ELName = Request.Form["ELName"].ToString();
                CQGJ.AddToEduLevel(edu);
                CQGJ.SaveChanges(true);
                var Querry = from e in CQGJ.EduLevel where e.User.UserID == iID select e;
                viewData.EduLevels = Querry.ToList();
                viewData.AddAction = false;
                viewData.ActionSuccess = true;
                viewData.JavaScriptPage = " 添加";
                RenderView("EduList", viewData);
            }
        }
Exemple #14
0
        public void SaveOrg(string id)
        {
            var Querry = from Org in CQGJ.b01 where Org.b0111 == id select Org;
            CQGJUserViewData viewData = new CQGJUserViewData();
            viewData.Orgs = Querry.ToList();
            if (viewData.Orgs.Count > 0)
            {
                b01 Org = viewData.Orgs[0];
                string strCode = Org.b0111;
                Org.b0101 = GetString("b0101");
                Org.b0104 = GetString("b0104");
                Org.b0107 = GetString("b0107");
                //Org.b0111 = GetString("b0111");
                Org.b0111_1 = GetString("b0111_1");
                Org.b0111_3 = GetString("b0111_3");
                Org.b0114 = GetString("b0114");
                Org.b0117 = GetString("b0117");
                Org.b01224 = GetString("b01224");
                Org.b0127 = GetString("b0127");
                Org.b0131 = GetString("b0131");
                Org.b0134 = GetString("b0134");
                Org.b0137 = GetString("b0137");
                Org.b0144_1 = GetString("b0144_1");
                Org.b0144_2 = GetString("b0144_2");
                Org.b0151_1 = GetString("b0151_1");
                Org.b0151_2 = GetString("b0151_2");
                Org.b0154_1 = GetString("b0154_1");
                Org.b0154_2 = GetString("b0154_2");
                Org.b0157_1 = GetString("b0157_1");
                Org.b0157_2 = GetString("b0157_2");
                Org.b0161 = GetString("b0161");
                Org.b0164 = GetDate("b0164");
                Org.b0167 = GetString("b0167");
                Org.b0171_1 = GetString("b0171_1");
                Org.b0171_2 = GetString("b0171_2");
                Org.b0174 = GetString("b0174");
                Org.b0177 = GetString("b0177");
                Org.b0181 = GetDate("b0181");
                Org.b0184 = GetString("b0184");
                Org.b0187_1 = GetString("b0187_1");
                Org.b0187_2 = GetString("b0187_2");
                Org.b0191 = GetString("b0191");
                Org.b0194 = GetString("b0194");
                Org.b0197 = GetString("b0197");
                Org.b0199 = GetString("b0199");

                CQGJ.SaveChanges(true);

                viewData.ActionSuccess = true;
                viewData.HtmlPage = "单位:" + Org.b0104 + "修改成功!";
                viewData.JavaScriptPage = "/admin/Orginfo/" + Org.b0111;

                //调用webservers
                CQGJAP.CQGJWebServices ap = new CQGJ.Passport.CQGJAP.CQGJWebServices();
                ap.EditOrg(strCode, Org.b0111);
                RenderView("MessagePage", viewData);

            }
            else
            {
                //错误
            }
        }
Exemple #15
0
        public void CreateQualifications(string id)
        {
            int iID = 0;
            try
            {
                iID = int.Parse(id);
            }
            catch
            {
                //错误页面
            }
            CQGJUserViewData viewData = new CQGJUserViewData();

            viewData.Users = (from u in CQGJ.User
                              where u.UserID == iID
                              select u).ToList();

            if (viewData.Users.Count > 0)
            {
                viewData.User = viewData.Users[0];

                SchoolRecord school = new SchoolRecord();
                school.User = viewData.User;
                try
                {
                    string sign = Request.Form["Sign"].ToString();
                    school.Sign = 1;
                    List<SchoolRecord> listSchool = (from s in CQGJ.SchoolRecord where s.User.UserID == iID select s).ToList();
                    foreach (SchoolRecord s in listSchool)
                    {
                        s.Sign = 0;
                    }
                }
                catch
                {
                    school.Sign = 0;
                }
                //edu.GiveUnit = Request.Form["GiveUnit"].ToString();
                //edu.GiveDate = DateTime.Parse(Request.Form["GiveDate"].ToString());
                //edu.GiveArea = Request.Form["GiveArea"].ToString();
                //edu.ELCode = Request.Form["ELCode"].ToString();
                //edu.ELName = Request.Form["ELName"].ToString();
                //CQGJ.AddToEduLevel(edu);
                school.SRName = Request.Form["SRName"].ToString();
                school.SRCode = Request.Form["SRCode"].ToString();
                school.SchoolName = Request.Form["SchoolName"].ToString();
                school.UnitClass = Request.Form["UnitClass"].ToString();
                school.Prefessional = Request.Form["Prefessional"].ToString();
                school.AtArea = Request.Form["AtArea"].ToString();
                school.EduClass = Request.Form["EduClass"].ToString();
                school.EduLong = Request.Form["EduLong"].ToString();
                school.EnterDate = DateTime.Parse(Request.Form["EnterDate"].ToString());
                school.GraduateDate = DateTime.Parse(Request.Form["GraduateDate"].ToString());
                CQGJ.AddToSchoolRecord(school);
                CQGJ.SaveChanges(true);
                var Querry = from s in CQGJ.SchoolRecord where s.User.UserID == iID select s;
                viewData.SchoolRecords = Querry.ToList();
                viewData.AddAction = false;
                viewData.ActionSuccess = true;
                viewData.JavaScriptPage = " 添加";
                RenderView("Qualificationslist", viewData);
            }
        }
Exemple #16
0
        /// <summary>
        /// 显示用户信息
        /// </summary>
        /// <param name="id"></param>
        public void UserInfo(string id)
        {
            int iID = 0;
            try
            {
                iID = int.Parse(id);
            }
            catch
            {
                //错误页面
            }
            var Querry = from u in CQGJ.User where u.UserID == iID select u;
            CQGJUserViewData viewData = new CQGJUserViewData();
            viewData.Users = Querry.ToList();

            if (viewData.Users.Count > 0)
            {
                viewData.User = viewData.Users[0];
                try
                {
                    viewData.EduLevel = (from e in CQGJ.EduLevel
                                         where (e.User.UserID == iID && e.Sign == 1)
                                         select e).First();

                    viewData.SchoolRecord = (from s in CQGJ.SchoolRecord
                                             where (s.User.UserID == iID && s.Sign == 1)
                                             select s).First();

                    viewData.HtmlPage = viewData.EduLevel.ELName;

                    viewData.HtmlPage2 = viewData.SchoolRecord.SRName;

                }
                catch
                {
                    viewData.HtmlPage = "无";
                    viewData.HtmlPage2 = "无";
                }

            }
            else
            {
                RedirectToAction("index");
            }

            //图片处理 刘涛
            //if (viewData.Photos.Count > 0)
            //{D:\My Documents\Visual Studio 2008\Projects\重庆干教\CQGJ.Passport\Bussiness\
            //    viewData.Photo = viewData.Photos[0];

            //}
            //else
            //{
            //    RedirectToAction("index");
            //}

            RenderView("Userinfo", viewData);
        }
Exemple #17
0
        /// <summary>
        /// 添加用户-负责数据库保存
        /// </summary>
        /// <param name="id"></param>
        public void CreateUser(string id)
        {
            CQGJUserViewData viewData = new CQGJUserViewData();
            User user = new User();
            //user.UserID = Request.Form["UserID"].ToString();
            user.Username = Request.Form["UserName"].ToString();
            user.Remark = Request.Form["AdminRemark"].ToString();
            try
            {
                user.Status = int.Parse(Request.Form["AdminStatus"].ToString());
            }
            catch { }
            user.Birthday = DateTime.Parse(Request.Form["Birthday"].ToString());
            user.Cellphone = Request.Form["Cellphone"].ToString();
            //user.COUPost = Request.Form["COUPost"].ToString();
            //user.Degree = Request.Form["Degree"].ToString();
            //user.Description = Request.Form["Description"].ToString();
            //user.Edu = Request.Form["Edu"].ToString();
            //user.Email = Request.Form["Email"].ToString();
            user.Gender = Request.Form["Gender"].ToString();
            user.IDCard = Request.Form["IDCard"].ToString();
            if (HttpContext.Session["Photo"] != null && HttpContext.Session["PhotoType"] != null)
            {
                user.PhotoType = HttpContext.Session["PhotoType"].ToString();
                user.Photo = (byte[])HttpContext.Session["Photo"];

            }
            user.Password = Security.MD5Encrypt(Request.Form["userPassword"].ToString());
            try
            {
                user.JoinWorkDate = DateTime.Parse(Request.Form["JoinWorkDate"].ToString());
            }
            catch { }
            user.Nation = Request.Form["Nation"].ToString();
            //user.OtherLink = Request.Form["OtherLink"].ToString();
            //user.Password = Request.Form["OtherLink"].ToString();
            user.Politics = Request.Form["Politics"].ToString();
            user.Position = Request.Form["Position"].ToString();

            user.WorkTel = Request.Form["WorkTel"].ToString();
            user.RelationsName = Request.Form["OrgName"].ToString();
            user.RelationsCode = Request.Form["OrgCode"].ToString();
            try
            {
                user.Class = (Request.Form["Level"].ToString());
            }
            catch { }

            CQGJ.AddToUser(user);
            CQGJ.SaveChanges(true);
            viewData.User = user;
            viewData.ActionSuccess = true;

            viewData.JavaScriptPage = "添加人员:" + user.Username;
            //调用webservers
            CQGJAP.CQGJWebServices ap = new CQGJ.Passport.CQGJAP.CQGJWebServices();
            ap.AddUser(user.UserID);

            var querry = from b in CQGJ.b01 where b.b0111 == id select b;
            b01 Org = new b01();
            try
            {
                Org = querry.First();
            }
            catch
            {
                //错误
            }
            UsersInOrgs userinorg = new UsersInOrgs();
            userinorg.User = viewData.User;
            userinorg.b0111 = Org.b0111;

            CQGJ.AddToUsersInOrgs(userinorg);
            CQGJ.SaveChanges(true);
            viewData.HtmlPage = user.Username + "添加功,请添加" + Org.b0104 + "中的职务信息";
            viewData.JavaScriptPage = "/admin/OrgUserAdd/" + user.UserID + "/" + Org.b0111;
            RenderView("MessagePage", viewData);

            RenderView("Userinfo", viewData);
        }
Exemple #18
0
        /// <summary>
        /// 取得用户列表 现在版本仅为最初版本OrgID不用
        /// </summary>
        /// <param name="id">部门的标示</param>
        public void UserList(string id)
        {
            CQGJUserViewData viewData = new CQGJUserViewData();
            Bussiness.Global global = new CQGJ.Passport.Bussiness.Global();
            List<User> userlist = new List<User>();
            if (id != null && !id.Equals(""))
            {
                global.GetOrgUser(ref userlist, id);

                viewData.Users = userlist;
                if (Response.Cookies["OrgID"] == null)
                {
                    Response.Cookies.Add(new HttpCookie("OrgID"));
                }
                b01 OrgTemp = global.GetUpOrgOnelevel(id);
                string strOrgId = "";
                if (OrgTemp == null)
                {
                    strOrgId = "";
                }
                else
                {
                    strOrgId = OrgTemp.b0111;
                }
                viewData.Org = (from b in CQGJ.b01
                                where b.b0111 == id
                                select b).First();

                viewData.HtmlPage = "<a href='/admin/orglist/" + strOrgId + "'>" + viewData.Org.b0104 + "</a>";
                Response.Cookies["OrgID"].Value = id;
            }
            else
            {
                viewData.HtmlPage = "";
                viewData.Users = (from u in CQGJ.User select u).ToList();
            }

            RenderView("UserList", viewData);
        }
Exemple #19
0
        public void EduEdit(string UserID, string ID)
        {
            int iID = 0;
            int iEID = 0;
            try
            {
                iID = int.Parse(UserID);
                iEID = int.Parse(ID);
            }
            catch
            {
                //错误页面
            }

            CQGJUserViewData viewData = new CQGJUserViewData();
            var Querry = from e in CQGJ.EduLevel where e.User.UserID == iID select e;
            viewData.EduLevel = (from e in CQGJ.EduLevel where e.ELId == iEID select e).First();
            viewData.EduLevels = Querry.ToList();

            viewData.Users = (from u in CQGJ.User
                              where u.UserID == iID
                              select u).ToList();

            if (viewData.Users.Count > 0)
            {
                viewData.User = viewData.Users[0];
                viewData.EditAction = true;
                if (viewData.EduLevel.Sign == 1)
                {
                    viewData.HtmlPage = "<input type=\"checkbox\" name=\"Sign\"  checked=\"checked\"/>";
                }
                else viewData.HtmlPage = "<input type=\"checkbox\" name=\"Sign\" />";

                RenderView("EduList", viewData);
            }
        }
Exemple #20
0
        /// <summary>
        /// 用户可加入单位列表
        /// </summary>
        /// <param name="id">用户ID</param>
        public void UserNotOrg(string id)
        {
            CQGJUserViewData viewData = new CQGJUserViewData();
            int iID = 0;
            try
            {
                iID = int.Parse(id);
                viewData.User = (from u in CQGJ.User where u.UserID == iID select u).First();
            }
            catch
            {
                //错误页面
            }

            Bussiness.Global global = new CQGJ.Passport.Bussiness.Global();
            List<b01> Orglist = new List<b01>();
            global.GetUserNotInOrg(ref Orglist, iID);
            viewData.Orgs = Orglist;

            for (int j = 0; j < viewData.Orgs.Count; ++j)
            {
                string OrgCode = viewData.Orgs[j].b0111;
                string UsersInOrgNub = "0";
                try
                {
                    UsersInOrgNub = (from uo in CQGJ.UsersInOrgs where uo.b0111 == OrgCode select uo).Count().ToString();
                }
                catch
                {

                }
                string TempHtml = UsersInOrgNub;
                viewData.AdditionalInfo.Add(TempHtml);
            }

            RenderView("OrgNotUser", viewData);
        }
Exemple #21
0
        public void OrgDel(string id)
        {
            var Querry = from Org in CQGJ.b01 where Org.b0111 == id select Org;
            CQGJUserViewData viewData = new CQGJUserViewData();
            viewData.Orgs = Querry.ToList();
            if (viewData.Orgs.Count > 0)
            {

                b01 Org = viewData.Orgs[0];
                try
                {
                    string strOrgID = Org.b0111;
                    List<b01Expansion> OrgListE = (from oe in CQGJ.b01Expansion where oe.b01.b0111 == strOrgID select oe).ToList();
                    for (int k = 0; k < OrgListE.Count; ++k)
                    {
                        CQGJ.DeleteObject(OrgListE[k]);
                        CQGJ.SaveChanges(true);
                    }
                }
                catch { }

                CQGJ.DeleteObject(Org);
                List<UsersInOrgs> OrguserList = (from ou in CQGJ.UsersInOrgs where ou.b0111 == id select ou).ToList();
                foreach (UsersInOrgs Orguser in OrguserList)
                {
                    CQGJ.DeleteObject(Orguser);
                }

                CQGJ.SaveChanges(true);

                Bussiness.Global global = new CQGJ.Passport.Bussiness.Global();
                b01 Temp = global.GetUpOrgOnelevel(id);

                string str = "";
                if (Temp != null)
                {
                    str = "/" + Temp.b0111;
                }
                else
                {
                    str = "";
                }

                viewData.ActionSuccess = false;
                viewData.IfmLoad = true;
                viewData.HtmlPage = "单位:" + Org.b0104 + "删除成功!";
                viewData.JavaScriptPage = "/admin/OrgIndex";
                RenderView("MessagePage", viewData);
            }
            else
            {
                //错误
            }
        }
Exemple #22
0
        public void CreateOrg()
        {
            CQGJUserViewData viewData = new CQGJUserViewData();
            b01 Org = new b01();
            b01Expansion OrgE = new b01Expansion();

            int orgType = int.Parse(GetString("OrgType"));

            Org.b0101 = GetString("b0101");
            Org.b0104 = GetString("b0104");
            Org.b0107 = GetString("b0107");
            //Org.b0111 = GetString("b0111");
            Org.b0111_1 = GetString("b0111_1");
            Org.b0111_3 = GetString("b0111_3");
            Org.b0114 = GetString("b0114");
            Org.b0117 = GetString("b0117");
            Org.b01224 = GetString("b01224");
            Org.b0127 = GetString("b0127");
            Org.b0131 = GetString("b0131");
            Org.b0134 = GetString("b0134");
            Org.b0137 = GetString("b0137");
            Org.b0144_1 = GetString("b0144_1");
            Org.b0144_2 = GetString("b0144_2");
            Org.b0151_1 = GetString("b0151_1");
            Org.b0151_2 = GetString("b0151_2");
            Org.b0154_1 = GetString("b0154_1");
            Org.b0154_2 = GetString("b0154_2");
            Org.b0157_1 = GetString("b0157_1");
            Org.b0157_2 = GetString("b0157_2");
            Org.b0161 = GetString("b0161");
            Org.b0164 = GetDate("b0164");
            Org.b0167 = GetString("b0167");
            Org.b0171_1 = GetString("b0171_1");
            Org.b0171_2 = GetString("b0171_2");
            Org.b0174 = GetString("b0174");
            Org.b0177 = GetString("b0177");
            Org.b0181 = GetDate("b0181");
            Org.b0184 = GetString("b0184");
            Org.b0187_1 = GetString("b0187_1");
            Org.b0187_2 = GetString("b0187_2");
            Org.b0191 = GetString("b0191");
            Org.b0194 = GetString("b0194");
            Org.b0197 = GetString("b0197");
            Org.b0199 = GetString("b0199");
            if (orgType != 0)
            {
                Org.b0111 = GetString("b0111");
            }
            else
            {
                //Org.b0111 = GetString("b0111");
            }
            CQGJ.AddTob01(Org);
            CQGJ.SaveChanges(true);

            OrgE.b01 = Org;
            OrgE.Password = Security.MD5Encrypt("123456");
            OrgE.OrgType = orgType;
            CQGJ.AddTob01Expansion(OrgE);
            CQGJ.SaveChanges(true);

            viewData.ActionSuccess = true;
            viewData.HtmlPage = "单位:" + Org.b0104 + "添加成功。";
            viewData.JavaScriptPage = "/admin/OrgInfo/" + Org.b0111;

            //调用webservers
            CQGJAP.CQGJWebServices ap = new CQGJ.Passport.CQGJAP.CQGJWebServices();
            ap.AddOrg(Org.b0111);

            RenderView("MessagePage", viewData);
        }
Exemple #23
0
        /// <summary>
        /// 显示某一单位信息
        /// </summary>
        /// <param name="id"></param>
        public void OrgInfo(string id)
        {
            var Querry = from Org in CQGJ.b01 where Org.b0111 == id select Org;
            CQGJUserViewData viewData = new CQGJUserViewData();
            viewData.Orgs = Querry.ToList();
            if (viewData.Orgs.Count > 0)
            {
                viewData.Org = viewData.Orgs[0];
                Bussiness.Global global = new CQGJ.Passport.Bussiness.Global();
                b01 Temp = global.GetUpOrgOnelevel(id);
                string str = "";
                if (Temp != null)
                {
                    str = Temp.b0111;
                }
                else
                {
                    str = "";
                }

                viewData.HtmlPage = str;

            }
            else
            {
                RedirectToAction("index");
            }

            RenderView("Org", viewData);
        }
Exemple #24
0
        /// <summary>
        /// 删除用户在单位中信息(用户为中心)
        /// </summary>
        /// <param name="UserID"></param>
        /// <param name="ID"></param>
        public void UserOrgDel(string UserID, string ID)
        {
            CQGJUserViewData viewData = new CQGJUserViewData();
            int iID = 0;
            try
            {
                iID = int.Parse(UserID);
            }
            catch
            {
                //错误页面
            }

            var Qurrey = from uo in CQGJ.UsersInOrgs where uo.User.UserID == iID && uo.b0111 == ID select uo;
            var QUser = from u in CQGJ.User where u.UserID == iID select u;
            var QOrg = from o in CQGJ.b01 where o.b0111 == ID select o;
            UsersInOrgs userOrg = new UsersInOrgs();
            try
            {
                userOrg = Qurrey.First();
                CQGJ.DeleteObject(userOrg);
                viewData.HtmlPage = "人员:" + QUser.First().Username + "在单位:" + QOrg.First().b0104 + "中的关系删除成功!";
                viewData.JavaScriptPage = "/admin/UserOrgList/" + UserID;
                viewData.ActionSuccess = true;
                CQGJ.SaveChanges(true);

                RenderView("MessagePage", viewData);
            }
            catch
            {
                //错误页面
            }
        }
Exemple #25
0
        public void OrgUserAdd(string UserID, string ID)
        {
            int iID = 0;
            try
            {
                iID = int.Parse(UserID);
            }
            catch
            {
                //错误页面
            }
            var Querry = from u in CQGJ.User where u.UserID == iID select u;
            CQGJUserViewData viewData = new CQGJUserViewData();
            viewData.Users = Querry.ToList();

            if (viewData.Users.Count > 0)
            {
                viewData.User = viewData.Users[0];
                viewData.Org = (from o in CQGJ.b01 where (o.b0111 == ID) select o).First();
                try
                {
                    try
                    {

                        UsersInOrgs userinorg = (from uo in CQGJ.UsersInOrgs where uo.b0111 == ID && uo.User.UserID == viewData.User.UserID select uo).First();

                        if (GetString("DeptName").Equals(""))
                        {
                            RenderView("AddOrgUserDetail", viewData);
                        }
                        else
                        {
                            userinorg.CurrentPosition = GetString("CurrentPosition");
                            userinorg.LeaderPostion = GetString("LeaderPostion");
                            userinorg.Remark = GetString("Remark");
                            userinorg.DeptName = GetString("DeptName");

                            CQGJ.SaveChanges(true);
                            viewData.ActionSuccess = true;
                            viewData.HtmlPage = viewData.Users[0].Username + "在单位:" + viewData.Org.b0104 + "中的记录添加成功!";
                            viewData.JavaScriptPage = "/admin/OrgUserList/" + ID;
                            RenderView("MessagePage", viewData);
                        }
                    }
                    catch
                    {
                        //错误页面
                    }
                }
                catch
                {
                    viewData.HtmlPage = "无";
                    viewData.HtmlPage2 = "无";
                }

            }
            else
            {
                RedirectToAction("index");
            }

            RenderView("MessagePage", viewData);
        }
Exemple #26
0
        /// <summary>
        /// 用户单位列表
        /// </summary>
        /// <param name="id">用户ID</param>
        public void UserOrgList(string id)
        {
            CQGJUserViewData viewData = new CQGJUserViewData();
            Bussiness.Global global = new CQGJ.Passport.Bussiness.Global();
            List<b01> Orglist = new List<b01>();
            viewData.UsersInOrgs = new List<UsersInOrgs>();
            if (id != null && !id.Equals(""))
            {
                int iID = 0;
                try
                {
                    iID = int.Parse(id);
                    global.GetUserOrg(ref Orglist, iID);

                    viewData.Orgs = Orglist;

                    viewData.UsersInOrgs = (from uo in CQGJ.UsersInOrgs
                                            where uo.User.UserID == iID
                                            select uo).ToList();
                    viewData.User = (from u in CQGJ.User
                                     where u.UserID == iID
                                     select u).First();
                    RenderView("UserOrg", viewData);
                }
                catch
                {
                    //错误
                }

            }
            else
            {
                // 错误页面
            }
        }
Exemple #27
0
        public void OrgUserDel(string UserID, string ID)
        {
            int iID = 0;
            try
            {
                iID = int.Parse(UserID);
            }
            catch
            {
                //错误页面
            }
            var Querry = from u in CQGJ.User where u.UserID == iID select u;
            CQGJUserViewData viewData = new CQGJUserViewData();
            viewData.Users = Querry.ToList();

            if (viewData.Users.Count > 0)
            {
                viewData.User = viewData.Users[0];
                try
                {
                    try
                    {
                        UsersInOrgs userinorg = new UsersInOrgs();
                        userinorg = (from uo in CQGJ.UsersInOrgs where (uo.b0111 == ID && uo.User.UserID == iID) select uo).First();
                        CQGJ.DeleteObject(userinorg);

                        CQGJ.SaveChanges(true);

                        viewData.ActionSuccess = true;
                        viewData.Org = (from o in CQGJ.b01 where (o.b0111 == ID) select o).First();
                        viewData.HtmlPage = viewData.Users[0].Username + "在单位:" + viewData.Org.b0104 + "中的记录删除成功!";
                        viewData.JavaScriptPage = "/admin/orguserlist/" + ID;
                    }
                    catch
                    {
                        //错误页面
                    }
                }
                catch
                {
                    viewData.HtmlPage = "无";
                    viewData.HtmlPage2 = "无";
                }

            }
            else
            {
                RedirectToAction("index");
            }

            RenderView("MessagePage", viewData);
        }
Exemple #28
0
        public void UserRole(string UserID, string ID)
        {
            int iID = 0;
            try
            {
                iID = int.Parse(UserID);
            }
            catch
            {
                //错误页面
            }
            var Querry = from u in CQGJ.User where u.UserID == iID select u;
            CQGJUserViewData viewData = new CQGJUserViewData();
            viewData.Users = Querry.ToList();

            if (viewData.Users.Count > 0)
            {
                viewData.User = viewData.Users[0];
                try
                {
                    UsersInOrgs userinorg = new UsersInOrgs();
                    userinorg = (from uo in CQGJ.UsersInOrgs where (uo.b0111 == ID && uo.User.UserID == iID) select uo).First();
                    b01Expansion OrgE = (from oe in CQGJ.b01Expansion where (oe.b01.b0111 == ID) select oe).First();
                    viewData.Org = (from o in CQGJ.b01 where (o.b0111 == ID) select o).First();
                    int OrgType = (int)(OrgE.OrgType);
                    if (OrgType == 4)
                    { OrgType = 2; }

                    string orgtype = OrgType.ToString();
                    //获取与用户所属单位类型一致的角色列表
                    List<Role> roles = (from r in CQGJ.Role
                                        where r.RoleType.Contains(orgtype)
                                        select r).ToList();
                    viewData.RoleList = roles;
                    //for (int j = 0; j < roles.Count; j++)
                    //{
                    //    if (int.Parse(roles[j].AppID) >= OrgType)
                    //    {
                    //        if (OrgType == 2 && int.Parse(roles[j].AppID) == 3)//区县组织部,市直属机构
                    //        {
                    //            ;
                    //        }
                    //        else viewData.RoleList.Add(roles[j]);
                    //    }
                    //}
                    viewData.UsersInRoles = (from ur in CQGJ.UsersInRoles where ur.User.UserID == iID select ur).ToList();

                    if (GetString("btOK").Equals(""))
                    {
                        RenderView("UserRole", viewData);
                        return;
                    }
                    else
                    {
                        List<UsersInRoles> userroles = (from ur in CQGJ.UsersInRoles where ur.User.UserID == iID select ur).ToList();
                        if (userroles.Count > 0)
                        {
                            for (int l = 0; l < userroles.Count; ++l)
                            {
                                CQGJ.DeleteObject(userroles[l]);
                            }
                        }
                        if (GetString("CheckNoRole").Equals(""))
                        {
                            for (int k = 0; k < viewData.RoleList.Count; ++k)
                            {
                                string str = GetString("check" + viewData.RoleList[k].RoleID.ToString());
                                if (str.Equals("on"))
                                {
                                    UsersInRoles userinrole = new UsersInRoles();
                                    userinrole.Role = viewData.RoleList[k];
                                    userinrole.User = viewData.User;
                                    CQGJ.AddToUsersInRoles(userinrole);
                                }
                            }
                        }
                        CQGJ.SaveChanges(true);

                        viewData.UsersInRoles = (from ur in CQGJ.UsersInRoles where ur.User.UserID == iID select ur).ToList();

                        viewData.HtmlPage = "人员:" + viewData.User.Username + "角色设置成功!";
                        viewData.JavaScriptPage = "/admin/UserRole/" + UserID + "/" + ID;
                        viewData.ActionSuccess = true;
                        CQGJ.SaveChanges(true);

                        RenderView("MessagePage", viewData);
                        return;
                    }
                }
                catch
                {
                    viewData.HtmlPage = "无";
                    viewData.HtmlPage2 = "无";
                }
            }
            else
            {
                RedirectToAction("index");
            }

            RenderView("UserRole", viewData);
        }
Exemple #29
0
        public void OrgUserInfo(string UserID, string ID)
        {
            int iID = 0;
            try
            {
                iID = int.Parse(UserID);
            }
            catch
            {
                //错误页面
            }
            var Querry = from u in CQGJ.User where u.UserID == iID select u;
            CQGJUserViewData viewData = new CQGJUserViewData();
            viewData.Users = Querry.ToList();

            if (viewData.Users.Count > 0)
            {
                viewData.User = viewData.Users[0];
                try
                {

                    viewData.HtmlPage = viewData.EduLevel.ELName;

                    viewData.HtmlPage2 = viewData.SchoolRecord.SRName;

                }
                catch
                {
                    viewData.HtmlPage = "无";
                    viewData.HtmlPage2 = "无";
                }
                try
                {
                    viewData.UsersInOrg = (from uo in CQGJ.UsersInOrgs where (uo.b0111 == ID && uo.User.UserID == iID) select uo).First();
                    viewData.Org = (from o in CQGJ.b01 where (o.b0111 == ID) select o).First();
                }
                catch
                {
                    //错误页面
                }
                try
                {
                    viewData.OrgE = (from oe in CQGJ.b01Expansion where (oe.b01.b0111 == ID) select oe).First();
                }
                catch
                {
                    //错误页面
                }

            }
            else
            {
                RedirectToAction("index");
            }

            //图片处理 刘涛
            //if (viewData.Photos.Count > 0)
            //{D:\My Documents\Visual Studio 2008\Projects\重庆干教\CQGJ.Passport\Bussiness\
            //    viewData.Photo = viewData.Photos[0];

            //}
            //else
            //{
            //    RedirectToAction("index");
            //}

            RenderView("OrgUserinfo", viewData);
        }
Exemple #30
0
        public void QualificationsList(string id)
        {
            int iID = 0;
            try
            {
                iID = int.Parse(id);
            }
            catch
            {
                //错误页面
            }
            CQGJUserViewData viewData = new CQGJUserViewData();
            var Querry = from s in CQGJ.SchoolRecord where s.User.UserID == iID select s;
            viewData.SchoolRecords = Querry.ToList();

            viewData.Users = (from u in CQGJ.User
                              where u.UserID == iID
                              select u).ToList();

            if (viewData.Users.Count > 0)
            {
                viewData.User = viewData.Users[0];
                RenderView("Qualificationslist", viewData);
            }
        }