예제 #1
0
        public ActionResult Login_SureClick(tblUserInfo model)
        {
            //if (DateTime.Now > Convert.ToDateTime("2016-12-1"))
            //{
            //    X.Msg.Alert("注意", "系统已过期!").Show();
            //    return this.Direct();
            //}
            //ScanFoundDelTask task = new ScanFoundDelTask();
            //task.ScanTask();
            UserInfoManage userManage = new UserInfoManage();
            //userManage.Test();
            //return this.Direct();
            string s = userManage.UserLogin(model, Response);

            try
            {
                long lUserID = Convert.ToInt64(s);
                return(RedirectToAction("Index", "MainPage", new { area = "adminMain" }));
            }
            catch
            {
                X.Msg.Alert("错误", s).Show();
                return(this.Direct());
            }
        }
예제 #2
0
    private string uploadFile()
    {
        string    res = "读取文件失败!";
        DataTable dt  = ExcelHelperV2_0.Import(Request);

        if (dt != null)
        {
            dt.Columns.Add("companyId");
            dt.Columns.Add("departmentId");
            dt.Columns.Add("department");
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                dt.Rows[i]["companyId"]    = GetUserInfo().companyId;
                dt.Rows[i]["departmentId"] = "1";
                dt.Rows[i]["department"]   = "业力集团";
                string[] values = dt.Rows[i]["毕业学校"].ToString().Split('-');
                if (values.Length > 1)//
                {
                    dt.Rows[i]["毕业学校"] = values[0];
                    dt.Rows[i]["专业"]   = values[1];
                }
            }
            res = UserInfoManage.InsertInfos(dt);
        }
        return(res);
    }
예제 #3
0
    private string modifyPsw()
    {
        UserInfo user   = (UserInfo)Session["user"];
        string   oldPsw = Request.Form["oldPsw"];
        string   newPsw = Request.Form["newPsw"];

        user.passWord = oldPsw;
        string token = "";
        string res   = UserInfoManage.Login(ref user, ref token);//"登录成功"

        if (res == "登录成功")
        {
            user.passWord = newPsw;
            res           = UserInfoManage.ModifyPassword(ref user);
            //Session["user"] = user;
            if (res.Contains("操作成功"))
            {
                Session["user"] = user;
                List <DepartmentPost> dpList = UserInfoManage.GetDepartmentPostList(user);
                Session["DepartmentPostList"] = dpList;
                res = "密码修改成功!";
            }
        }
        return(res);
    }
예제 #4
0
    private string Add()
    {
        string res = "添加失败!";

        DataSet ds = SqlHelper.GetFiledNameAndComment("users");

        if (ds != null)
        {
            Dictionary <string, string> dict = new Dictionary <string, string>();
            string[] exceptedField           = new string[] { "passWord", "userId", "department", "departmentId", "companyId", "nativePlace" };
            foreach (DataRow row in ds.Tables[0].Rows)
            {
                if (!exceptedField.Contains <string>(row["field"].ToString()))
                {
                    dict.Add(row["field"].ToString(), Request.Form[row["field"].ToString()]);
                }
            }
            dict.Add("departmentId", Request.Form["department"]);
            UserInfo user = (UserInfo)Session["user"];
            dict.Add("companyId", user.companyId.ToString());
            string id = Request.Form["userId"];

            res = UserInfoManage.InsertInfos(dict);
        }
        return(res);
    }
예제 #5
0
        private void bttmoney_Click(object sender, EventArgs e)
        {
            //如果未检测到可用卡,则提示信息
            if (string.IsNullOrEmpty(txtxiaofeiID.Text))
            {
                MessageBox.Show("未检测到可用账户!");
                return;
            }
            else if (UserInfoManage.GetSelectUserinfoByID(txtxiaofeiID.Text) == null)
            {
                MessageBox.Show("此卡还未开通,请开卡或换卡!");
                return;
            }
            else if (string.IsNullOrEmpty(txtxiaofeiMoney.Text))
            {
                MessageBox.Show("请先输入充值金额!");
                return;
            }
            else if (int.Parse(this.txtxiaofeiMoney.Text) <= 0)
            {
                MessageBox.Show("请输入有效的充值金额!");
                return;
            }
            Userinfo userinfo = new Userinfo();

            userinfo.UsercardID = this.txtxiaofeiID.Text;
            userinfo.UserName   = this.txtxiaofeiName.Text;
            userinfo.UserMoney  = decimal.Parse(this.txtxiaofeiMoney.Text);
            if (UserInfoManage.UpdateUserinfo(userinfo))
            {
                MessageBox.Show("充值成功!");
            }
        }
