Ejemplo n.º 1
0
 private void deleteBank()
 {
     if (this.dvBanks.Count > 0)
     {
         BindingManagerBase bm = (BindingManagerBase)this.BindingContext[this.dvBanks];
         BPS.BLL.Bank.DataSets.dsBanks.BanksRow rw = (BPS.BLL.Bank.DataSets.dsBanks.BanksRow)((DataRowView)bm.Current).Row;
         if (MsgBoxX.Show("Вы действительно хотите удалить банк " + rw.BankName + "?", "BPS", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
         {
             ((DataRowView)bm.Current).Delete();
             bllBank.Update();
         }
     }
 }
Ejemplo n.º 2
0
        public EditBank(BPS.BLL.Bank.DataSets.dsBanks.BanksRow rw, BPS.BLL.City.coCities bll)
        {
            drowBank = rw;
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            bllCity = bll;

            this.dsCities1      = bllCity.DataSet;
            this.dvCities.Table = this.dsCities1.Cities;
            this.dvCities.Sort  = "CityName";
        }
Ejemplo n.º 3
0
        public static bool AddBankDialog(BPS.BLL.Bank.coBanks bll, BPS.BLL.City.coCities bllC)
        {
            BPS.BLL.Bank.DataSets.dsBanks.BanksRow rw = bll.DataSet.Banks.NewBanksRow();
            EditBank eb = new EditBank(rw, bllC);

            eb.ShowDialog();
            if (eb.DialogResult == DialogResult.OK)
            {
                bll.DataSet.Banks.AddBanksRow(rw);
                bll.Update();
                return(true);
            }
            return(false);
        }
Ejemplo n.º 4
0
 private void editBank()
 {
     if (!this.toolBarButton2.Enabled)
     {
         return;
     }
     if (this.dvBanks.Count > 0)
     {
         BindingManagerBase bm = (BindingManagerBase)this.BindingContext[this.dvBanks];
         BPS.BLL.Bank.DataSets.dsBanks.BanksRow rw = (BPS.BLL.Bank.DataSets.dsBanks.BanksRow)((DataRowView)bm.Current).Row;
         EditBank eb = new EditBank(rw, this.bllCity);
         eb.ShowDialog();
         if (eb.DialogResult == DialogResult.OK)
         {
             bllBank.Update();
         }
     }
 }
Ejemplo n.º 5
0
        private void selectBank(bool isNew)
        {
            if (isNew)
            {
                BPS.BLL.Bank.DataSets.dsBanks.BanksRow rw = this.bllBank.DataSet.Banks.NewBanksRow();
                rw.BankName = this.rwReq.BankName;
                rw.CodeBIK  = this.rwReq.CodeBIK;
                BPS.Forms.Bank.EditBank eb = new BPS.Forms.Bank.EditBank(rw, this.bllCity);

                eb.ShowDialog();
                if (eb.DialogResult == DialogResult.OK)
                {
                    iBankID = bllBank.AddBank(rw);
                }



/*
 *                              AddBankForClientRequest ab = new AddBankForClientRequest();
 *                              ab.BankName = this.rwReq.BankName;
 *                              ab.BIK = this.rwReq.CodeBIK;
 *                              ab.ShowDialog();
 *                              string szKAccount = "";
 *                              int iCityID = 0;
 *                              if(ab.DialogResult == DialogResult.OK)
 *                              {
 *                                      szKAccount = ab.KAccount;
 *                                      iCityID = ab.CityID;
 *                                      this.rwReq.CodeBIK = ab.BIK;
 *                              }
 *                              else
 *                              {
 *                                      this.iBankID = 0;
 *                                      return;
 *                              }
 *                              SqlCommand cmdInsBank = new SqlCommand("[InsertBank]", this.sqlConnection1);
 *                              cmdInsBank.CommandType = CommandType.StoredProcedure;
 *                              cmdInsBank.Parameters.Add(new SqlParameter("@OrgAccountID", SqlDbType.Int));
 *                              cmdInsBank.Parameters.Add(new SqlParameter("@BankName", SqlDbType.NVarChar));
 *                              cmdInsBank.Parameters.Add(new SqlParameter("@CodeBIK", SqlDbType.NVarChar));
 *                              cmdInsBank.Parameters.Add(new SqlParameter("@BankID", SqlDbType.Int));
 *                              cmdInsBank.Parameters.Add(new SqlParameter("@KAccount", SqlDbType.NVarChar));
 *                              cmdInsBank.Parameters.Add(new SqlParameter("@CityID", SqlDbType.Int));
 *                              cmdInsBank.Parameters["@BankID"].Direction = ParameterDirection.Output;
 *                              cmdInsBank.Parameters["@OrgAccountID"].Value = this.iOrgAccountID;
 *                              cmdInsBank.Parameters["@BankName"].Value = this.rwReq.BankName;
 *                              cmdInsBank.Parameters["@CodeBIK"].Value = this.rwReq.CodeBIK;
 *                              cmdInsBank.Parameters["@KAccount"].Value = szKAccount;
 *                              cmdInsBank.Parameters["@CityID"].Value = iCityID;
 *                              this.sqlConnection1.Open();
 *                              try
 *                              {
 *                                      cmdInsBank.ExecuteNonQuery();
 *                                      object o = cmdInsBank.Parameters["@BankID"].Value;
 *                                      if(o != Convert.DBNull)
 *                                              this.iBankID = Convert.ToInt32(o);
 *                                      else this.iBankID = 0;
 *                              }
 *                              catch
 *                              {
 *                                      this.iBankID = 0;
 *                              }
 *                              finally
 *                              {
 *                                      this.sqlConnection1.Close();
 *                              }
 */
            }
            else
            {
                if (this.dvBanks.Count > 0)
                {
                    BindingManagerBase bm = (BindingManagerBase)this.BindingContext[this.dvBanks];
                    this.iBankID        = Convert.ToInt32(this.dvBanks[bm.Position]["BankID"]);
                    this.rwReq.CodeBIK  = this.dvBanks[bm.Position]["CodeBIK"].ToString();
                    this.rwReq.BankName = this.dvBanks[bm.Position]["BankName"].ToString();
                }
                else
                {
                    this.iBankID = 0;
                }
            }
        }