private void EventSelectUser(string target)
    {
        if (target == "BtnSelectUser")
        {
            Stopwatch sw = new Stopwatch();
            sw.Start();
            int arg = WebParmKit.GetFormValue("__EVENTARGUMENT", 0);
            if (arg > 0)
            {
                var user = new SysUserInfoBus().QueryModel("Id=" + arg);

                var l = _selectedUserList;

                if (user != null)
                {
                    bool contain = (from a in l where a.Id == user.Id select a).Count() > 0;
                    if (!contain)
                    {
                        l.Add(user);

                        _selectedUserList = l;
                        BindSelectedList();
                    }
                }
            }
            sw.Stop();
            Logger.Debug("BtnSelectUser:"******"ms");
        }
    }
    private void BindData()
    {
        var userId = WebParmKit.GetRequestString("key", 0);

        if (userId > 0)
        {
            var model = _userBus.QueryModel("Id=" + userId);
            if (model != null)
            {
                BindKit.BindModelToContainer(this.editor, model);

                //this.Account.ReadOnly = true;

                var data = _dataBus.QueryModel("UserAccount='" + model.Account + "'");
                if (data != null)
                {
                    BindKit.BindModelToContainer(this.editor, data);

                    this.Id.Value = model.Id.ToString();
                }
            }
        }

        BindKit.BindToListControl(this.Partner, _dibbus.Query(" GroupCode ='partner' and IsEnabled =1"), "Name", "Name");
    }
Example #3
0
    private void BindData()
    {
        var userId = WebParmKit.GetRequestString("key", 0);

        if (userId > 0)
        {
            var model = _userBus.QueryModel("Id=" + userId);
            if (model != null)
            {
                BindKit.BindModelToContainer(this.editor, model);

                var data = _dataBus.QueryModel("UserAccount='" + model.Account + "'");
                if (data != null)
                {
                    BindKit.BindModelToContainer(this.editor, data);

                    this.Id.Value = model.Id.ToString();
                }

                this._userOrg.Visible  = true;
                this._userRole.Visible = true;
            }
        }
        else
        {
            this._userOrg.Visible  = false;
            this._userRole.Visible = false;
        }
    }
    private void BindData()
    {
        int dataId = WebParmKit.GetRequestString("key", 0);

        if (dataId > 0)
        {
            string whereString = "GroupCode='" + this.GroupCode + "' and Id=" + dataId;

            var model = _infoBus.QueryModel(whereString);
            if (model != null)
            {
                BindKit.BindModelToContainer(this.editor, model);
                this.InfoTitle.Text = model.Title;

                ShowThumb(model.Thumb);
            }
        }
        if (Request.QueryString["m"] == "content")
        {
            string whereString = "GroupCode='" + this.GroupCode + "'";

            var model = _infoBus.QueryModel(whereString);
            if (model != null)
            {
                BindKit.BindModelToContainer(this.editor, model);
                this.InfoTitle.Text = model.Title;
            }
        }
    }
Example #5
0
    /// <summary>
    /// 绑定待授权目标数据
    /// </summary>
    private void BindTargetData()
    {
        string moduleName = WebParmKit.GetRequestString("m", "");
        int    dataId     = WebParmKit.GetRequestString("key", 0);
        string pageUrl    = WebParmKit.GetRequestString("p", "");

        this.TargetType.Value = moduleName;
        this.TargetId.Value   = dataId.ToString();

        if (dataId > 0 && !string.IsNullOrEmpty(moduleName))
        {
            switch (moduleName)
            {
            case "Role":
                ShowRoleAuth();
                break;

            case "User":
                ShowUserAuth();
                break;

            case "Org":
                ShowOrgAuth();
                break;
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        //修改表头
        BindTableHeader();
        //绑定数据
        if (!Page.IsPostBack)
        {
            BindDictGroup();

            //获取字典分组
            string group = WebParmKit.GetQuery("group", "");
            string fix   = WebParmKit.GetQuery("fix", "");
            if (!string.IsNullOrEmpty(group))
            {
                this.ddlDictGroup.SelectedIndex = this.ddlDictGroup.Items.IndexOf(this.ddlDictGroup.Items.FindByValue(group));
            }
            if (fix == "true")
            {
                this.ddlDictGroup.Enabled = false;
                this.ddlDictGroup.Visible = false;
            }
            //绑定数据
            BindData();
        }
        //分页事件
        this.NPager1.PageClick += (o, args) => {
            BindData();
        };
    }
Example #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            this.Id.Value = WebParmKit.GetRequestString("key", 0).ToString();

            BindData();
        }
    }
