コード例 #1
0
        private List <CatGeneralesBE> GetCatGenerales(string sIdCatGenerales = null)
        {
            List <CatGeneralesBE> lstCatGenerales = new List <CatGeneralesBE>();
            CatalogosBR           oCatBus         = new CatalogosBR();
            RespuestaComunBE      RespuestaComun  = new RespuestaComunBE();
            CatGeneralesBE        item            = new CatGeneralesBE();


            item.psIDCATGENERALES = sIdCatGenerales;
            RespuestaComun        = oCatBus.GetCatGenerales(item);

            if (RespuestaComun.itemError.pbFlag)
            {
                if (sIdCatGenerales == null)
                {
                    ViewState["lstCatGenerales"] = RespuestaComun.lstCatGenerales;
                }
                else
                {
                    item.psNOMBRECATALOGO = RespuestaComun.lstCatGenerales[0].psNOMBRECATALOGO.ToString();
                    item.psIDCATALOGO     = RespuestaComun.lstCatGenerales[0].psIDCATALOGO.ToString();
                    item.psFILTRO         = RespuestaComun.lstCatGenerales[0].psFILTRO.ToString();
                    item.psDESCRIPCION    = RespuestaComun.lstCatGenerales[0].psDESCRIPCION.ToString();
                    item.psACTIVO         = RespuestaComun.lstCatGenerales[0].psACTIVO;

                    CatGeneralesWUC.SetCatGenerales(item);
                }
            }
            lstCatGenerales = RespuestaComun.lstCatGenerales;


            return(lstCatGenerales);
        }
コード例 #2
0
        protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int                   index           = Convert.ToInt32(e.CommandArgument);
            StringBuilder         sMensajelbl     = new StringBuilder(string.Empty);
            List <CatGeneralesBE> lstCatGenerales = (List <CatGeneralesBE>)ViewState["lstCatGenerales"];
            CatGeneralesBE        item            = new CatGeneralesBE();

            string sIdCatalogo = grdCatGenerales.DataKeys[index].Value.ToString();

            item = lstCatGenerales[int.Parse(sIdCatalogo) - 1];

            if (e.CommandName.Equals("AdmonCatalogo"))
            {
                GridViewRow gvrow = grdCatGenerales.Rows[index];

                System.Text.StringBuilder sb = new System.Text.StringBuilder();
                sb.Append(@"<script type='text/javascript'>");
                sb.Append("$('#mdlAdmon').modal('show');");
                sb.Append(@"</script>");
                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "mdlAdmonScript", sb.ToString(), false);

                sMensajelbl.Append(" ADMINISTRAR CATALOGO ");
                sMensajelbl.Append(item.psNOMBRECATALOGO);

                lblAdministrar.Text = sMensajelbl.ToString();
                CatalogosWUC.SetGrid(sIdCatalogo, true);
                CatalogosWUC.RegisterGridpaging();
            }
            else if (e.CommandName.Equals("editRecord"))
            {
                GridViewRow gvrow = grdCatGenerales.Rows[index];
                sIdCatalogo          = grdCatGenerales.DataKeys[index].Value.ToString();
                ViewState["sEditar"] = "1";


                //GridViewRow gvrow = GridView1.Rows[index];
                //lblIDAplicacion.Text = HttpUtility.HtmlDecode(gvrow.Cells[0].Text).ToString();
                //txtDescripcion.Text = HttpUtility.HtmlDecode(gvrow.Cells[1].Text);
                //txtPassword.Text = HttpUtility.HtmlDecode(gvrow.Cells[2].Text);

                //lblResult.Visible = false;
                System.Text.StringBuilder sb = new System.Text.StringBuilder();
                sb.Append(@"<script type='text/javascript'>");
                sb.Append("$('#mdlCatalogo').modal('show');");
                sb.Append(@"</script>");

                ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "mdlCatalogoScript", sb.ToString(), false);
                CatGeneralesWUC.SetDdlCatalogos(2);
                GetCatGenerales(sIdCatalogo);

                sMensajelbl.Append(" EDITAR CATALOGO ");
                sMensajelbl.Append(item.psNOMBRECATALOGO);

                lblTituloModal.Text = sMensajelbl.ToString();
            }
        }
コード例 #3
0
        protected void Add_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(ViewState["sEditar"].ToString()))
            {
                AddCatGenerales();
            }
            else
            {
                SetCatGenerales();
            }

            CatGeneralesWUC.ClearGatGenerales();
            CatGeneralesWUC.SetDdlCatalogos(1);

            ViewState["sEditar"] = string.Empty;
        }
コード例 #4
0
        private void AddCatGenerales()
        {
            CatalogosBR      oCatBus        = new CatalogosBR();
            RespuestaComunBE RespuestaComun = new RespuestaComunBE();
            CatGeneralesBE   item           = new CatGeneralesBE();

            item = CatGeneralesWUC.GetCatGenerales();

            RespuestaComun = oCatBus.AddCatGenerales(item);



            if (RespuestaComun.itemError.pbFlag)
            {
                SetGrid(true);
            }
        }
コード例 #5
0
        protected void btnShowAdd_Click(object sender, EventArgs e)
        {
            System.Text.StringBuilder sb = new System.Text.StringBuilder();

            sb.Append(@"<script type='text/javascript'>");
            sb.Append("$('");
            sb.Append("#mdlCatalogo");
            sb.Append("').modal('show');");
            sb.Append(@"</script>");
            ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "AddShowModalScript", sb.ToString(), false);

            CatGeneralesWUC.SetDdlCatalogos(1);

            lblTituloModal.Text = "Agregar Catálogo";

            //System.Text.StringBuilder sb = new System.Text.StringBuilder();
            //sb.Append(@"<script type='text/javascript'>");
            //sb.Append("$('#mdlCatalogo').modal('show');");
            //sb.Append(@"</script>");
            //ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "AddShowModalScript", sb.ToString(), false);
        }