示例#1
0
 protected void btnRefresh_Click(object sender, EventArgs e)
 {
     RadGridDepositList.Rebind();
 }
示例#2
0
        protected void DepositInfoToolbar_ButtonClick(object sender, RadToolBarEventArgs e)
        {
            if (e.Item.Text == "Confirm" && RadGridDepositList.SelectedValue != null)
            {
                var cDeposit = new CDeposit();
                var deposit  = cDeposit.Get(Convert.ToInt32(RadGridDepositList.SelectedValue.ToString()));

                // HQ
                if (CurrentGroupId == (int)CConstValue.UserGroupForDepositConfirm.Accounting)
                {
                    deposit.Comment     = DepositInfomation1.GetComment();
                    deposit.Bank        = DepositInfomation1.GetBank();
                    deposit.DepositDate = DepositInfomation1.GetDepositDate();

                    deposit.Status          = 3; // 1:Pending 2:Created, 3:Confirm, 0:Confirm Canceled
                    deposit.HQConfirmUserId = CurrentUserId;
                    deposit.HQConfirmDate   = DateTime.Now;

                    if (cDeposit.Update(deposit))
                    {
                        var cCreaditMemo = new CCreditMemo();
                        cCreaditMemo.ValidateOverPaid(deposit.DepositId, CurrentUserId);

                        RadGridDepositList.Rebind();
                    }
                }
                //schools
                else
                {
                    deposit.Comment     = DepositInfomation1.GetComment();
                    deposit.Bank        = DepositInfomation1.GetBank();
                    deposit.DepositDate = DepositInfomation1.GetDepositDate();

                    deposit.Status = 2; // 1:Pending, 2:Created, 3:Confirm, 0:Confirm Canceled

                    if (cDeposit.Update(deposit))
                    {
                        RadGridDepositList.Rebind();
                    }
                }
            }
            else if (e.Item.Text == "Cancel" && RadGridDepositList.SelectedValue != null)
            {
                var cDeposit = new CDeposit();
                var deposit  = cDeposit.Get(Convert.ToInt32(RadGridDepositList.SelectedValue.ToString()));

                deposit.Comment     = DepositInfomation1.GetComment();
                deposit.Bank        = DepositInfomation1.GetBank();
                deposit.DepositDate = DepositInfomation1.GetDepositDate();

                if (CurrentGroupId == (int)CConstValue.UserGroupForDepositConfirm.Accounting) // HQ
                {
                    deposit.Status = 1;                                                       // 1:Pending, 2:Created, 3:Confirm, 0:Confirm Canceled
                }
                else
                {
                    deposit.Status = 0; // 1:Pending, 2:Created, 3:Confirm, 0:Confirm Canceled
                }
                if (cDeposit.Update(deposit))
                {
                    RadGridDepositList.Rebind();
                }
            }
            else if (e.Item.Text == "Modify Deposit")
            {
                if (RadGridDepositList.SelectedValue != null)
                {
                    RunClientScript("ShowPop('" + RadGridDepositList.SelectedValue + "', '1');");
                }
            }
            else if (e.Item.Text == "Add Deposit")
            {
                RunClientScript("ShowPop('0', '0');");
            }
        }