private void Page_Load(object sender, System.EventArgs e)
        {
            if (Session["Usuario"] != null)
            {
                this.usuario = (IUsuarios)Session["Usuario"];
            }

            if (User.Identity.IsAuthenticated)
            {
                string sOpcion = "comisiones";
                Menu   oMenu   = (Menu)this.FindControl("Menu1");
                this.ValidarSeguridad(oMenu, sOpcion);
            }

            if (!IsPostBack)
            {
                Session["dsComisiones"] = null;
                LlenarCombos();
            }

            IConceptoComision conceptoComision = ConceptoComisionFactory.GetConceptoComision();

            this.dsConceptosComisiones = conceptoComision.GetConceptosComisionesConMaximosDataSet();

            this.BindGrilla();
        }
Esempio n. 2
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            if (Session["Usuario"] != null)
            {
                this.usuario = (IUsuarios)Session["Usuario"];
            }

            if (User.Identity.IsAuthenticated)
            {
                //this.SetCultura();
                string sOpcion = "comisionMasivaVendedor";
                Menu   oMenu   = (Menu)this.FindControl("Menu1");
                this.ValidarSeguridad(oMenu, sOpcion);
            }

            if (!IsPostBack)
            {
                Session["dsComisiones"] = null;
                //this.BindGrilla();
            }

            this.txtUnidadVentaID.Text = this.Request.QueryString["UnidadVentaID"].ToString();

            IConceptoComision conceptoComision = ConceptoComisionFactory.GetConceptoComision();

            this.dsConceptosComisiones = conceptoComision.GetConceptosComisionesConMaximosDataSet();

            IConceptoComisionEntidad conceptoComisionEntidad = ConceptoComisionEntidadFactory.GetConceptoComisionEntidad();

            this.dsConceptosComisionesEntidades = conceptoComisionEntidad.GetConceptosComisionesEntidadesConMaximosDataSet();

            this.BindGrilla();
        }
Esempio n. 3
0
        private void butAgregar_Click(object sender, System.EventArgs e)
        {
            //IraUltimaPagina();

            DsConceptosComisiones ds = (DsConceptosComisiones)Session["dsConceptosComisiones"];

            DsConceptosComisiones.DatosRow dr = ds.Datos.NewDatosRow();
            dr.ConceptoComisionID      = 0;
            dr.ConceptoComisionDescrip = "";
            dr.Baja = false;
            dr.ImporteFijoMaximo = 0;
            dr.PorcentajeMaximo  = 0;

            ds.Datos.AddDatosRow(dr);
            Session["dsConceptosComisiones"] = ds;

            int iNewItemIndex = this.dtgConceptosComisiones.Items.Count;

            /*if (iNewItemIndex >= this.dtgComisiones.PageSize)
             * {
             *      this.dtgComisiones.CurrentPageIndex++;
             *      iNewItemIndex = 0;
             * }*/

            this.dtgConceptosComisiones.DataSource    = ds;
            this.dtgConceptosComisiones.EditItemIndex = iNewItemIndex;
            this.dtgConceptosComisiones.DataBind();
        }
Esempio n. 4
0
        private void dtgConceptosComisiones_DeleteCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
        {
            this.dsConceptosComisiones = (DsConceptosComisiones)Session["dsConceptosComisiones"];
            DsConceptosComisiones.DatosRow dr = (DsConceptosComisiones.DatosRow) this.dsConceptosComisiones.Datos.Rows[e.Item.DataSetIndex];

            IConceptoComision cc = ConceptoComisionFactory.GetConceptoComision();

            cc.ConceptoComisionID = dr.ConceptoComisionID;

            try
            {
                cc.Eliminar();
                this.dtgConceptosComisiones.EditItemIndex = -1;
                Session["dsConceptosComisiones"]          = null;
                this.BindGrilla();
            }
            catch (Exception ex)
            {
                string mensaje = ex.Message;
                try
                {
                    mensaje = this.TraducirTexto(ex.Message);
                    if (mensaje == "" || mensaje == null)
                    {
                        mensaje = ex.Message;
                    }
                }
                catch (Exception)
                {
                    mensaje = ex.Message;
                }
                ((ErrorWeb)this.phErrores.Controls[0]).setMensaje(mensaje);
            }
        }
Esempio n. 5
0
        public override global::System.Data.DataSet Clone()
        {
            DsConceptosComisiones cln = ((DsConceptosComisiones)(base.Clone()));

            cln.InitVars();
            cln.SchemaSerializationMode = this.SchemaSerializationMode;
            return(cln);
        }
        public DsConceptosComisiones GetConceptosComisionByEntidadesDataSet(int entidadComisionID)
        {
            DsConceptosComisiones ds = new DsConceptosComisiones();

            SqlParameter pEntidadComisionID = new SqlParameter("@EntidadComisionID", entidadComisionID);

            Config.Conexion.LlenarTypeDataSet(ds.Datos, System.Data.CommandType.StoredProcedure, "ConceptosComisionByEntidadSEL", pEntidadComisionID);

            return(ds);
        }
