Пример #1
0
        protected override MasterVO FillObject()
        {
            StatementsVO statementVO = new StatementsVO();

            statementVO.Id            = Convert.ToInt32(txt_Id.Text);
            statementVO.TypeId        = Convert.ToInt32(txt_Type.Text);
            statementVO.EnvironmentId = Convert.ToInt32(txt_Environment.Text);
            statementVO.Name          = txt_Name.Text;
            statementVO.Date          = dt_Date.Value;
            statementVO.Value         = Convert.ToDouble(txt_Value.Text);
            // investmentsVO.UserId = null;
            return(statementVO);
        }
Пример #2
0
        public override MasterVO BiuldVO(DataRow row)
        {
            StatementsVO statement = new StatementsVO();

            statement.Id            = Convert.ToInt32(row["id"]);
            statement.Name          = row["name"].ToString();
            statement.UserId        = Convert.ToInt32(row["userId"]);
            statement.TypeId        = Convert.ToInt32(row["typeId"]);
            statement.EnvironmentId = Convert.ToInt32(row["environmentId"]);
            statement.Value         = Convert.ToDouble(row["value"]);
            statement.Date          = Convert.ToDateTime(row["date"]);

            return(statement);
        }
        private void btn_Pesquisar_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txt_Name.Text))
            {
                MessageBox.Show("Digite um valor válido para o nome.");
            }
            else
            {
                StatementsDAO dao = new StatementsDAO();

                StatementsVO statement = new StatementsVO();
                statement.Name = txt_Name.Text;

                DataTable table = dao.SQLSearch(statement);
                dgv_Listing.DataSource = table;
            }
        }
        private void btn_Confirm_Click(object sender, EventArgs e)
        {
            if (dgv_Listing.CurrentRow != null)
            {
                StatementsVO statement = new StatementsVO();
                statement.Id            = Convert.ToInt32(dgv_Listing.CurrentRow.Cells[0].Value);
                statement.UserId        = Convert.ToInt32(dgv_Listing.CurrentRow.Cells[1].Value);
                statement.TypeId        = Convert.ToInt32(dgv_Listing.CurrentRow.Cells[2].Value);
                statement.EnvironmentId = Convert.ToInt32(dgv_Listing.CurrentRow.Cells[3].Value);
                statement.Name          = dgv_Listing.CurrentRow.Cells[4].Value.ToString();
                statement.Value         = Convert.ToDouble(dgv_Listing.CurrentRow.Cells[5].Value);
                statement.Date          = Convert.ToDateTime(dgv_Listing.CurrentRow.Cells[6].Value);


                uc_StatementRegister.Instance.FillScreen(statement);
                this.Visible = false;
            }
            else
            {
                MessageBox.Show("Selecione uma linha válida");
            }
        }