예제 #1
0
 private void InsertOrUpdate(Model.Bank bank, Utility.CRUD cru, Model.BrankBank branch = null)
 {
     if (bank != null && branch == null)
     {
         if (cru == CRUD.Insert)
         {
             gridUtility1.AddNewRow(bank);
         }
         if (cru == CRUD.Update)
         {
             gridUtility1.UpdateRow(bank);
         }
     }
     if (branch != null && bank != null)
     {
         if (cru == CRUD.Insert)
         {
             gridUtility2.AddNewRow(branch);
         }
         if (cru == CRUD.Update)
         {
             gridUtility2.UpdateRow(branch);
         }
     }
 }
예제 #2
0
 private void Insert(Model.Bank bank, Utility.CRUD cru, Model.BrankBank branch = null)
 {
     if (insert != null)
     {
         insert(bank, cru, branch);
     }
 }
예제 #3
0
 private void InsertOrUpdate(Model.CurrencyUnit cu, Utility.CRUD cru)
 {
     if (cru == Utility.CRUD.Insert)
     {
         utility.AddNewRow(cu);
     }
     else
     {
         utility.UpdateRow(cu);
     }
     gridView4.RefreshData();
 }
예제 #4
0
 private void InsertOrUpdate(Model.Bank bank, Utility.CRUD cru, Model.BrankBank branch = null)
 {
     if (cru == CRUD.Insert)
     {
         //add parent node BANK
         if (bank != null && branch == null)
         {
             object       obj  = createObject(bank);
             TreeListNode node = treeList1.AppendNode(obj, treeList1.AllNodesCount);
             node.Tag = "Parent";
         }
         //add child node BRANCH
         if (branch != null && bank != null)
         {
             object obj2 = createObject(null, branch);
             //Find parent node
             TreeListNode node = treeList1.AppendNode(obj2, findBankNode(bank.BankId.ToString()));
             node.Tag = "Child";
         }
     }
     if (cru == CRUD.Update)
     {
         //update parent node BANK
         if (bank != null && branch == null)
         {
             TreeListNode node = treeList1.Selection[0];
             node.SetValue("BankCode", bank.BankCode);
             node.SetValue("BankName", bank.BankName);
             node.SetValue("Phone", bank.Phone);
             node.SetValue("Fax", bank.Fax);
             node.SetValue("Email", bank.Email);
             node.SetValue("Address", bank.Address);
             node.SetValue("Note", bank.Note);
             node.SetValue("ModifyDate", bank.ModifyDate);
             node.SetValue("ModifyBy", bank.ModifyBy);
         }
         //update child node BRANCH
         if (branch != null && bank != null)
         {
             TreeListNode node = treeList1.Selection[0];
             node.SetValue("BankName", branch.BrankName);
             node.SetValue("Phone", branch.Phone);
             node.SetValue("Address", branch.BrankAddress);
             node.SetValue("Note", branch.Note);
             node.SetValue("ModifyDate", branch.ModifyDate);
             node.SetValue("ModifyBy", branch.ModifyBy);
         }
     }
 }