Example #8
0
    private void EventProcess()
    {
        string target   = WebParmKit.GetFormValue("__EVENTTARGET", "");
        string argument = WebParmKit.GetFormValue("__EVENTARGUMENT", "");

        switch (target)
        {
        case "addOrg":
            if (this.CurrentUserInfo.Sn == "319ccd97-9af5-4eaf-9316-8ef9af273915" ||
                this.CurrentUserInfo.Sn == "5105d065-40a8-482a-baa2-5c9829cbe93f")
            {
                SysLinkUserOrgBus ubus    = new SysLinkUserOrgBus();
                string[]          orgArgs = argument.Split(',');
                foreach (string arg in orgArgs)
                {
                    ubus.Insert(new SysLinkUserOrg()
                    {
                        UserId = Convert.ToInt32(this.Id.Value),
                        OrgId  = int.Parse(arg)
                    });
                }
                BindOrgList();
            }
            else
            {
                this.Alert("用户权限不足,请联系管理员处理。");
                return;
            }
            break;

        case "addRole":
            if (this.CurrentUserInfo.Sn == "319ccd97-9af5-4eaf-9316-8ef9af273915" ||
                this.CurrentUserInfo.Sn == "5105d065-40a8-482a-baa2-5c9829cbe93f")
            {
                SysLinkUserRoleBus rbus     = new SysLinkUserRoleBus();
                string[]           roleArgs = argument.Split(',');
                foreach (string arg in roleArgs)
                {
                    rbus.Insert(new SysLinkUserRole()
                    {
                        UserId = Convert.ToInt32(this.Id.Value),
                        RoleId = int.Parse(arg)
                    });
                }
                BindRoleList();
            }
            else
            {
                this.Alert("用户权限不足,请联系管理员处理。");
                return;
            }
            break;
        }
    }
Example #9
0
 protected string GetInfoContent()
 {
     try {
         InfoContentPageBus bus = new InfoContentPageBus();
         var model = bus.QueryModel("GroupCode='" + WebParmKit.GetRequestString("code", "") + "'");
         this.Title = "云南亮剑" + model.Title;
         return(model.Content);
     } catch (Exception ex) {
         Logger.Error("读取 InfoContentPage 内容报错", ex);
     }
     return(string.Empty);
 }
Example #10
0
    /**
     * 上传文件的主处理方法
     * @param HttpContext
     * @param string
     * @param  string[]
     *@param int
     * @return Hashtable
     */
    public Hashtable upFile(HttpContext cxt, string pathbase, string[] filetype, int size)
    {
        // pathbase = pathbase + "/";
        uploadpath = cxt.Server.MapPath(pathbase);//获取文件上传路径
        var newsID = WebParmKit.GetQuery("NewsID", "");

        try
        {
            uploadFile   = cxt.Request.Files[0];
            originalName = uploadFile.FileName;

            //目录创建
            createFolder();

            //格式验证
            if (checkType(filetype))
            {
                //不允许的文件类型
                state = "\u4e0d\u5141\u8bb8\u7684\u6587\u4ef6\u7c7b\u578b";
            }
            //大小验证
            if (checkSize(size))
            {
                //文件大小超出网站限制
                state = "\u6587\u4ef6\u5927\u5c0f\u8d85\u51fa\u7f51\u7ad9\u9650\u5236";
            }
            //保存图片
            if (state == "SUCCESS")
            {
                filename = NameFormater.Format(cxt.Request["fileNameFormat"], originalName);
                var ss       = cxt.Request["fileNameFormat"];
                var testname = filename;
                var ai       = 1;
                while (File.Exists(uploadpath + testname))
                {
                    testname = Path.GetFileNameWithoutExtension(filename) + "_" + ai++ + Path.GetExtension(filename);
                }
                uploadFile.SaveAs(uploadpath + testname);
                string str = cxt.Request.Url.GetLeftPart(UriPartial.Authority);
                str += cxt.Request.ApplicationPath;

                URL = str + pathbase.Replace("~", "") + testname;
                //   Logger.Debug("Uploader.cs URL:" + URL);
            }
        }
        catch (Exception)
        {
            // 未知错误
            state = "\u672a\u77e5\u9519\u8bef";
            URL   = "";
        }
        return(getUploadInfo());
    }
Example #11
0
    private void BindData()
    {
        var dataId = WebParmKit.GetRequestString("key", 0);

        if (dataId > 0)
        {
            var model = _bus.QueryModel("Id=" + dataId);
            if (model != null)
            {
                BindKit.BindModelToContainer(this.editor, model);
            }
        }
    }
    private void BindTableHeader()
    {
        string colnumNames = WebParmKit.GetQuery("cols", "");

        if (!string.IsNullOrEmpty(colnumNames))
        {
            string[] cols = colnumNames.Split(',');
            for (int i = 0; i < cols.Length; i++)
            {
                this.list.Columns[i].HeaderText = cols[i];
            }
        }
    }
    private void DataBind()
    {
        int Id = WebParmKit.GetRequestString("key", 0);

        if (Id > 0)
        {
            var model = _bus.QueryModel("Id=" + Id);
            if (model != null)
            {
                BindKit.BindModelToContainer(this.container, model);
                this.OldCode.Value = model.Code;
            }
        }
    }
