Пример #1
0
        private void DataGriewDados_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
        {
            if (LIS_CONTACORRENTEColl.Count > 0)
            {
                int rowindex = e.RowIndex;
                if (rowindex != -1)
                {
                    int CodigoSelect = Convert.ToInt32(LIS_CONTACORRENTEColl[rowindex].IDCONTACORRENTE);

                    Entity = CONTACORRENTEP.Read(CodigoSelect);

                    //Salva o saldo
                    CONTACORRENTEP.Save(Entity);

                    tabControlMarca.SelectTab(0);
                    txtNomeContaCorrente.Focus();
                }
            }
        }
Пример #2
0
        private void SalvaSaldo()
        {
            try
            {
                CONTACORRENTEProvider CONTACORRENTEP  = new CONTACORRENTEProvider();
                CONTACORRENTEEntity   CONTACORRENTETy = new CONTACORRENTEEntity();
                CONTACORRENTETy = CONTACORRENTEP.Read(Convert.ToInt32(cbContaCorrente.SelectedValue));

                //decimal VALOR = Convert.ToInt32(cbCrediDebito.SelectedValue) == 2 ? (Convert.ToDecimal(txtValor.Text) * -1) : Convert.ToDecimal(txtValor.Text);

                //if (Tipo == 0) //0 Soma // 1 Subtrai
                //    CONTACORRENTETy.SALDO = CONTACORRENTETy.SALDO + Convert.ToDecimal(VALOR);
                //else if (Tipo == 1)
                //    CONTACORRENTETy.SALDO = CONTACORRENTETy.SALDO - Convert.ToDecimal(VALOR);

                CONTACORRENTETy.SALDO = SaldoExtrato();

                CONTACORRENTEP.Save(CONTACORRENTETy);
            }
            catch (Exception ex)
            {
                MessageBox.Show("Erro técnico: " + ex.Message);
            }
        }