Пример #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (this.Request.QueryString["command"] == "delete")
     {
         var accountPeriodRepository = new AccountPeriodRepository();
         var accountPeriodIdString = this.Request.QueryString["accountPeriodId"];
         int accountPeriodId;
         if (int.TryParse(accountPeriodIdString, out accountPeriodId))
         {
             accountPeriodRepository.RemoveAccountPeriod(accountPeriodId);
             Response.Redirect(Globals.NavigateURL(this.TabId));
         }
     }
 }
Пример #2
0
        private void SearchUsername()
        {
            var username = txtUsername.Text;
            if (string.IsNullOrEmpty(username))
            {
                radGridAccountPeriod.DataSource = this.GetDataSource();
            }
            else
            {
                var userInfo = UserController.GetUserByName(0, username);
                if (userInfo == null)
                {
                    radGridAccountPeriod.DataSource = Enumerable.Empty<AccountPeriod>();
                }
                else
                {
                    var acountPeriodRepository = new AccountPeriodRepository();
                    var accountPeriods = acountPeriodRepository.GetByUserId(userInfo.UserID);

                    radGridAccountPeriod.DataSource = accountPeriods;
                }
            }

            radGridAccountPeriod.DataBind();
        }
Пример #3
0
 private IEnumerable<AccountPeriod> GetDataSource()
 {
     var acountPeriodRepository = new AccountPeriodRepository();
     return acountPeriodRepository.GetAll();
 }