Esempio n. 7
0
        public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs)
        {
            DsConceptosComisiones ds = new DsConceptosComisiones();

            global::System.Xml.Schema.XmlSchemaComplexType type     = new global::System.Xml.Schema.XmlSchemaComplexType();
            global::System.Xml.Schema.XmlSchemaSequence    sequence = new global::System.Xml.Schema.XmlSchemaSequence();
            global::System.Xml.Schema.XmlSchemaAny         any      = new global::System.Xml.Schema.XmlSchemaAny();
            any.Namespace = ds.Namespace;
            sequence.Items.Add(any);
            type.Particle = sequence;
            global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
            if (xs.Contains(dsSchema.TargetNamespace))
            {
                global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
                global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
                try {
                    global::System.Xml.Schema.XmlSchema schema = null;
                    dsSchema.Write(s1);
                    for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();)
                    {
                        schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
                        s2.SetLength(0);
                        schema.Write(s2);
                        if ((s1.Length == s2.Length))
                        {
                            s1.Position = 0;
                            s2.Position = 0;
                            for (; ((s1.Position != s1.Length) &&
                                    (s1.ReadByte() == s2.ReadByte()));)
                            {
                                ;
                            }
                            if ((s1.Position == s1.Length))
                            {
                                return(type);
                            }
                        }
                    }
                }
                finally {
                    if ((s1 != null))
                    {
                        s1.Close();
                    }
                    if ((s2 != null))
                    {
                        s2.Close();
                    }
                }
            }
            xs.Add(dsSchema);
            return(type);
        }
        /// <summary>
        /// Método para llenar el dataset de conceptos de comisión.
        /// Invoca al stored procedure ConceptosComisionesALL.
        /// </summary>
        /// <returns>Retorna el dataset de conceptos de comisión</returns>
        public DsConceptosComisiones GetConceptosComisionesDataSet()
        {
            DsConceptosComisiones ds = new DsConceptosComisiones();

            /*if (CacheDataManager.GetCacheValue(SisPack.CacheObjetos.ConceptoComision.ToString()) == null)
             * {*/
            Config.Conexion.LlenarTypeDataSet(ds.Datos, System.Data.CommandType.StoredProcedure, "ConceptosComisionesALL");
            CacheDataManager.SetCacheValue(SisPack.CacheObjetos.ConceptoComision.ToString(), ds);

            /*}
             * else
             *      ds = (DsConceptosComisiones) CacheDataManager.GetCacheValue(SisPack.CacheObjetos.ConceptoComision.ToString());*/

            return(ds);
        }
Esempio n. 9
0
        private void BindGrilla()
        {
            SisPackController.AdministrarGrillas.Configurar(this.dtgConceptosComisiones, "ConceptoComisionID", this.CantidadOpciones);
            dtgConceptosComisiones.AllowPaging = false;

            if (Session["dsConceptosComisiones"] == null)
            {
                IConceptoComision conceptoComision = ConceptoComisionFactory.GetConceptoComision();
                this.dsConceptosComisiones = conceptoComision.GetConceptosComisionesDataSet();
            }
            else
            {
                this.dsConceptosComisiones = (DsConceptosComisiones)Session["dsConceptosComisiones"];
                if (this.dtgConceptosComisiones.EditItemIndex != -1)
                {
                    DataGridItem item = this.dtgConceptosComisiones.Items[this.dtgConceptosComisiones.EditItemIndex];
                    DsConceptosComisiones.DatosRow dr = (DsConceptosComisiones.DatosRow) this.dsConceptosComisiones.Datos.Rows[item.DataSetIndex];

                    /*DropDownList ddl = (DropDownList)item.FindControl("ddlConceptoComision");
                     * string selValue = ddl.SelectedValue;
                     * dr.ConceptoComisionID = selValue == "" ? 0 : Convert.ToInt32(selValue);*/

                    /*try
                     * {*/

                    TextBox porcentaje = (TextBox)item.FindControl("txtPorcentaje");
                    dr.PorcentajeMaximo = porcentaje.Text != "" ? Convert.ToDouble(porcentaje.Text) : 0;

                    TextBox importeFijo = (TextBox)item.FindControl("txtimporteFijo");
                    dr.ImporteFijoMaximo = importeFijo.Text != "" ? Convert.ToDouble(importeFijo.Text) : 0;

                    /*}
                     * catch(Exception)
                     * {
                     * }*/
                }
            }

            Session["dsConceptosComisiones"]             = this.dsConceptosComisiones;
            this.dtgConceptosComisiones.DataSource       = this.dsConceptosComisiones;
            this.dtgConceptosComisiones.CurrentPageIndex = 0;
            this.dtgConceptosComisiones.DataBind();
        }
        /// <summary>
        /// Método para consultar los datos completos de un Concepto de comisión.
        /// </summary>
        /// <returns>Retorna un booleando indicando si el Concepto de comisión existe.</returns>
        public bool Consultar()
        {
            DsConceptosComisiones ds = this.GetConceptosComisionesDataSet();

            if (ds == null)
            {
                return(false);
            }

            DsConceptosComisiones.DatosRow dr = ds.Datos.FindByConceptoComisionID(this.ConceptoComisionID);
            if (dr == null)
            {
                return(false);
            }

            this.ConceptoComisionDescrip = dr.ConceptoComisionDescrip;
            this.Baja = dr.Baja;

            return(true);
        }
