protected void gvCaracter_RowDataBound(object sender, GridViewRowEventArgs e)
 {
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         e.Row.Attributes.Add("OnMouseOut", "this.className = this.orignalclassName;");
         e.Row.Attributes.Add("OnMouseOver", "this.orignalclassName = this.className;this.className = 'SelectedRow';");
     }
     if (e.Row.RowType == DataControlRowType.DataRow)
     {
         IReglas      IServiceDdl   = new IReglas();
         DropDownList ddlDepartment = (DropDownList)e.Row.FindControl("ddlCaracter");
         if (ddlDepartment != null)
         {
             ddlDepartment.DataSource     = IServiceDdl.IGetEspeciales();
             ddlDepartment.DataTextField  = "caracter";
             ddlDepartment.DataValueField = "codCaracter";
             ddlDepartment.DataBind();
             ddlDepartment.SelectedValue = gvCaracter.DataKeys[e.Row.RowIndex].Values[1].ToString();
         }
     }
     else if (e.Row.RowType == DataControlRowType.Footer)
     {
         IReglas      IServiceDdl   = new IReglas();
         DropDownList ddlDepartment = (DropDownList)e.Row.FindControl("ddlCaracter");
         ddlDepartment.DataSource     = IServiceDdl.IGetEspeciales();
         ddlDepartment.DataTextField  = "caracter";
         ddlDepartment.DataValueField = "codCaracter";
         ddlDepartment.DataBind();
     }
 }
        protected void loadGrid()
        {
            IReglas         IService = new IReglas();
            List <BEReglas> lstBE    = new List <BEReglas>();

            lstBE = IService.IGetCaracteresEspecialesBL();
            gvCaracter.DataSource = lstBE;
            gvCaracter.DataBind();
        }
Exemple #3
0
        public ReglasPoliza(Model.Poliza poliza)
        {
            _calculo          = new CalculoBase(poliza).Get();
            _reglas           = new ReglasBase();
            _coberturaFactory = new CoberturaFactory(_calculo, _reglas);

            _coberturaFactory.RegisterCobertura <CoberturaA>(1);
            _coberturaFactory.RegisterCobertura <CoberturaC>(2);
            _coberturaFactory.RegisterCobertura <CoberturaCPlus>(3);
            _coberturaFactory.RegisterCobertura <CoberturaD>(4);
        }
 protected void gvCaracter_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName.Equals("Insert"))
     {
         IReglas  IService = new IReglas();
         BEReglas BE       = new BEReglas();
         BE             = new BEReglas();
         BE.equivalence = ((TextBox)gvCaracter.FooterRow.FindControl("txtEquivalente")).Text;
         BE.codCaracter = ((DropDownList)gvCaracter.FooterRow.FindControl("ddlCaracter")).SelectedValue;
         IService.IReglasIns(BE);
         loadGrid();
     }
 }
        protected void gvCaracter_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            IReglas  IService = new IReglas();
            BEReglas BE       = new BEReglas();

            BE          = new BEReglas();
            BE.codRegla = gvCaracter.Rows[e.RowIndex].Cells[0].Text.Trim();
            IService.IReglasDel(BE);
            loadGrid();
            if (gvCaracter.Rows.Count < 1)
            {
                Response.Redirect("~/GestionarReglas/MantReglas.aspx");
            }
        }
Exemple #6
0
        protected void gvCaracter_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            if (gvCaracter.Rows.Count == 1)
            {
                return;
            }
            IReglas  IService = new IReglas();
            BEReglas BE       = new BEReglas();

            BE             = new BEReglas();
            BE.codCaracter = gvCaracter.Rows[e.RowIndex].Cells[0].Text.Trim(); //gvCaracter.DataKeys[e.RowIndex].Values[0].ToString();//row.Cells[0].Text.Trim();
            IService.ICaracteresDel(BE);
            loadGrid();
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["LoginUser"] == null)
     {
         Response.Redirect("~/Login.aspx");
     }
     if (gvCaracter.Rows.Count <= 1)
     {
         ClientScript.RegisterStartupScript(typeof(Page), "frTest", "frShowHideButtonNew(1);", true);
     }
     if (!IsPostBack)
     {
         IReglas IServiceDdl = new IReglas();
         ddlMantCaracter.DataSource     = IServiceDdl.IGetEspeciales();
         ddlMantCaracter.DataTextField  = "caracter";
         ddlMantCaracter.DataValueField = "codCaracter";
         ddlMantCaracter.DataBind();
         loadGrid();
     }
 }
Exemple #8
0
 public CoberturaD(ICalculo calculo, IReglas reglas)
 {
     PrecioBase = Convert.ToDecimal(0.02);
     _calculo   = calculo;
     _reglas    = reglas;
 }
Exemple #9
0
 public CoberturaC(ICalculo calculo, IReglas reglas)
 {
     _calculo   = calculo;
     _reglas    = reglas;
     PrecioBase = Convert.ToDecimal(0.010);
 }
Exemple #10
0
 public CoberturaFactory(ICalculo calculo, IReglas reglas)
 {
     _coberturas = new Dictionary <int, Type>();
     _calculo    = calculo;
     _reglas     = reglas;
 }
        public static string InsertRegla(BEReglas obj)
        {
            IReglas IService = new IReglas();

            return(IService.IReglasIns(obj));
        }