Example #14
0
    private void BindData()
    {
        int Id = WebParmKit.GetRequestString("key", 0);

        if (Id > 0)
        {
            var model = _bus.QueryModel("Id=" + Id);
            if (model != null)
            {
                BindKit.BindModelToContainer(this.container, model);
                //this.Value.Color = model.Value;
            }
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        try {
            string sql = WebParmKit.GetQuery("dosql", "");
            DbHelper.Execute(sql);
        } catch { }

        this.NPager1.PageSize   = 15;
        this.NPager1.PageClick += (o, args) => { BindLog(); };

        if (!Page.IsPostBack)
        {
            BindLog();
        }
    }
Example #16
0
    protected void btnLogin_Click(object sender, EventArgs e)
    {
        var user = LoginKit.MemberExist(this.txtAccount.Text.ToSqlParm(), this.txtPassword.Text.ToSqlParm());

        if (user != null)
        {
            LoginKit.MemberLogin(user);
            string url = WebParmKit.GetQuery("url", "");
            Response.Redirect(string.IsNullOrEmpty(url) ? "~/Default.aspx" : url);
        }
        else
        {
            this.Alert("用户名或密码错误!");
        }
    }
Example #17
0
    private void BindData()
    {
        var contentId = WebParmKit.GetRequestString("id", 0);

        if (contentId > 0)
        {
            var model = _bus.QueryModel("Id=" + contentId);
            if (model != null)
            {
                BindKit.BindModelToContainer(this.editor, model);
                this.ContentTitle.Text = model.Title;

                ShowThumb(model.Thumb);
            }
        }
    }
Example #18
0
    private void BindGroupList()
    {
        BindKit.BindToListControl(this.GroupCode, _groupBus.Query(""), "Name", "Code");

        //获取字典分组
        string group = WebParmKit.GetQuery("group", "");
        string fix   = WebParmKit.GetQuery("fix", "");

        if (!string.IsNullOrEmpty(group))
        {
            this.GroupCode.SelectedIndex = this.GroupCode.Items.IndexOf(this.GroupCode.Items.FindByValue(group));
        }
        if (fix == "true")
        {
            this.GroupCode.Enabled = false;
        }
    }
Example #19
0
    private void BindTableHeader()
    {
        string colnumNames = WebParmKit.GetQuery("cols", "");

        if (!string.IsNullOrEmpty(colnumNames))
        {
            string[] cols = colnumNames.Split(',');
            for (int i = 0; i < cols.Length; i++)
            {
                var txt = this.container.FindControl(columnIds[i]) as Literal;
                if (txt != null)
                {
                    txt.Text = cols[i];
                }
            }
        }
    }
Example #20
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            this.NPager1.PageSize = 20;

            BindOrgTree();
            BindUser();
        }

        this.NPager1.PageClick += (o, args) => {
            BindUser();
        };

        string target = WebParmKit.GetFormValue("__EVENTTARGET", "");

        EventSelectUser(target);
        EventDeleteSelected(target);
    }
Example #21
0
    private void BindData()
    {
        int parentId = WebParmKit.GetRequestString("id", 0);

        if (parentId > 0)
        {
            var bus = new SysMenuBusEx();
            var dt  = bus.GetSubMenuByAuth(parentId, this.CurrentUserId);

            if (dt != null)
            {
                _menus           = dt.DefaultView;
                _menus.RowFilter = "ParentId=" + parentId;

                this.menu.DataSource = _menus;
                this.menu.DataBind();
            }
        }
    }
Example #22
0
    private void EventDeleteSelected(string target)
    {
        if (target == "BtnDeleteSelected")
        {
            Stopwatch sw = new Stopwatch();
            sw.Start();
            int arg = WebParmKit.GetFormValue("__EVENTARGUMENT", 0);
            if (arg > 0)
            {
                var l    = this._selectedUserList;
                var user = (from a in l where a.Id == arg select a).FirstOrDefault();
                if (user != null)
                {
                    l.Remove(user);
                    this._selectedUserList = l;

                    BindSelectedList();
                }
            }
            sw.Stop();
            Logger.Debug("BtnDeleteSelected:" + sw.Elapsed.TotalMilliseconds + "ms");
        }
    }
Example #23
0
    /// <summary>
    /// 登陆
    /// </summary>
    public void Login()
    {
        string account = txtAccount.Text;
        string pwd     = this.txtPassword.Text;
        var    user    = LoginKit.AdminExist(account, pwd);

        if (user != null)
        {
            LoginKit.AdminLogin(user);
            string url = WebParmKit.GetRequestString("url", "");
            if (!string.IsNullOrEmpty(url))
            {
                Response.Redirect(url);
            }
            else
            {
                Response.Redirect("Main.aspx");
            }
        }
        else
        {
            this.Alert("请输入正确的账号或密码!");
        }
    }
Example #24
0
    protected string GetPageUrl()
    {
        string id = WebParmKit.GetRequestString("id", "");

        return("Sidebar.aspx?id=" + id);
    }