public List<BESVMC_OPCI> get_SVPR_OPCI_LIST() { if (string.IsNullOrWhiteSpace((string)HttpContext.Current.Session["ALF_NOMB"])) return new List<BESVMC_OPCI>(); //var oBe = new BESVMC_USUA { COD_USUA = (string)HttpContext.Current.Session["username"] }; var oBe = new BESVMC_OPCI { NUM_ACCI = 6, COD_PERF = (int)HttpContext.Current.Session["COD_PERF"] }; var oBr = new BRSVMC_OPCI(); var oList = oBr.Get_SVPR_OPCI_LIST(oBe); return (oList); }
private void gdvProfile_RowClick(object sender, RowClickEventArgs e) { GridView Grid = (GridView)sender; if (Grid.RowCount > 0) { if (e.RowHandle >= 0) { var oBe = (BESVMC_PERF)gdvProfile.GetRow(e.RowHandle); txtCOD_PERF.Text = oBe.COD_PERF.ToString(); txtALF_PERF.Text = oBe.ALF_PERF; meALF_DESC.Text = oBe.ALF_DESC; var oBeOpci = new BESVMC_OPCI(); var oBrOpci = new BRSVMC_OPCI(); var oBeButt = new BESVMC_BUTT(); var oBrButt = new BRSVMC_BUTT(); oBeOpci.NUM_ACCI = 4; oBeOpci.COD_PERF = oBe.COD_PERF; oListOpci = oBrOpci.Get_SVPR_OPCI_LIST(oBeOpci); gdcOptions.DataSource = oListOpci; gdvOptions.ActiveFilter.Add(gdvOptions.Columns["COD_MAIN"], new ColumnFilterInfo(String.Format("[COD_MAIN] = {0} ", 0), "")); oBeButt.NUM_ACCI = 4; oBeButt.COD_PERF = oBe.COD_PERF; oListButt = oBrButt.Get_SVPR_BUTT_LIST(oBeButt); gdcButtons.DataSource = oListButt; gdvButtons.ActiveFilter.Add(gdvButtons.Columns["COD_OPCI"], new ColumnFilterInfo(String.Format("[COD_OPCI] = {0}", 0), "")); } } }
public void ClearControls() { txtCOD_PERF.Text = ""; txtALF_PERF.Text = ""; meALF_DESC.Text = ""; var oBeOpci = new BESVMC_OPCI(); var oBrOpci = new BRSVMC_OPCI(); var oBeButt = new BESVMC_BUTT(); var oBrButt = new BRSVMC_BUTT(); oListOpci.ForEach(obj => { obj.IND_MARC = false; }); gdcOptions.DataSource = oListOpci; oListButt.ForEach(obj => { obj.IND_MARC = false; }); gdcButtons.DataSource = oListButt; }
public void Save() { try { gdvOptions.CloseEditor(); gdvOptions.RefreshData(); gdvButtons.CloseEditor(); gdvButtons.RefreshData(); var oBe = new BESVMC_PERF(); var oBr = new BRSVMC_PERF(); if (string.IsNullOrEmpty(txtCOD_PERF.Text)) { oBe.NUM_ACCI = 1; } else { oBe.NUM_ACCI = 2; oBe.COD_PERF = int.Parse(txtCOD_PERF.Text); } oBe.ALF_PERF = txtALF_PERF.Text; oBe.ALF_DESC = meALF_DESC.Text; oBe.OBJ_ACCE.LST_OPCI = oListOpci; oBe.OBJ_ACCE.LST_OPCI_BUTT = oListButt; oBe.COD_COMP = SESSION_COMP; oBe.COD_USUA_CREA = SESSION_USER; oBe.COD_USUA_MODI = SESSION_USER; if (XtraMessageBox.Show("Esta seguro de que desea guardar los datos del perfil?", "Sistema", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) { oBr.Set_SVPR_PERF(oBe); txtCOD_PERF.Text = oBe.COD_PERF.ToString(); var oBeOpci = new BESVMC_OPCI(); var oBrOpci = new BRSVMC_OPCI(); var oBeButt = new BESVMC_BUTT(); var oBrButt = new BRSVMC_BUTT(); oBeOpci.NUM_ACCI = 4; oBeOpci.COD_PERF = oBe.COD_PERF; oListOpci = oBrOpci.Get_SVPR_OPCI_LIST(oBeOpci); gdcOptions.DataSource = oListOpci; gdvOptions.ActiveFilter.Add(gdvOptions.Columns["COD_MAIN"], new ColumnFilterInfo(String.Format("[COD_MAIN] = {0} ", 0), "")); oBeButt.NUM_ACCI = 4; oBeButt.COD_PERF = oBe.COD_PERF; oListButt = oBrButt.Get_SVPR_BUTT_LIST(oBeButt); gdcButtons.DataSource = oListButt; gdvButtons.ActiveFilter.Add(gdvButtons.Columns["COD_OPCI"], new ColumnFilterInfo(String.Format("[COD_OPCI] = {0}", 0), "")); var oBeProf = new BESVMC_PERF(); var oBrProf = new BRSVMC_PERF(); oBeProf.NUM_ACCI = 4; oBeProf.COD_COMP = SESSION_COMP; var oList = oBrProf.Get_SVPR_PERF_LIST(oBeProf); gdcProfile.DataSource = oList; ControlState(true); XtraMessageBox.Show("Operacion realizada con exito", "Sistema", MessageBoxButtons.OK, MessageBoxIcon.Information); } } catch (Exception ex) { XtraMessageBox.Show(ex.Message,"Sistema",MessageBoxButtons.OK,MessageBoxIcon.Error); } }