예제 #6
0
    private string CheckCookie()
    {
        CookieHelper cookie   = new CookieHelper(Context);
        string       userName = cookie.GetCookieValue("RememberMe");

        if (!string.IsNullOrEmpty(userName))
        {
            string token = cookie.GetCookieValue("LoginToken");
            if (string.IsNullOrEmpty(token))
            {
                return(userName);
            }
            else
            {
                UserInfo user = new UserInfo();
                user.userName = userName;
                string value = UserInfoManage.CookieLogin(ref user, token);
                if (value == "登录成功")
                {
                    Session["user"] = user;
                    List <DepartmentPost> dpList = UserInfoManage.GetDepartmentPostList(user);
                    Session["DepartmentPostList"] = dpList;
                    return("T");
                }
                else
                {
                    return(userName);
                }
            }
        }
        else
        {
            return("");
        }
    }
예제 #7
0
        public ActionResult WinUserMore_UserAuthorAllRead(string ParentVariable, string sNowUserID)
        {
            //权限选择界面只会出现在用户信息管理中,只有管理员能够进入此界面
            UserInfoManage userMan = new UserInfoManage();

            return(this.Store(userMan.GetAllAuthorStore(sNowUserID)));
        }
예제 #8
0
    private string getDatalist()
    {
        string json         = "";
        string type         = Request.Form["type"];
        string searchString = Request.Form["searchString"];

        if (type == "hospital")
        {
            DataTable dt = OrganizationInfoManage.GetData(searchString);
            if (dt != null)
            {
                json = JsonHelper.DataTableToJsonForEasyUiDataGridLoadDataMethod(dt.Rows.Count, dt).Trim();
            }
        }
        else if (type == "product")
        {
            DataTable dt = ProductInfoManage.GetInfos(GetUserInfo().companyId.ToString(), searchString);
            if (dt != null)
            {
                json = JsonHelper.DataTableToJsonForEasyUiDataGridLoadDataMethod(dt.Rows.Count, dt).Trim();
            }
        }
        else if (type == "sales" || type == "supervisor" || type == "manager" || type == "director")
        {
            DataTable dt = UserInfoManage.getInfos(GetUserInfo().companyId.ToString(), "", searchString);
            dt.Columns["userId"].ColumnName   = "Id";
            dt.Columns["userName"].ColumnName = "name";
            if (dt != null)
            {
                json = JsonHelper.DataTableToJsonForEasyUiDataGridLoadDataMethod(dt.Rows.Count, dt);
            }
        }

        return(json);
    }
예제 #9
0
        public ActionResult WinUserMore_UserAuthorNowRead(string ParentVariable, string sNowUserID)
        {
            UserInfoManage  userMan = new UserInfoManage();
            Paging <object> obj     = userMan.GetNowAuthorStore(sNowUserID);

            return(this.Store(obj));
        }
        // GET: adminMain/MainPage
        public override ActionResult Index()
        {
            UserInfoManage userManage = new UserInfoManage();

            ViewBag.Title = "高校招生数据管理与分析系统";
            string[] key   = { CookieKeys.USERNAME, CookieKeys.USERDUTY };
            string   sName = string.Join("", userManage.GetLoginUserInfo(key));

            ViewData["MainPage_labUserNameText"] = sName;
            var Panel = this.GetCmp <Panel>("Menu");

            switch (AppSettingValues.MENUTYPE)
            {
            case "Default":
                Panel.Width = 150;
                break;

            case "Tree":
                Panel.Width = 180;
                break;

            case "Image":
                Panel.Width = 120;
                break;

            default:
                return(null);
            }
            return(View());
        }
예제 #11
0
        private void bkgWorkForExportingRecords_DoWork(object sender, DoWorkEventArgs e)
        {
            var bkgWorker = sender as BackgroundWorker;

            var counter    = 0;
            var lstOrderNo = new OrderManage().GetAllOrderNoAndPurchaser();


            foreach (var orderInfo in lstOrderNo)
            {
                var objItems     = new ItemManage().GetItemListByOrderNo(orderInfo.Key);
                var objUserInfo  = new UserInfoManage().GetUserByOrderNo(orderInfo.Key);
                var orderContent = ExportFile.GenerateOrderContent(objItems, objUserInfo, true);
                var path         = string.Format((string)e.Argument + @"\{0}{1}.txt", orderInfo.Key, orderInfo.Value);
                ExportFile.CreateOrderFile(path, orderContent);

                try
                {
                    bkgWorker.ReportProgress(counter++);
                }
                catch (NullReferenceException exception)
                {
                    Console.WriteLine(exception);
                    throw;
                }
            }


            MessageBox.Show("Exporting all .txt files sucessfully!");
        }
        public ActionResult MainPage_LoginOutClick()
        {
            UserInfoManage userManage = new UserInfoManage();

            userManage.LoginOut(Response);
            return(RedirectToAction("Index", "Login", new { area = "adminMain" }));
        }
