Пример #1
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Do you want to Save Creent Record ", "Confirmation", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
     {
         AccountType.AccountCreationDataType _Savedata = new AccountType.AccountCreationDataType();
         string respond = SetDataToCLass(out _Savedata);
         if (!MyAccount.ExistAccountCreation(_Savedata.AccountID))
         {
             if (respond == "True")
             {
                 respond = MyAccount.SaveAccountCreation(_Savedata);
                 if (respond == "True")
                 {
                     MessageBox.Show("Record Saved Successfully", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information);
                     LoadExistingAccount();
                     LoadExtAccountInHiaraky();
                     InitializeScreen();
                 }
                 else
                 {
                     MessageBox.Show(respond, "E r r o r", MessageBoxButtons.OK, MessageBoxIcon.Stop);
                 }
             }
             else
             {
                 MessageBox.Show(respond, "E r r o r", MessageBoxButtons.OK, MessageBoxIcon.Stop);
             }
         }
         else
         {
             MessageBox.Show("Account Number Already in the System, Use Update Button to change delatails", "E r r o r", MessageBoxButtons.OK, MessageBoxIcon.Stop);
         }
     }
 }
Пример #2
0
 private void btnCreate_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("Do you want to Create ?", "Create New Ledgers", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
     {
         progressBar1.Value = 0; progressBar1.Maximum = dgvList.Rows.Count;
         foreach (DataGridViewRow r in dgvList.Rows)
         {
             if (r.Cells["dgv_Select"].Value == "1")
             {
                 AccountType.AccountCreationDataType _Savedata = new AccountType.AccountCreationDataType();
                 string respond = "";
                 respond = SetDataToClass(r, out _Savedata);
                 if (respond == "True")
                 {
                     if (!Myaccount.ExistAccountCreation(_Savedata.AccountID))
                     {
                         respond = Myaccount.SaveAccountCreation(_Savedata);
                     }
                     if (respond != "True")
                     {
                         Program.VerningMessage(respond);
                     }
                 }
             }
             progressBar1.Value = r.Index + 1;
         }
         Program.InformationMessage("Account Saved Successfully");
         progressBar1.Value = 0;
     }
 }