public async Task <IActionResult> Edit(string id, [Bind("Bunho,UserName,Password,ConfirmPassword,OrgCd,AssignedIp,Email,Telephone,Mobilephone,UserType,UserAuth,DutyType,MenuAuth,LoginYn,LockYn,LastLoginDt,CreateUserId,CreateDt,UpdateUserId,UpdateDt,SortOrder,PwdchangeYn,JikgupName,DutytypeName")] TUserInfo tUserInfo)
        {
            if (id != tUserInfo.Bunho)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(tUserInfo);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TUserInfoExists(tUserInfo.Bunho))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(tUserInfo));
        }
Beispiel #2
0
        private List <int> DeleteList = new List <int>();    //删除列表

        /// <summary>
        /// 构造函数
        /// </summary>
        public TSelectChar()
        {
            for (int i = 0; i < UserArray.Length; i++)
            {
                UserArray[i] = new TUserInfo();
            }
            Initialize();
        }
Beispiel #3
0
        /// <summary>
        /// 获得项目
        /// </summary>
        /// <param name="Index"></param>
        /// <returns></returns>
        private TUserInfo GetItem(int Index)
        {
            TUserInfo result = null;

            if ((Index >= 0) && (Index < UserArray.Length))
            {
                result = UserArray[Index];
            }
            return(result);
        }
Beispiel #4
0
        /// <summary>
        /// 获取在线的项目
        /// </summary>
        /// <param name="Index"></param>
        /// <returns></returns>
        public TUserInfo GetOnLineItem(int Index)
        {
            TUserInfo result = null;

            if ((Index >= 0) && (Index < OnLineList.Count))
            {
                result = GetItem(((int)OnLineList[Index]));
            }
            return(result);
        }
        public async Task <IActionResult> Create([Bind("Bunho,UserName,Password,ConfirmPassword,OrgCd,AssignedIp,Email,Telephone,Mobilephone,UserType,UserAuth,DutyType,MenuAuth,LoginYn,LockYn,LastLoginDt,CreateUserId,CreateDt,UpdateUserId,UpdateDt,SortOrder,PwdchangeYn,JikgupName,DutytypeName")] TUserInfo tUserInfo)
        {
            if (ModelState.IsValid)
            {
                _context.Add(tUserInfo);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(tUserInfo));
        }
Beispiel #6
0
 public static TUserInfo GetGroupMemberByGroupMemberId(int groupmemberid)
 {
     try
     {
         TUserInfo group = TUserInfo.FindOne(CK.K["GroupMemberId"] == groupmemberid && CK.K["IsDel"] == "False");
         return(group);
     }
     catch
     {
         return(null);
     }
 }
Beispiel #7
0
 public static TUserInfo GetUserById(int id)
 {
     try
     {
         TUserInfo user = TUserInfo.FindById(id);
         return(user);
     }
     catch
     {
         return(null);
     }
 }
Beispiel #8
0
 public static TUserInfo GetPersonMemberByPersonMemberId(int personmemberid)
 {
     try
     {
         TUserInfo person = TUserInfo.FindOne(CK.K["PersonMemberId"] == personmemberid && CK.K["IsDel"] == "False");
         return(person);
     }
     catch
     {
         return(null);
     }
 }
Beispiel #9
0
        public static TUserInfo ULogin(string ucode, string upassword)
        {
            TUserInfo uinfo = TUserInfoDAL.UGetUserInfoByCode(ucode);

            if (uinfo == null)
            {
                return(null);
            }
            //if (Security.Decode(uinfo.Upassword) != upassword)
            // return null;

            return(uinfo);
        }
Beispiel #10
0
 public static string ResetPwdById(int infoid)
 {
     try
     {
         var info = TUserInfo.FindById(infoid);
         info.Pwd = "123456";
         info.Save();
         return("1");
     }
     catch
     {
         return("0");
     }
 }
Beispiel #11
0
 public static string DeleteUserById(int infoid, int deluserid, DateTime deltime)
 {
     try
     {
         var delinfo = TUserInfo.FindById(infoid);
         delinfo.IsDel     = true;
         delinfo.DelUserId = deluserid;
         delinfo.DelTime   = deltime;
         delinfo.Save();
         return("1");
     }
     catch
     {
         return("0");
     }
 }