예제 #13
0
    private string destroyDepartPostData()
    {
        string res = "";

        //res = OrganizationInfoManage.DeleteInfo(Request.Form["Id"]);
        res = UserInfoManage.DeleteDepartPost(Request.Form["Id"]);
        return(res);
    }
예제 #14
0
    private string Search(string search)
    {
        string   json = "";
        UserInfo user = (UserInfo)Session["user"];
        DataSet  ds   = UserInfoManage.SearchMembers(user, search);

        json = JsonHelper.DataTableToJsonForEasyUiDataGridLoadDataMethod(ds.Tables[0].Rows.Count, ds.Tables[0]);
        return(json);
    }
예제 #15
0
    private string getSelectedDepartmentId(string wechatUserId)
    {
        string  res = "";
        DataSet ds  = UserInfoManage.GetSelectedTree(wechatUserId);

        if (ds != null)
        {
            res = JsonHelper.DataTableToJsonForEasyUiDataGridLoadDataMethod(ds.Tables[0]);
        }
        return(res);
    }
예제 #16
0
    private void InitTree(DataTable dt)
    {
        tree = new List <TreeNode>();
        int deep = 0;

        do
        {
            DataRow[] rows = dt.Select(string.Format("deep={0}", deep));
            if (rows.Length == 0)
            {
                break;
            }

            foreach (DataRow row in rows)
            {
                TreeNode node = new TreeNode(row);
                if (deep == 0)//插入根节点
                {
                    tree.Add(node);
                }
                else//插入普通节点
                {
                    TreeNode parent = FindNodeById(Convert.ToInt32(row["parentId"].ToString()));
                    if (parent == null)
                    {
                        continue;
                    }
                    parent.children.Add(node);
                }
            }
            deep++;
        } while (true);
        string range = "";

        foreach (TreeNode node in tree)
        {
            if (node.children.Count == 0)
            {
                range += node.id + ",";
            }
        }
        DataSet ds = UserInfoManage.getUserTree(range);

        if (ds != null)
        {
            foreach (DataRow row in ds.Tables[0].Rows)
            {
                TreeNode node   = new TreeNode(row["userName"].ToString(), Convert.ToInt32(row["userId"]));
                TreeNode parent = FindNodeById(Convert.ToInt32(row["departmentId"]));
                parent.children.Add(node);
            }
        }
    }
예제 #17
0
    public DepartmentTreeHelper()
    {
        UserInfo user = (UserInfo)HttpContext.Current.Session["user"];
        DataSet  ds   = UserInfoManage.getTree(user.companyId.ToString());

        if (ds == null || ds.Tables[0].Rows.Count == 0)
        {
            return;
        }
        Dt = ds.Tables[0];
        InitTree(ds.Tables[0]);
    }
예제 #18
0
    private void InitUserTree()
    {
        DataSet        ds   = UserInfoManage.getTree(GetUserInfo().companyId.ToString());
        string         json = "";
        UserTreeHelper users;

        if (ds != null && ds.Tables[0].Rows.Count > 0)
        {
            users = new UserTreeHelper(ds.Tables[0], true);
            json  = users.GetJson();
        }
        Response.Write(json);
    }
예제 #19
0
    private string getInfos()
    {
        string    departId     = Request.Form["departmentId"];
        string    searchString = Request.Form["searchString"];
        string    json         = "";
        DataTable dt           = UserInfoManage.getInfos(GetUserInfo().companyId.ToString(), departId, searchString);

        if (dt != null)
        {
            json = JsonHelper.DataTableToJsonForEasyUiDataGridLoadDataMethod(dt.Rows.Count, dt);
        }
        return(json);
    }
예제 #20
0
        //按卡号\账户名称查询
        private void btnSelect_Click(object sender, EventArgs e)
        {
            string userInfoName = this.txtidno.Text;

            if (string.IsNullOrEmpty(this.txtidno.Text))
            {
                this.dgvUser.DataSource = UserInfoManage.GetAllUserinfos();
            }
            else
            {
                this.dgvUser.DataSource = UserInfoManage.GetSelectUserinfoByIDOrName(userInfoName);
            }
        }
