Example #1
0
        private void FillDataGeralNaturezaUpdateModify()
        {
            if ((_RgNaturezaCollection == null) || (_RgStatusCollection == null))
            {
                _RgNaturezaCollection = OverallRecordProcess.CreateInstance.TaskGetCollectionRgNatureza();

                _RgStatusCollection = OverallRecordProcess.CreateInstance.TaskGetCollectionRgStatus();
            }

            _RgRegGeralNatureza = AppStateOverallRecord.RgRegGeralNaturezaModifyProcess;

            #region ...::: Dados Natureza Geral :::...

            txtUsuario.Text = _RgRegGeralNatureza.Usuario;
            txtDtHr.Text    = _RgRegGeralNatureza.DataHora != DateTime.Parse("01/01/0001 00:00:00") ? _RgRegGeralNatureza.DataHora.ToString() : string.Empty;

            #endregion

            cmBxNatureza.DataSource    = _RgNaturezaCollection;
            cmBxNatureza.ValueMember   = "IdNatureza";
            cmBxNatureza.DisplayMember = "DescrNatureza";
            cmBxNatureza.SelectedValue = _RgRegGeralNatureza.IdNatureza;

            cmBxStatusNat.DataSource    = _RgStatusCollection;
            cmBxStatusNat.ValueMember   = "IdRgStatus";
            cmBxStatusNat.DisplayMember = "DescrStatus";
            cmBxStatusNat.SelectedValue = _RgRegGeralNatureza.IdStatusNat;
        }
Example #2
0
        private void FillDataGeralNaturezaAddModify()
        {
            if ((_RgNaturezaCollection == null) || (_RgStatusCollection == null))
            {
                _RgNaturezaCollection = OverallRecordProcess.CreateInstance.TaskGetCollectionRgNatureza();

                _RgStatusCollection = OverallRecordProcess.CreateInstance.TaskGetCollectionRgStatus();
            }

            _RgRegGeralNatureza = AppStateOverallRecord.RgRegGeralNaturezaModifyProcess;

            #region ...::: Dados Natureza Geral :::...

            txtUsuario.Text = _RgRegGeralNatureza.Usuario;
            txtDtHr.Text    = DateTime.Now.ToString();

            #endregion

            cmBxNatureza.DataSource    = _RgNaturezaCollection;
            cmBxNatureza.ValueMember   = "IdNatureza";
            cmBxNatureza.DisplayMember = "DescrNatureza";

            cmBxStatusNat.DataSource    = _RgStatusCollection;
            cmBxStatusNat.ValueMember   = "IdRgStatus";
            cmBxStatusNat.DisplayMember = "DescrStatus";
        }
Example #3
0
        public void EliminarRgRegGeralNatureza(RgRegGeralNatureza _RgRegGeralNatureza)
        {
            RgRegGeralNatureza _Result = null;

            _Result = DAO.FindByPrimaryKey(_RgRegGeralNatureza.cod_empr,
                                           _RgRegGeralNatureza.cod_rg,
                                           _RgRegGeralNatureza.cod_natureza);

            DAO.Delete(_Result);
            DAO.UnitOfWork.Commit();
        }
        public IHttpActionResult Put(RgRegGeralNatureza _RgRegGeralNatureza)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            BO.AlterarRgRegGeralNatureza(_RgRegGeralNatureza);

            return(Updated(_RgRegGeralNatureza));
        }
        public IHttpActionResult Post(RgRegGeralNatureza _RgRegGeralNatureza)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            BO.AdicionarRgRegGeralNatureza(_RgRegGeralNatureza);

            return(Created(_RgRegGeralNatureza));
        }
        public IHttpActionResult Patch(RgRegGeralNatureza _RgRegGeralNatureza)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            Delta <RgRegGeralNatureza> _Delta = new Delta <RgRegGeralNatureza>();

            _Delta.CopyChangedValues(_RgRegGeralNatureza);

            _Delta.Patch(_RgRegGeralNatureza);
            return(Updated(_RgRegGeralNatureza));
        }
Example #7
0
 public void AlterarRgRegGeralNatureza(RgRegGeralNatureza _RgRegGeralNatureza)
 {
     DAO.Update(_RgRegGeralNatureza);
     DAO.UnitOfWork.Commit();
 }
Example #8
0
 public void AdicionarRgRegGeralNatureza(RgRegGeralNatureza _RgRegGeralNatureza)
 {
     DAO.Insert(_RgRegGeralNatureza);
     DAO.UnitOfWork.Commit();
 }
Example #9
0
        public RgRegGeralNatureza RecuperarRgRegGeralNatureza(int _CodEmpr, int _CodRg, int _CodNatureza)
        {
            RgRegGeralNatureza _Result = DAO.RecuperarRgRegGeralNatureza(_CodEmpr, _CodRg, _CodNatureza);

            return(_Result);
        }
 public IHttpActionResult Delete(RgRegGeralNatureza _RgRegGeralNatureza)
 {
     BO.EliminarRgRegGeralNatureza(_RgRegGeralNatureza);
     return(Content(HttpStatusCode.NoContent, "Deleted"));
 }
        public IHttpActionResult Get([FromODataUri] int CodEmpr, [FromODataUri] int CodRg, [FromODataUri] int CodNatureza)
        {
            RgRegGeralNatureza _Result = BO.RecuperarRgRegGeralNatureza(CodEmpr, CodRg, CodNatureza);

            return(Ok(_Result));
        }