Beispiel #12
0
 public static string DeleteUserByGroupMemberId(int infoid, int deluserid, DateTime deltime)
 {
     try
     {
         var delinfo = TUserInfo.FindOne(CK.K["GroupMemberId"] == infoid && CK.K["IsDel"] == false && CK.K["UserTypeId"] == 5);
         delinfo.IsDel     = true;
         delinfo.DelUserId = deluserid;
         delinfo.DelTime   = deltime;
         delinfo.Save();
         return("1");
     }
     catch
     {
         return("0");
     }
 }
        public static int UAddUserInfo(TUserInfo ui)
        {
            SqlConnection con = new SqlConnection(MsSqlHelper.connectionString);

            con.Open();
            SqlTransaction trn = con.BeginTransaction();

            try
            {
                int iUserId = UAddUserInfo(con, trn, ui);
                if (iUserId > 0)
                {
                    ui.Uid = iUserId;
                    foreach (var item in ui.Usergroups)
                    {
                        TUserGroup ug = new TUserGroup()
                        {
                            UID = ui.Uid,
                            GID = item.GID
                        };
                        if (TUserGroupDAL.UAddRecord(con, trn, ug) != 1)
                        {
                            throw new Exception("添加用户组失败");
                        }
                    }

                    trn.Commit();
                    con.Close();
                    con.Dispose();
                    return(1);
                }
                else
                {
                    throw new Exception("添加UserInfo出错");
                }
            }
            catch (Exception e)
            {
                LogHelper.WriteLog("TUserInfoDAL.UAddUserInfo1", e);
                trn.Rollback();
                con.Close();
                con.Dispose();
                return(0);
            }
        }
Beispiel #14
0
        public static int UAddUserInfo(string ucode, string uname, string upwd, string uidentitycardno,
                                       string utel1, string utel2, string uaddress, List <TGroupInfo> lstGI)
        {
            TUserInfo ui = new TUserInfo()
            {
                Uid             = 0,
                Ucode           = ucode,
                Uname           = uname,
                Upassword       = upwd,
                Uidentitycardno = uidentitycardno,
                Utel1           = utel1,
                Utel2           = utel2,
                Uaddress        = uaddress,
                Usergroups      = lstGI
            };

            return(UAddUserInfo(ui));
        }
Beispiel #15
0
        public static string UpdatePwdById(int userid, string pwd)
        {
            try
            {
                TUserInfo person = TUserInfo.FindById(userid);
                person.Pwd = pwd;

                person.IsDel = false;
                //person.CreateUserId = createuserid;
                //person.CreateTime = createtime;
                person.Save();
                return("1");
            }
            catch
            {
                return("0");
            }
        }
Beispiel #16
0
 public static string AddVipMember(string account, string pwd, string name, int createuserid, DateTime createtime)
 {
     try
     {
         var VipMember = new TUserInfo();
         VipMember.Account      = account;
         VipMember.Pwd          = pwd;
         VipMember.Name         = name;
         VipMember.IsDel        = false;
         VipMember.CreateTime   = createtime;
         VipMember.CreateUserId = createuserid;
         VipMember.Save();
         return("1");
     }
     catch
     {
         return("0");
     }
 }
Beispiel #17
0
        private void updateSecurity()
        {
            switch (TUserInfo.theSecurityLevel(ProductionGlobal.TProductionGlobal.WPASMenuStructure.miRevisedPlanningSecurity_HPASRevisedPlanningSecurity_MinewareSystemsHarmonyPAS.ItemID))
            {
            case 0:
            case 1:
                btnAdd.Enabled  = false;
                btnDel.Enabled  = false;
                btnEdit.Enabled = false;

                break;

            case 2:
                btnAdd.Enabled  = true;
                btnDel.Enabled  = true;
                btnEdit.Enabled = true;
                break;
            }
        }
Beispiel #18
0
        public static string UpdatePersonMemberAccount(int personmemberid, string account, int createuserid, DateTime createtime)
        {
            try
            {
                TUserInfo person = TUserInfo.FindOne(CK.K["PersonMemberId"] == personmemberid && CK.K["IsDel"] == "False");
                person.Account = account;


                person.IsDel        = false;
                person.CreateUserId = createuserid;
                person.CreateTime   = createtime;
                person.Save();
                return("1");
            }
            catch
            {
                return("0");
            }
        }