예제 #21
0
    private string getTree()
    {
        DataSet ds = UserInfoManage.getTree(GetUserInfo().companyId.ToString());

        if (ds == null)
        {
            return("F");
        }
        DepartmentTreeHelper tree = new DepartmentTreeHelper(ds.Tables[0]);
        string json = tree.GetJson();

        return(json);
    }
예제 #22
0
    private string AddTree()
    {
        string res = "";
        Dictionary <string, string> dict = new Dictionary <string, string>();

        dict.Add("name", Request.Form["name"]);
        dict.Add("parentId", Request.Form["parentId"]);
        dict.Add("parentName", Request.Form["parentName"]);
        dict.Add("companyId", GetUserInfo().companyId.ToString());
        dict.Add("remark", Request.Form["remark"]);
        res = UserInfoManage.AddTree(dict);
        return(res);
    }
예제 #23
0
    public string GetUserInfo(string wechatUserId, ref UserInfo user)
    {
        string msg = "";

        user = UserInfoManage.GetUserInfo(wechatUserId, ref msg);
        if (user != null)
        {
            return("success");
        }
        else
        {
            return(msg);
        }
    }
예제 #24
0
    private string GetDepartmentPostInfo(ref List <DepartmentPost> departmentPost, UserInfo user)
    {
        string msg = "";

        departmentPost = UserInfoManage.GetDepartmentPostList(user);
        if (departmentPost != null && departmentPost.Count > 0)
        {
            return("success");
        }
        else
        {
            return("");
        }
    }
예제 #25
0
    private string InitUserTree()
    {
        DataSet        ds   = UserInfoManage.getTree(GetUserInfo().companyId.ToString());
        string         json = "";
        UserTreeHelper users;

        if (ds != null && ds.Tables[0].Rows.Count > 0)
        {
            users = new UserTreeHelper(ds.Tables[0]);
            json  = users.GetJson();
        }

        return(json);
    }
예제 #26
0
    private string getMembers()
    {
        string    json = "";
        UserInfo  user = (UserInfo)Session["user"];
        DataTable dt   = UserInfoManage.getInfos(user.companyId.ToString(), "1", Request.Form["searchString"]);

        if (dt != null)
        {
            json = JsonHelper.DataTableToJsonForEasyUiDataGridLoadDataMethod(dt.Rows.Count, dt);
        }
        //DataSet ds = UserInfoManage.GetMembers(user);
        //json = JsonHelper.DataTableToJsonForEasyUiDataGridLoadDataMethod(ds.Tables[0].Rows.Count, ds.Tables[0]);
        return(json);
    }
예제 #27
0
    private string getDepartmentTree()
    {
        UserInfo user = (UserInfo)Session["user"];
        DataSet  ds   = UserInfoManage.getTree(user.companyId.ToString());

        if (ds == null)
        {
            return("F");
        }
        DepartmentTreeHelper tree = new DepartmentTreeHelper(ds.Tables[0]);
        string json = tree.GetJson();

        return(json);
    }
예제 #28
0
    public UserTreeHelper(DataTable dt1)
    {
        DataSet ds = UserInfoManage.GetUserDepartment();

        if (ds == null)
        {
            return;
        }
        DepartmentTreeHelper depart = new DepartmentTreeHelper(dt1);

        tree = depart.GetTree();
        dt   = ds.Tables[0];
        InsertUserIntoTree(tree);
    }
예제 #29
0
        public ActionResult WinUserMore_SaveAuthorsDirectMethod(long lUserID, string sSelAuthors, string sSetAuthors, string sOriginAuthors, string PanelID)
        {
            UserInfoManage userMan = new UserInfoManage();

            if (sSetAuthors == "0")
            {
                userMan.SaveNowAuthor(lUserID, sSelAuthors, sOriginAuthors);
            }
            else
            {
                userMan.SaveNowAuthor(lUserID, sSetAuthors, sOriginAuthors);
            }
            SetHiddenValue(PanelID + "_ExitCode", "1");
            return(this.Direct());
        }
예제 #30
0
    private string EditTree()
    {
        string res = "";
        Dictionary <string, string> dict = new Dictionary <string, string>();

        dict.Add("name", Request.Form["name"]);
        dict.Add("parentId", Request.Form["parentId"]);
        dict.Add("parentName", Request.Form["parentName"]);
        dict.Add("companyId", GetUserInfo().companyId.ToString());
        dict.Add("remark", Request.Form["remark"]);
        dict.Add("departmentId", Request.Form["departmentId"]);
        dict.Add("wechatUserId", Request.Form["leaderWechatUserId"]);
        res = UserInfoManage.EditTree(dict, Request.Form["id"]);
        return(res);
    }