Esempio n. 1
0
        protected void dgItemAccount_DeleteCommand(object source, DataGridCommandEventArgs e)
        {
            int id = (int)dgItemAccount.DataKeys[e.Item.ItemIndex];

            ChurchERP.CoreDomain.Setting.ItemAccount ItemAccount = _presenter.GetItemAccountById(id);
            try
            {
                ItemAccount.Status = "InActive";
                _presenter.SaveOrUpdateItemAccount(ItemAccount);
                BindItemAccount();

                Master.ShowMessage(new AppMessage("Item Account was Removed Successfully", ChurchERP.Enums.RMessageType.Info));
            }
            catch (Exception ex)
            {
                Master.ShowMessage(new AppMessage("Error: Unable to delete Item Account. " + ex.Message, ChurchERP.Enums.RMessageType.Error));
            }
        }
Esempio n. 2
0
        protected void dgItemAccount_UpdateCommand(object source, DataGridCommandEventArgs e)
        {
            int id = (int)dgItemAccount.DataKeys[e.Item.ItemIndex];

            ChurchERP.CoreDomain.Setting.ItemAccount ItemAccount = _presenter.GetItemAccountById(id);

            try
            {
                TextBox txtName = e.Item.FindControl("txtItemAccountName") as TextBox;
                ItemAccount.AccountName = txtName.Text;
                TextBox txtCode = e.Item.FindControl("txtItemAccountCode") as TextBox;
                ItemAccount.AccountCode = txtCode.Text;
                SaveItemAccount(ItemAccount);
                dgItemAccount.EditItemIndex = -1;
                BindItemAccount();
            }
            catch (Exception ex)
            {
                Master.ShowMessage(new AppMessage("Error: Unable to Update Item Account. " + ex.Message, ChurchERP.Enums.RMessageType.Error));
            }
        }
Esempio n. 3
0
 private void SaveItemAccount(ChurchERP.CoreDomain.Setting.ItemAccount ItemAccount)
 {
     try
     {
         if (ItemAccount.Id <= 0)
         {
             _presenter.SaveOrUpdateItemAccount(ItemAccount);
             Master.ShowMessage(new AppMessage("Item Account saved", RMessageType.Info));
             //_presenter.CancelPage();
         }
         else
         {
             _presenter.SaveOrUpdateItemAccount(ItemAccount);
             Master.ShowMessage(new AppMessage("Item Account Updated", RMessageType.Info));
             // _presenter.CancelPage();
         }
     }
     catch (Exception ex)
     {
         Master.ShowMessage(new AppMessage(ex.Message, RMessageType.Error));
     }
 }
Esempio n. 4
0
        protected void dgItemAccount_ItemCommand(object source, DataGridCommandEventArgs e)
        {
            ChurchERP.CoreDomain.Setting.ItemAccount ItemAccount = new ChurchERP.CoreDomain.Setting.ItemAccount();
            if (e.CommandName == "AddNew")
            {
                try
                {
                    TextBox txtFItemAccountName = e.Item.FindControl("txtFItemAccountName") as TextBox;
                    ItemAccount.AccountName = txtFItemAccountName.Text;
                    TextBox txtFItemAccountCode = e.Item.FindControl("txtFItemAccountCode") as TextBox;
                    ItemAccount.AccountCode = txtFItemAccountCode.Text;
                    ItemAccount.Status      = "Active";

                    SaveItemAccount(ItemAccount);
                    dgItemAccount.EditItemIndex = -1;
                    BindItemAccount();
                }
                catch (Exception ex)
                {
                    Master.ShowMessage(new AppMessage("Error: Unable to Add Item Account " + ex.Message, ChurchERP.Enums.RMessageType.Error));
                }
            }
        }