Beispiel #19
0
        /// <summary>
        /// 登陆用户
        /// </summary>
        /// <param name="UserCode"></param>
        /// <param name="Password"></param>
        /// <returns></returns>
        public static bool Logon(string OrgCode, string UserCode, string Password, ref TUserInfo User, out string msg)
        {
            try
            {
                //检测用户是否存在;



                User = new TUserInfo();
                if (!GetUser(OrgCode, UserCode, Password, ref User, out msg))
                {
                    return(false);
                }
                else
                {
                    //用户存在,登陆
                    if (!RecvMessageObj(LoginClass.MobileLogin(OrgCode, UserCode, Password), ref User.Rights, out msg))
                    {
                        return(false);
                    }

                    if (User.Rights != null)
                    {
                        User.UserCode = UserCode;
                        User.Password = Password;
                        msg           = "登陆成功!";
                        return(true);
                    }
                    else
                    {
                        User = null;
                        msg  = "登陆失败!密码错误!";
                        return(false);
                    }
                }
            }
            catch
            {
                msg  = "查无此人";
                User = null;
                return(false);
            }
        }
 private void updateSecurity()
 {
     if (TUserInfo.theSecurityLevel(ProductionGlobal.TProductionGlobal.WPASMenuStructure.miAuthorisePlan_HPASLockPlanningAuthorise_MinewareSystemsHarmonyPAS.ItemID) == 2)
     {
         btnSave.Enabled = true;
         gcLocked.OptionsColumn.AllowEdit    = true;
         gcLocked.OptionsColumn.ReadOnly     = false;
         gcAuthorize.OptionsColumn.AllowEdit = true;
         gcAuthorize.OptionsColumn.ReadOnly  = false;
     }
     else
     {
         btnSave.Enabled = false;
         gcLocked.OptionsColumn.AllowEdit    = false;
         gcLocked.OptionsColumn.ReadOnly     = true;
         gcAuthorize.OptionsColumn.AllowEdit = false;
         gcAuthorize.OptionsColumn.ReadOnly  = true;
     }
 }
Beispiel #21
0
        public ActionResult UEditUserInfo()
        {
            string    userjson = Request["userInfo"];
            TUserInfo userdata = null;

            if ((userjson == null) || (userjson == String.Empty))
            {
                if (Request["UserCode"] == null || Request["UserCode"] == String.Empty ||
                    Request["Password"] == null || Request["Password"] == String.Empty
                    )
                {
                    return(RedirectToAction("Index", "UserInfo"));
                }
                else
                {
                    string sUCode = Request["UserCode"];
                    string sUPwd  = Request["Password"];

                    userdata = TUserInfoBLL.ULogin(sUCode, sUPwd);
                }
            }
            else
            {
                userdata = JsonHelper.DeserializeJsonToObject <TUserInfo>(Request["userInfo"]);
            }
            //判断是否有管理员权限
            bool IsCanEditInfo = false;

            foreach (var item in userdata.Usergroups)
            {
                if (item.GType == 1)
                {
                    IsCanEditInfo = true;
                }
            }
            if (IsCanEditInfo == false)
            {
                return(Content(JsonHelper.SerializeObject(new { code = -1, errmsg = "无该操作权限" })));
            }

            return(View());
        }
Beispiel #22
0
        public TileItem getMainMenuItem()
        {
            int theLevel = TUserInfo.theSecurityLevel(TMinewasteGlobal.MinewasteMenuStructure.miMinewaste_Minewaste_MinewareSystemsMinewaste.ItemID);

            if (theLevel > 0)
            {
                var theResult     = new TileItem();
                var imageServices = Properties.Resources.IMS48x48;
                theResult.Text          = "<size=20>Minewaste</size>";
                theResult.TextAlignment = TileItemContentAlignment.TopLeft;
                theResult.AppearanceItem.Normal.BackColor   = Color.FromArgb(255, 0, 0);
                theResult.AppearanceItem.Normal.BackColor2  = Color.FromArgb(255, 0, 0);
                theResult.AppearanceItem.Normal.BorderColor = Color.Transparent;
                theResult.ImageAlignment = TileItemContentAlignment.BottomRight;
                theResult.Image          = imageServices;
                theResult.Tag            = MinewasteResource.systemTag;
                theResult.ItemSize       = TileItemSize.Wide;
                return(theResult);
            }


            //int theLevel2 = TUserInfo.theSecurityLevel(THarmonyPASGlobal.SafetyMenuStruct.miHRM_SAF_MinewareSystemsHarmonyHRM.ItemID);
            //if (theLevel2 > 0)
            //{
            //    var theResult2 = new TileItem();
            //    var imageServices2 = resHarmonyPAS.SafetyStart48x48;
            //    theResult2.Text = "<size=20>Human Resources Management</size>";
            //    theResult2.TextAlignment = TileItemContentAlignment.TopLeft;
            //    theResult2.AppearanceItem.Normal.BackColor = Color.FromArgb(285, 0, 0);
            //    theResult2.AppearanceItem.Normal.BackColor2 = Color.FromArgb(285, 0, 0);
            //    theResult2.AppearanceItem.Normal.BorderColor = Color.Transparent;
            //    theResult2.ImageAlignment = TileItemContentAlignment.BottomRight;
            //    theResult2.Image = imageServices2;
            //    theResult2.Tag = resHarmonyPAS.systemTag;
            //    theResult2.ItemSize = TileItemSize.Wide;
            //    return theResult2;
            //}
            else
            {
                return(null);
            }
        }
