Beispiel #1
0
        protected void btnUpdate_Click(object sender, EventArgs e)
        {
            Boolean Result = false;

            int Func_Id = int.Parse(ddlFuncionario.SelectedValue.ToString());

            int Id = int.Parse(lblValueId.Text);

            try
            {
                this.objCntrlTarefa = new cntrlTarefa();

                this.rowTarefa               = this.objCntrlTarefa.Select(Id);
                this.rowTarefa.Descricao     = txtDescricao.Text.Trim();
                this.rowTarefa.IdFuncionario = Func_Id;

                Result = this.objCntrlTarefa.Save(rowTarefa);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                this.objCntrlTarefa = null;
                this.rowTarefa      = null;
            }

            this.getData(Func_Id);
        }
Beispiel #2
0
        private void insertData()
        {
            Boolean Result = false;

            int Func_Id = int.Parse(ddlFuncionario.SelectedValue.ToString());

            try
            {
                this.objCntrlTarefa = new cntrlTarefa();

                this.rowTarefa               = this.tblTarefa.NewtblTarefasRow();
                this.rowTarefa.Descricao     = txtDescricao.Text.Trim();
                this.rowTarefa.IdFuncionario = Func_Id;

                Result = this.objCntrlTarefa.Save(rowTarefa);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                this.objCntrlTarefa = null;
                this.rowTarefa      = null;
            }

            this.getData(Func_Id);
        }