Beispiel #1
0
        private void SaveReg()
        {
            GTI_Models.Models.Tributo reg = new GTI_Models.Models.Tributo {
                Desctributo  = txtCompleto.Text,
                Abrevtributo = txtResumido.Text,
                Da           = true
            };
            Tributario_bll clsTributario = new Tributario_bll(_connection);
            Exception      ex;

            if (bAddNew)
            {
                ex = clsTributario.Insert_Tributo(reg);
            }
            else
            {
                reg.Codtributo = Convert.ToInt16(lstMain.SelectedValue);
                ex             = clsTributario.Alterar_Tributo(reg);
            }
            if (ex != null)
            {
                ErrorBox eBox = new ErrorBox("Atenção", ex.Message, ex);
                eBox.ShowDialog();
            }
            else
            {
                Carrega_Lista();
                ControlBehaviour(true);
            }
        }
Beispiel #2
0
        public JsonResult Incluir_Tributo(string nomeC, string nomeR)
        {
            Tributo reg = new Tributo()
            {
                Desctributo  = nomeC.ToUpper(),
                Abrevtributo = nomeR.ToUpper()
            };

            Tributario_bll tributarioRepository = new Tributario_bll(_connection);
            Exception      ex = tributarioRepository.Insert_Tributo(reg);

            var result = new { Success = "True" };

            return(new JsonResult {
                Data = result, JsonRequestBehavior = JsonRequestBehavior.AllowGet
            });
        }