protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (IsPostBack.IsFalse())
         {
             InitializeCombo();
             InitializeSession();
         }
         else
         {
             Page.ClientScript.GetPostBackEventReference(this, String.Empty);
             String eventTarget = Request["__EVENTTARGET"].IsNullOrEmpty() ? String.Empty : Request["__EVENTTARGET"];
             if (Request["__EVENTTARGET"] == "SearchBank")
             {
                 BankMasterList = new CustomList <Gen_Bank>();
                 Gen_Bank searchBank = Session[ASL.STATIC.StaticInfo.SearchSessionVarName] as Gen_Bank;
                 BankMasterList.Add(searchBank);
                 if (searchBank.IsNotNull())
                 {
                     PopulateBankInformation(searchBank);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                CustomList <Gen_Bank> lstBank = BankMasterList;
                if (lstBank.Count == 0)
                {
                    Gen_Bank newBank = new Gen_Bank();
                    lstBank.Add(newBank);
                }
                SetDataFromControlToObj(ref lstBank);
                CustomList <Bank_Branch> lstBankBranch = (CustomList <Bank_Branch>)BankBranchList;

                if (!CheckUserAuthentication(lstBank, lstBankBranch))
                {
                    return;
                }
                manager.SaveBank(ref lstBank, ref lstBankBranch);
                ((PageBase)this.Page).SuccessMessage = (StaticInfo.SavedSuccessfullyMsg);
            }
            catch (SqlException ex)
            {
                ((PageBase)this.Page).ErrorMessage = (ExceptionHelper.getSqlExceptionMessage(ex));
            }
            catch (Exception ex)
            {
                ((PageBase)this.Page).ErrorMessage = (ExceptionHelper.getExceptionMessage(ex));
            }
        }
 private void PopulateBankInformation(Gen_Bank bank)
 {
     try
     {
     }
     catch (Exception ex)
     {
         throw (ex);
     }
 }
Ejemplo n.º 4
0
 private void PopulateBankInformation(Gen_Bank bank)
 {
     try
     {
         txtBankName.Text      = bank.BnakName;
         txtBankSName.Text     = bank.BankSName;
         txtAddress.Text       = bank.Address;
         txtContactPerson.Text = bank.ContactPerson;
         BankBranchList        = manager.GetAllBank_Branch(bank.BankKey);
     }
     catch (Exception ex)
     {
         throw (ex);
     }
 }
Ejemplo n.º 5
0
 private void SetDataFromControlToObj(ref CustomList <Gen_Bank> lstBank)
 {
     try
     {
         Gen_Bank obj = lstBank[0];
         obj.BnakName      = txtBankName.Text;
         obj.BankSName     = txtBankSName.Text;
         obj.Address       = txtAddress.Text;
         obj.ContactPerson = txtContactPerson.Text;
         //if (obj.ShiftID != 0) obj.SetModified();
     }
     catch (Exception ex)
     {
         throw (ex);
     }
 }
Ejemplo n.º 6
0
 public CustomList <Gen_Bank> GetAllGen_Bank()
 {
     return(Gen_Bank.GetAllGen_Bank());
 }