Exemplo n.º 1
0
        void BindData()
        {
            List <ViewItem>   items = new List <ViewItem>();
            List <Department> dts   = null;
            List <Account>    acts  = null;


            AccountQuery aq = new AccountQuery();

            aq.KeyWord  = Keyword;
            aq.SiteID   = SiteID;
            aq.UserType = (int)CurrentState;

            UPager.PageIndex  = PageNumber;
            UPager.ItemCount  = AccountHelper.QueryAccountCountByQuery(aq);
            UPager.UrlFormat  = We7Helper.AddParamToUrl(Request.RawUrl, Keys.QRYSTR_PAGEINDEX, "{0}");
            UPager.PrefixText = "共 " + UPager.MaxPages + "  页 ·   第 " + UPager.PageIndex + "  页 · ";

            acts = AccountHelper.QueryAccountsByQuery(aq, UPager.Begin - 1, UPager.Count,
                                                      new string[] { "ID", "LoginName", "Email", "CreatedNoteTime", "EmailValidate", "ModelState", "ModelName", "State", "Created", "UserType", "Department" });


            if (acts != null)
            {
                foreach (Account act in acts)
                {
                    ViewItem vi = new ViewItem();
                    vi.Text      = "<b>" + act.LoginName + "</b> " + act.LastName + "";
                    vi.Summary   = act.Department;
                    vi.Mode      = "User";
                    vi.State     = act.TypeText;
                    vi.Url       = String.Format("AccountEdit.aspx?id={0}", act.ID);
                    vi.DeleteUrl = String.Format("javascript:DeleteConfirm('{0}','{1}','Account');", act.ID, act.LoginName);
                    vi.EditUrl   = String.Format("AccountEdit.aspx?id={0}", act.ID);
                    string mng = @"<a href=""AccountEdit.aspx?id={0}&tab=2"">
                            角色设置</a> 
                        <a href=""AccountEdit.aspx?id={0}&tab=6"">
                            模块权限</a>    ";
                    vi.ManageLinks  = string.Format(mng, act.ID);
                    vi.ID           = act.ID;
                    vi.RegisterDate = act.Created.ToLongDateString();
                    if (DepartmentID != We7Helper.EmptyGUID)
                    {
                        if (act.DepartmentID == DepartmentID)
                        {
                            items.Add(vi);
                        }
                    }
                    else
                    {
                        if (act.DepartmentID == We7Helper.EmptyGUID)
                        {
                            items.Add(vi);
                        }
                    }
                }
            }
            AccountsGridView.DataSource = items;
            AccountsGridView.DataBind();
        }
Exemplo n.º 2
0
        protected void FillAccountsList()
        {
            AggregationCategorizationService svc = Services.AggCatService.GetService(Cache, HttpContext.Current.User.Identity.Name);
            AccountList accounts = svc.GetCustomerAccounts();

            AccountsGridView.DataSource = accounts.AnyIntuitObjects;
            AccountsGridView.DataBind();
        }
 protected void AccountsGridView_PageIndexChanging(object sender, GridViewPageEventArgs e)
 {
     try
     {
         ShowTransactions(StartDate.Text, EndDate.Text);
         AccountsGridView.PageIndex = e.NewPageIndex;
         AccountsGridView.DataBind();
     }
     catch (Exception ex)
     {
         Master.ErrorMessage = "Error occurred while retrieving transactions: " + ex.Message;
     }
 }
Exemplo n.º 4
0
        private void EditAccBtn_Click(object sender, EventArgs e)
        {
            dynamic det_item = AccountsGridView.GetFocusedRow();

            if (det_item == null)
            {
                return;
            }

            xtraTabControl1.SelectedTabPageIndex = 9;
            KAgentAccountBS.DataSource           = _db.KAgentAccount.Find(det_item.AccId);

            DirTreeList.FocusedNode = DirTreeList.FindNodeByFieldValue("DataSetId", det_item.AccId);
        }
 protected void ShowTransactions(String startDate, String endDate)
 {
     try
     {
         AggregationCategorizationService svc = Services.AggCatService.GetService(Cache, HttpContext.Current.User.Identity.Name);
         TransactionList transactionList      = svc.GetAccountTransactions(long.Parse(Request.QueryString["Account"]),
                                                                           Convert.ToDateTime(startDate), Convert.ToDateTime(endDate));
         AccountsGridView.DataSource = transactionList.AnyIntuitObjects;
         AccountsGridView.DataBind();
     }
     catch (Exception ex)
     {
         Master.ErrorMessage = "Error occurred while calling GetAccountTransactions: " + ex.Message;
     }
 }
Exemplo n.º 6
0
        private void DelAccBtn_Click(object sender, EventArgs e)
        {
            dynamic det_item = AccountsGridView.GetFocusedRow();

            if (det_item == null)
            {
                return;
            }

            var a = _db.KAgentAccount.Find(det_item.AccId);

            _db.KAgentAccount.Remove(a);
            _db.SaveChanges();

            GetAccounts();
        }
Exemplo n.º 7
0
        protected void BindData()
        {
            List <Account> list = new List <Account>();
            AccountQuery   aq   = new AccountQuery();

            aq.KeyWord  = keywords;
            aq.SiteID   = SiteID;
            aq.UserType = (int)OwnerRank.Normal;

            switch (CurrentState)
            {
            case QueryType.ALL:
                break;

            case QueryType.WaitExamin:
                aq.ModelState = 0;
                break;

            case QueryType.Passed:
                aq.ModelState = 1;
                break;

            case QueryType.WaitValidate:
                aq.EmailValidate = 0;
                break;
            }

            UPager.PageIndex  = PageNumber;
            UPager.ItemCount  = AccountHelper.QueryAccountCountByQuery(aq);
            UPager.UrlFormat  = We7Helper.AddParamToUrl(Request.RawUrl, Keys.QRYSTR_PAGEINDEX, "{0}");
            UPager.PrefixText = "共 " + UPager.MaxPages + "  页 ·   第 " + UPager.PageIndex + "  页 · ";

            list = AccountHelper.QueryAccountsByQuery(aq, UPager.Begin - 1, UPager.Count,
                                                      new string[] { "ID", "LoginName", "Email", "CreatedNoteTime", "EmailValidate", "ModelState", "ModelName", "State", "Created", "UserType", "Department" });

            AccountsGridView.DataSource = list;
            AccountsGridView.DataBind();
        }