Beispiel #23
0
 /// <summary>
 /// 获取用户
 /// </summary>
 /// <param name="UserCode"></param>
 /// <param name="msg"></param>
 /// <returns></returns>
 public static bool GetUser(string OrgCode, string UserCode, string Password, ref TUserInfo User, out string msg)
 {
     try
     {
         if (!RecvMessageObj <TUserInfo>(GetUserNameClass.GetName(UserCode, OrgCode), ref User, out msg))
         {
             return(false);
         }
         else
         {
             return(true);
         }
     }
     catch (Exception ex)
     {
         msg  = ex.Message;
         User = null;
         return(false);
     }
 }
        public static TUserInfo getUserInfo(WX_USER_INFO wxUser1)
        {
            TUserInfo user1 = new TUserInfo();

            if (!string.IsNullOrEmpty(wxUser1.User_id))
            {
                user1.User_id = Guid.Parse(wxUser1.User_id);
                user1.Token   = getToken(wxUser1.User_id);
            }
            user1.Openid = wxUser1.Openid;
            //user1.SUBSCRIBE = Int32.Parse(subscribe);
            user1.Nick_name = wxUser1.Nick_name;

            if (wxUser1.Sex != 0)
            {
                user1.Gender = Convert.ToString(wxUser1.Sex);// Int32.Parse(sex);
            }
            //user1.LANGUAGE = language;
            user1.City = wxUser1.City;
            //user1.City_id = 36;
            user1.Province = wxUser1.Province;
            //user1.Province_id = "1";

            //user1.COUNTRY = country;
            user1.Head_img_url = wxUser1.Head_img_url;
            //user1.SUBSCRIBE_TIME = subscribe_time;
            //user1.REMARK = remark;

            if (!string.IsNullOrEmpty(wxUser1.Sc) && wxUser1.Sc != "999")
            {
                user1.Sc_id = ScHelper.getSc(wxUser1.Sc);
                TscWxInfo scinfo1 = BLLTable <TscWxInfo> .GetRowData(TscWxInfo.Attribute.Sc_id, user1.Sc_id);

                if (scinfo1 != null && scinfo1.IsNotNull())
                {
                    user1.School_id   = scinfo1.School_id;
                    user1.School_name = scinfo1.Sc_name;
                }
            }
            return(user1);
        }
Beispiel #25
0
        protected void btn_Add_Click(object sender, EventArgs e)
        {
            try
            {
                string title = tb_Title.Text.Trim();
                if (title.IsNullOrEmpty())
                {
                    WebAlart("标题不能为空,请重新输入!");
                    return;
                }
                int createuserid = Convert.ToInt32(uid.Trim());
                //string content = this.tb_Content.Text.Replace("\r\n", "<br/>").Replace(" ", "&nbsp");
                string content = this.tb_Content.InnerText;

                string r = BusinessSupply.BusinessOper.NoticeBusiness.AddNotice(title, content, createuserid, this.input_ShowTime.Value);
                if (r == "1")
                {
                    //记录删除日志
                    TUserInfo userinfo  = BusinessSupply.BusinessOper.UserBusiness.GetUserById(Convert.ToInt32(uid));
                    string    logresult = BusinessSupply.BusinessOper.LogInfoBusiness.AddLogInfo(Convert.ToInt32(uid), DateTime.Now, 1, userinfo.Name, 2, "通知公告", ip, userinfo.Account);
                    if (logresult == "0")
                    {
                        WebAlart("数据加载错误");
                    }
                    else
                    {
                        WebAlart("添加成功", "NoticeManage.aspx");
                    }
                }
                else
                {
                    WebAlart("添加失败", "NoticeManage.aspx");
                }
            }
            catch
            {
                WebAlart("数据加载错误", "NoticeManage.aspx");
            }
        }
