示例#1
0
        public List <WCFMetodosBE> checkMetodoXApp(Int64 App, string sServiceName, string sMethodName)
        {
            linqIELDataBaseDataContext dboSegLatino = new linqIELDataBaseDataContext();
            List <WCFMetodosBE>        MetodosXApp  = new List <WCFMetodosBE>();

            try
            {
                var lnqConsulta = dboSegLatino.sp_getMetodoXApp(App, sServiceName, sMethodName);
                foreach (var a in lnqConsulta)
                {
                    WCFMetodosBE MetodosBE = new WCFMetodosBE();
                    MetodosBE.IDMETODOS    = a.IDMETODOS;
                    MetodosBE.IDAPLICACION = a.IDAPLICACION ?? 0;
                    MetodosBE.IDSERVICIOS  = a.IDSERVICIOS ?? 0;
                    MetodosBE.NOMBREMETODO = a.NOMBREMETODO;
                    MetodosBE.RECURRENTE   = a.RECURRENTE ?? false;
                    MetodosBE.ACTIVO       = a.ACTIVO ?? false;
                    MetodosXApp.Add(MetodosBE);
                }
                return(MetodosXApp);
            }
            catch (Exception ex)
            {
                StackTrace st      = new StackTrace(true);
                CommonDA   ComunDA = new CommonDA();
                ComunDA.insErrorDB("Error: " + ex.Message + " En El Metodo: " + MethodBase.GetCurrentMethod().Name, st, "", App.ToString());
                throw new Exception(ex.Message);
            }
        }
示例#2
0
 private void SetMetodo(WCFMetodosBE item)
 {
     txtIdMetodo.Text            = item.IDMETODOS.ToString();
     ddlAplicacion.SelectedValue = item.IDAPLICACION.ToString();
     ddlServicio.SelectedValue   = item.IDSERVICIOS.ToString();
     txtNombre.Text        = item.NOMBREMETODO;
     chkRecurrente.Checked = item.RECURRENTE;
     chkActivo.Checked     = item.ACTIVO;
     ViewState["RowIndex"] = item.RowIndex;
 }
示例#3
0
        protected void btnAgregarMetodo_Click(object sender, EventArgs e)
        {
            List <WCFMetodosBE> lstMetodos = new List <WCFMetodosBE>();
            WCFMetodosBE        item       = new WCFMetodosBE();
            bool bExiste = false;

            lstMetodos = (List <WCFMetodosBE>)ViewState["lstMetodos"];
            item       = GetMetodo();

            foreach (var itemfor in lstMetodos)
            {
                if (itemfor.IDAPLICACION == item.IDAPLICACION && itemfor.IDSERVICIOS == item.IDSERVICIOS && item.IDMETODOS == 0)
                {
                    if (itemfor.NOMBREMETODO.ToLower() == item.NOMBREMETODO.ToLower())
                    {
                        bExiste = true;
                        break;
                    }
                }
            }

            if (bExiste)
            {
                RegisterGridPaging();
                Common.UserControls.MensajeWUC oMensajeWUC = this.Parent.FindControl("MensajeWUC") as Common.UserControls.MensajeWUC;
                oMensajeWUC.SetMensaje("Ya se ha agragado un Servicio con las caracteristicas Agregadas", 5, "AlertAddMetodos");

                //RegisterExternarScripts();
                return;
            }


            if (item.IDMETODOS != 0)
            {
                //item.Actualizado = true;
                //Validar si no se ha agregado el registro Seleccionado
                lstMetodos.RemoveAt(int.Parse(item.RowIndex));
                item.Actualizado = true;
                lstMetodos.Add(item);
            }
            else
            {
                item.IDMETODOS = 0;
                lstMetodos.Add(item);
            }

            ViewState["lstDomicilio"] = lstMetodos;

            SetGrid(false);

            ClearMetodos();
            RegisterGridPaging();
        }
示例#4
0
        private WCFMetodosBE GetMetodo()
        {
            WCFMetodosBE item = new WCFMetodosBE();

            item.IDMETODOS    = long.Parse(string.IsNullOrEmpty(txtIdMetodo.Text) ? "0" : txtIdMetodo.Text);
            item.IDAPLICACION = long.Parse(ddlAplicacion.SelectedValue);
            item.IDSERVICIOS  = long.Parse(ddlServicio.SelectedValue);
            item.NOMBREMETODO = txtNombre.Text;
            item.RECURRENTE   = chkRecurrente.Checked;
            item.ACTIVO       = chkActivo.Checked;
            item.RowIndex     = ViewState["RowIndex"].ToString();

            return(item);
        }
示例#5
0
        protected void grdMetodos_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int                 index       = Convert.ToInt32(e.CommandArgument);
            StringBuilder       sMensajelbl = new StringBuilder(string.Empty);
            List <WCFMetodosBE> lstMetodos  = (List <WCFMetodosBE>)ViewState["lstMetodos"];
            GridViewRow         gvrow       = grdMetodos.Rows[index];
            WCFMetodosBE        item        = new WCFMetodosBE();

            string sIdUsuario = grdMetodos.DataKeys[index].Value.ToString();

            if (e.CommandName.Equals("EditMetodo"))
            {
                lstMetodos    = (List <WCFMetodosBE>)ViewState["lstMetodos"];
                item          = lstMetodos[index];
                item.RowIndex = index.ToString();
                SetMetodo(item);
            }

            RegisterGridPaging();
        }