Esempio n. 11
0
            public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs)
            {
                global::System.Xml.Schema.XmlSchemaComplexType type     = new global::System.Xml.Schema.XmlSchemaComplexType();
                global::System.Xml.Schema.XmlSchemaSequence    sequence = new global::System.Xml.Schema.XmlSchemaSequence();
                DsConceptosComisiones ds = new DsConceptosComisiones();

                global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
                any1.Namespace       = "http://www.w3.org/2001/XMLSchema";
                any1.MinOccurs       = new decimal(0);
                any1.MaxOccurs       = decimal.MaxValue;
                any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
                sequence.Items.Add(any1);
                global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
                any2.Namespace       = "urn:schemas-microsoft-com:xml-diffgram-v1";
                any2.MinOccurs       = new decimal(1);
                any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
                sequence.Items.Add(any2);
                global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
                attribute1.Name       = "namespace";
                attribute1.FixedValue = ds.Namespace;
                type.Attributes.Add(attribute1);
                global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
                attribute2.Name       = "tableTypeName";
                attribute2.FixedValue = "DatosDataTable";
                type.Attributes.Add(attribute2);
                type.Particle = sequence;
                global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
                if (xs.Contains(dsSchema.TargetNamespace))
                {
                    global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
                    global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
                    try {
                        global::System.Xml.Schema.XmlSchema schema = null;
                        dsSchema.Write(s1);
                        for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();)
                        {
                            schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
                            s2.SetLength(0);
                            schema.Write(s2);
                            if ((s1.Length == s2.Length))
                            {
                                s1.Position = 0;
                                s2.Position = 0;
                                for (; ((s1.Position != s1.Length) &&
                                        (s1.ReadByte() == s2.ReadByte()));)
                                {
                                    ;
                                }
                                if ((s1.Position == s1.Length))
                                {
                                    return(type);
                                }
                            }
                        }
                    }
                    finally {
                        if ((s1 != null))
                        {
                            s1.Close();
                        }
                        if ((s2 != null))
                        {
                            s2.Close();
                        }
                    }
                }
                xs.Add(dsSchema);
                return(type);
            }
Esempio n. 12
0
        private void dtgConceptosComisiones_UpdateCommand(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
        {
            RequiredFieldValidator reqPorcentaje = (RequiredFieldValidator)((PlaceHolder)e.Item.FindControl("phValidPorcentaje")).FindControl("ReqPorcentaje");

            reqPorcentaje.Enabled = true;
            reqPorcentaje.Validate();
            if (!reqPorcentaje.IsValid)
            {
                return;
            }

            BaseValidator valPtj = (BaseValidator)((PlaceHolder)e.Item.FindControl("phValidPorcentaje")).FindControl("ValPorcentaje");

            valPtj.Enabled = true;
            valPtj.Validate();
            if (!valPtj.IsValid)
            {
                return;
            }

            RequiredFieldValidator reqImporteFijo = (RequiredFieldValidator)((PlaceHolder)e.Item.FindControl("phValidImporteFijo")).FindControl("ReqImporteFijo");

            reqImporteFijo.Enabled = true;
            reqImporteFijo.Validate();
            if (!reqImporteFijo.IsValid)
            {
                return;
            }

            BaseValidator valImp = (BaseValidator)((PlaceHolder)e.Item.FindControl("phValidImporteFijo")).FindControl("ValImporteFijo");

            valImp.Enabled = true;
            valImp.Validate();
            if (!valImp.IsValid)
            {
                return;
            }

            Page.Validate();
            if (!Page.IsValid)
            {
                return;
            }

            this.dsConceptosComisiones = (DsConceptosComisiones)Session["dsConceptosComisiones"];
            DsConceptosComisiones.DatosRow dr = (DsConceptosComisiones.DatosRow) this.dsConceptosComisiones.Datos.Rows[e.Item.DataSetIndex];

            IConceptoComision cc = ConceptoComisionFactory.GetConceptoComision();

            cc.ConceptoComisionID      = dr.ConceptoComisionID;
            cc.ConceptoComisionDescrip = dr.ConceptoComisionDescrip;
            cc.PorcentajeMaximo        = dr.PorcentajeMaximo;
            cc.ImporteFijoMaximo       = dr.ImporteFijoMaximo;

            try
            {
                cc.Guardar();
                this.dtgConceptosComisiones.EditItemIndex = -1;
                Session["dsConceptosComisiones"]          = null;
                this.BindGrilla();
            }
            catch (Exception ex)
            {
                string mensaje = ex.Message;
                try
                {
                    mensaje = this.TraducirTexto(ex.Message);
                    if (mensaje == "" || mensaje == null)
                    {
                        mensaje = ex.Message;
                    }
                }
                catch (Exception)
                {
                    mensaje = ex.Message;
                }
                ((ErrorWeb)this.phErrores.Controls[0]).setMensaje(mensaje);
            }
        }