Beispiel #26
0
        public static string AddGroupMember(string account, string pwd, string name, int groupmemberid, int createuserid, DateTime createtime)
        {
            try
            {
                var groupmember = new TUserInfo();
                groupmember.Account       = account;
                groupmember.Pwd           = pwd;
                groupmember.Name          = name;
                groupmember.UserTypeId    = 5;
                groupmember.GroupMemberId = groupmemberid;

                groupmember.IsDel        = false;
                groupmember.CreateUserId = createuserid;
                groupmember.CreateTime   = createtime;
                groupmember.Save();
                return("1");
            }
            catch
            {
                return("0");
            }
        }
Beispiel #27
0
        public static string AddAsAdmin(string account, string pwd, string name, int associationid, int createuserid, DateTime createtime)
        {
            try
            {
                var AsAdmin = new TUserInfo();
                AsAdmin.Account       = account;
                AsAdmin.Pwd           = pwd;
                AsAdmin.Name          = name;
                AsAdmin.UserTypeId    = 2;
                AsAdmin.AssociationId = associationid;

                AsAdmin.IsDel        = false;
                AsAdmin.CreateUserId = createuserid;
                AsAdmin.CreateTime   = createtime;
                AsAdmin.Save();
                return("1");
            }
            catch
            {
                return("0");
            }
        }
Beispiel #28
0
        //新增个人会员
        public static string AddPersonMember(string account, string pwd, string name, int personmemberid, int createuserid, DateTime createtime)
        {
            try
            {
                var personmember = new TUserInfo();
                personmember.Account        = account;
                personmember.Pwd            = pwd;
                personmember.Name           = name;
                personmember.UserTypeId     = 4;
                personmember.PersonMemberId = personmemberid;

                personmember.IsDel        = false;
                personmember.CreateUserId = createuserid;
                personmember.CreateTime   = createtime;
                personmember.Save();
                return("1");
            }
            catch
            {
                return("0");
            }
        }
Beispiel #29
0
        public static string UpdateUser(int userId, string account, string pwd, string name, int userTypeId, string IDCardNum, string Phone, int createuserid, DateTime createtime)
        {
            try
            {
                var AsAdmin = TUserInfo.FindById(userId);
                AsAdmin.Account    = account;
                AsAdmin.Pwd        = pwd;
                AsAdmin.Name       = name;
                AsAdmin.UserTypeId = userTypeId;
                AsAdmin.IDCardNum  = IDCardNum;
                AsAdmin.Phone      = Phone;

                AsAdmin.CreateUserId = createuserid;
                AsAdmin.CreateTime   = createtime;
                AsAdmin.Save();
                return("1");
            }
            catch
            {
                return("0");
            }
        }
Beispiel #30
0
        protected void gv_Notice_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            try
            {
                int      nid     = Convert.ToInt32(this.gv_Notice.DataKeys[e.RowIndex]["Id"].ToString());
                int      duid    = Convert.ToInt32(uid);
                DateTime deltime = DateTime.Now;
                string   r       = BusinessSupply.BusinessOper.NoticeBusiness.DeleteNoticeById(nid, duid, deltime);
                if (r == "1")
                {
                    //记录日志
                    TUserInfo userinfo = BusinessSupply.BusinessOper.UserBusiness.GetUserById(Convert.ToInt32(uid));
                    //string operateobject = this.Page.Title;
                    string logresult = BusinessSupply.BusinessOper.LogInfoBusiness.AddLogInfo(Convert.ToInt32(uid), deltime, 1, userinfo.Name, 3, "通知公告", ip, userinfo.Account);
                    if (logresult == "0")
                    {
                        ScriptManager.RegisterStartupScript(UpdatePanel2, this.GetType(), "alter", "alert('删除失败!')", true);
                        //WebAlart("数据加载错误");
                    }
                    RefreshTable(0);

                    ScriptManager.RegisterStartupScript(UpdatePanel2, this.GetType(), "alter", "alert('删除成功!')", true);
                    return;
                    //WebAlart("删除成功");
                }
                else
                {
                    ScriptManager.RegisterStartupScript(UpdatePanel2, this.GetType(), "alter", "alert('删除失败!')", true);
                    WebAlart("删除失败");
                }
            }
            catch
            {
                ScriptManager.RegisterStartupScript(UpdatePanel2, this.GetType(), "alter", "alert('删除失败!')", true);
                //WebAlart("数据加载错误");
            }
        }