public bool Delete(string empresaid, tb_sys_formulario BE)
 {
     using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid)))
     {
         using (SqlCommand cmd = new SqlCommand("gspTbSysFormulario_DELETE", cnx))
         {
             {
                 cmd.CommandType = CommandType.StoredProcedure;
                 cmd.Parameters.Add("@dominioid", SqlDbType.Char, 2).Value = BE.dominioid;
                 cmd.Parameters.Add("@moduloid", SqlDbType.Char, 4).Value = BE.moduloid;
                 cmd.Parameters.Add("@formname", SqlDbType.VarChar, 50).Value = BE.formname;
             }
             try
             {
                 cnx.Open();
                 if (cmd.ExecuteNonQuery() > 0)
                 {
                     return true;
                 }
                 else
                 {
                     return false;
                 }
             }
             catch (Exception ex)
             {
                 throw new Exception(ex.Message);
             }
         }
     }
 }
 public DataSet GetAll_paginacion(string empresaid, tb_sys_formulario BE)
 {
     using (SqlConnection cnx = new SqlConnection(conex.empConexion(empresaid)))
     {
         using (SqlCommand cmd = new SqlCommand("gspTbSysModulo_SEARCH_paginacion", cnx))
         {
             DataSet ds = new DataSet();
             {
                 cmd.CommandType = CommandType.StoredProcedure;
                 cmd.Parameters.Add("@dominioid", SqlDbType.Char, 2).Value = BE.dominioid;
                 cmd.Parameters.Add("@moduloid", SqlDbType.Char, 4).Value = BE.moduloid;
                 //cmd.Parameters.Add("@posicion", SqlDbType.VarChar, 10).Value = BE.posicion;
             }
             try
             {
                 cnx.Open();
                 using (SqlDataAdapter da = new SqlDataAdapter(cmd))
                 {
                     da.Fill(ds);
                 }
                 return ds;
             }
             catch (Exception ex)
             {
                 throw new Exception(ex.Message);
             }
         }
     }
 }
        private void btnInformation_Click(object sender, EventArgs e)
        {
            sys_formulariosBL BL = new sys_formulariosBL();
            tb_sys_formulario BE = new tb_sys_formulario();
            DataTable DataFunc = new DataTable();

            BE.dominioid = VariablesPublicas.Dominioid;
            BE.moduloid = VariablesDominio.VarVentas.Moduloid;
            BE.formname = this.Name;
            DataFunc = BL.GetAll(VariablesPublicas.EmpresaID, BE).Tables[0];

            if (DataFunc.Rows.Count > 0)
            {
                //Frm_webbrowser_single frm = new Frm_webbrowser_single();
                //frm.webBrowser1.DocumentText = DataFunc.Rows[0]["formfunc"].ToString().Trim();
                //frm.ShowDialog();
            }
        }
 public bool Update(string empresaid, tb_sys_formulario BE)
 {
     return tablaDA.Update(empresaid, BE);
 }
 public bool Insert(string empresaid, tb_sys_formulario BE)
 {
     return tablaDA.Insert(empresaid, BE);
 }
 public DataSet GetAll_paginacion(string empresaid, tb_sys_formulario BE)
 {
     return tablaDA.GetAll_paginacion(empresaid, BE);
 }
Пример #7
0
        private void btn_information_Click(object sender, EventArgs e)
        {
            var BL = new sys_formulariosBL();
            var BE = new tb_sys_formulario();
            var DataFunc = new DataTable();

            BE.dominioid = dominioid;  //VariablesPublicas.Dominioid;
            BE.moduloid = moduloid;    //VariablesPublicas.Moduloid;
            BE.formname = Name;
            DataFunc = BL.GetAll(VariablesPublicas.EmpresaID, BE).Tables[0];

            if (DataFunc.Rows.Count > 0)
            {
                var frm = new Popup.Frm_webbrowser_single();
                frm.webBrowser1.DocumentText = DataFunc.Rows[0]["formfunc"].ToString().Trim();
                frm.ShowDialog();
            }
        }
        private void Update()
        {
            try
            {
                if (txtnameform.Text.Trim().Length == 0)
                {
                    MessageBox.Show("Falta Nombre del Formulario!!!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                else
                {
                    if (txtfunciones.Text.Trim().Length == 0)
                    {
                        MessageBox.Show("Falta Ingresar las Funciones!!!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                    else
                    {
                        var BE = new tb_sys_formulario();
                        var BL = new sys_formulariosBL();

                        BE.dominioid = cmb_dominio.SelectedValue.ToString();
                        BE.moduloid = cmb_modulo.SelectedValue.ToString();
                        BE.formname = txtnameform.Text;
                        BE.formfunc = txtfunciones.Text;
                        BE.feact = Convert.ToDateTime(fechdoc.Text);

                        if (BL.Update(VariablesPublicas.EmpresaID, BE))
                        {
                            MessageBox.Show("Datos Modificado Correctamente !!!", "Confirmación", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            procesado = true;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void Delete()
        {
            try
            {
                if (txtnameform.Text.Trim().Length == 0)
                {
                    MessageBox.Show("Falta Nombre del Formulario!!!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
                else
                {
                    if (txtfunciones.Text.Trim().Length == 0)
                    {
                        MessageBox.Show("Falta Ingresar las Funciones!!!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        return;
                    }
                    else
                    {
                        var BE = new tb_sys_formulario();
                        var BL = new sys_formulariosBL();

                        BE.dominioid = cmb_dominio.SelectedValue.ToString();
                        BE.moduloid = cmb_modulo.SelectedValue.ToString();
                        BE.formname = txtnameform.Text;

                        if (BL.Delete(VariablesPublicas.EmpresaID, BE))
                        {
                            MessageBox.Show("Datos Eliminado correctamente !!!", "Confirmación", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            Data_TablaFormulario();
                            limpiar_documento();
                            bloqueo(false);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #10
0
        private void Data_TablaFormulario()
        {
            try
            {
                if (TablaFormulario.Rows.Count > 0)
                {
                    TablaFormulario.Rows.Clear();
                }
                var BL = new sys_formulariosBL();
                var BE = new tb_sys_formulario();

                BE.dominioid = cmb_dominio.SelectedValue.ToString();
                BE.moduloid = cmb_modulo.SelectedValue.ToString();

                TablaFormulario = BL.GetAll(VariablesPublicas.EmpresaID, BE).Tables[0];
                if (TablaFormulario.Rows.Count > 0)
                {
                    dgv_formularios.DataSource = TablaFormulario;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
        private void btn_information_Click(object sender, EventArgs e)
        {
            var BL = new sys_formulariosBL();
            var BE = new tb_sys_formulario();
            var DataFunc = new DataTable();

            BE.dominioid = VariablesPublicas.Dominioid;
            BE.moduloid = VariablesPublicas.Moduloid;
            BE.formname = Name;
            DataFunc = BL.GetAll(VariablesPublicas.EmpresaID, BE).Tables[0];
        }