public List <SCE_CARTEL_MODELO_CATEGORIA_PROMOCION_BE> ListarCMCP(int IdCategoria, int IdPromocion) { List <SCE_CARTEL_MODELO_CATEGORIA_PROMOCION_BE> lstBE = new List <SCE_CARTEL_MODELO_CATEGORIA_PROMOCION_BE>(); SCE_CARTEL_MODELO_CATEGORIA_PROMOCION_BE BE = null; try { using (SqlConnection cn = new SqlConnection(SCE_SQLCONEXION.GetCadConexion(usrLogin))) { cn.Open(); string sql = "SP_SCE_CARTEL_MODELO_CATEGORIA_PROMOCION_SEL"; using (SqlCommand cmd = new SqlCommand(sql, cn)) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@ID_CATEGORIA", IdCategoria); cmd.Parameters.AddWithValue("@ID_PROMOCION", IdPromocion); SqlDataReader reader = cmd.ExecuteReader(); while (reader.Read()) { BE = new SCE_CARTEL_MODELO_CATEGORIA_PROMOCION_BE(); BE.ID_CARTEL = Convert.ToInt32(reader["ID_CARTEL"]); BE.ID_MODELO = Convert.ToInt32(reader["ID_MODELO"]); BE.ID_CATEGORIA = Convert.ToInt32(reader["ID_CATEGORIA"]); BE.ID_PROMOCION = Convert.ToInt32(reader["ID_PROMOCION"]); BE.DESCRIPCION = Convert.ToString(reader["DESCRIPCION"]); lstBE.Add(BE); } return(lstBE); } } } catch (Exception ex) { throw ex; } }
protected void grvListCartelCampo_RowCommand(object sender, GridViewCommandEventArgs e) { List <SCE_CARTEL_MODELO_CATEGORIA_PROMOCION_BE> lstCartelModeloCategPromo = new List <SCE_CARTEL_MODELO_CATEGORIA_PROMOCION_BE>(); int index = Convert.ToInt32(e.CommandArgument); int IdCartel = Convert.ToInt32(grvListCartelCampo.DataKeys[index].Values[0].ToString()); int IdModelo = Convert.ToInt32(grvListCartelCampo.DataKeys[index].Values[1].ToString()); int IdCategoria = Convert.ToInt32(grvListCartelCampo.DataKeys[index].Values[2].ToString()); int IdProMocion = Convert.ToInt32(grvListCartelCampo.DataKeys[index].Values[3].ToString()); CARTEL_MODELO_CATEGORIA_PROMOCION_BE = new SCE_CARTEL_MODELO_CATEGORIA_PROMOCION_BE(); CARTEL_MODELO_CATEGORIA_PROMOCION_BE.ID_CATEGORIA = IdCategoria; CARTEL_MODELO_CATEGORIA_PROMOCION_BE.ID_PROMOCION = IdProMocion; lstCartelModeloCategPromo.Add(CARTEL_MODELO_CATEGORIA_PROMOCION_BE); CARTEL_MODELO_BL.EliminarCMCP(IdCartel, IdModelo, lstCartelModeloCategPromo); Util.RegisterAsyncAlert(upnlDetalle, "__Alerta__", Resources.Mensajes.msgCCCPAlertEliminacion); GetData(Convert.ToInt32(cboCategoria.SelectedValue), Convert.ToInt32(cboPromocion.SelectedValue)); }
protected void btnGuardarGrupo_Click(object sender, EventArgs e) { string strMsg = null; int numMaxDigitos = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["NroMaxDigitos"]); List <SCE_CARTEL_MODELO_CATEGORIA_PROMOCION_BE> lstCartelModeloCategPromo = new List <SCE_CARTEL_MODELO_CATEGORIA_PROMOCION_BE>(); strMsg = CARTEL_MODELO_BL.IsValid(cboCartelModelo.SelectedValue, Convert.ToInt32(cboCategoria.SelectedValue), Convert.ToInt32(cboPromocion.SelectedValue)); if (strMsg.Length > 0) { Util.RegisterAsyncAlert(upnlDetalle, "__Alerta__", strMsg); pnlListado.Visible = true; pnlDetalleGrupo.Visible = true; return; } CARTEL_MODELO_CATEGORIA_PROMOCION_BE = new SCE_CARTEL_MODELO_CATEGORIA_PROMOCION_BE(); CARTEL_MODELO_CATEGORIA_PROMOCION_BE.ID_CATEGORIA = Convert.ToInt32(cboCategoria.SelectedValue); CARTEL_MODELO_CATEGORIA_PROMOCION_BE.ID_PROMOCION = Convert.ToInt32(cboPromocion.SelectedValue); lstCartelModeloCategPromo.Add(CARTEL_MODELO_CATEGORIA_PROMOCION_BE); CARTEL_MODELO_BL.ActualizarCMCP(cboCartelModelo.SelectedValue, numMaxDigitos, lstCartelModeloCategPromo); pnlDetalleGrupo.Visible = false; pnlListado.Visible = true; pnlBtnAgregar.Visible = true; System.Text.StringBuilder sbScript = new System.Text.StringBuilder(); sbScript.AppendFormat("document.getElementById('{0}').disabled=false;", cboCategoria.ClientID); sbScript.AppendFormat("document.getElementById('{0}').disabled=false;", cboPromocion.ClientID); Util.RegisterScript(upnlDetalle, "__DesabilitaCtrol__", sbScript.ToString()); GetData(Convert.ToInt32(cboCategoria.SelectedValue), Convert.ToInt32(cboPromocion.SelectedValue)); }