Пример #1
0
        void cargarMovimientos(Int64? _idCentro, DateTime? _fecha, DateTime? _fecha2)
        {
            List<capascccmex.metadatos.movproducto> oCamposCat = new List<capascccmex.metadatos.movproducto>();
            capascccmex.biz.mov_producto obj = new capascccmex.biz.mov_producto();

            try
            {
                oCamposCat = obj.GetBizProducto02(null, null, null, null, _idCentro, null, null, null, null, _fecha, _fecha2, false, 0, 0);
                Session["getCamposCatMovimiento"] = oCamposCat;
                gridCapturas.DataSource = oCamposCat;
                gridCapturas.DataBind();
                gridCapturas.Rebind();
                //----------------------------------------

            }
            catch (SqlException ex)
            {
                convertir.log("Error: " + ex.Message.ToString() + ", fecha: " + DateTime.Now.ToString());
                windowManager1.RadAlert("Error: " + ex.Message.ToString(), 300, 100, "Cargando relación de movimientos", null);
            }
        }
        void cargarMovimientosByServicio(String ordenServicio, int producto, string title)
        {
            List <capascccmex.metadatos.movproducto> oCamposCat = new List <capascccmex.metadatos.movproducto>();

            capascccmex.biz.mov_producto obj = new capascccmex.biz.mov_producto();
            //1:propileno, 2:turbosina
            string sproc = producto == 1 ? "dbo.proc_getOrdenServicioByServicioP" : "dbo.proc_getOrdenServicioByServicioT";

            try
            {
                oCamposCat = obj.GetBizAcumuladoServicioOS(sproc, ordenServicio);
                var sum = oCamposCat.Select(c => c.Cant_insp_mezcla).Sum();
                gridServicio.MasterTableView.Caption = title + string.Format(", RESTANTE: {0:##,##0.000} - {1:##,##0.000} = {2:##,##0.000}", regresaVolumenOrden(ordenServicio), sum, (regresaVolumenOrden(ordenServicio) - sum));
                gridServicio.DataSource = oCamposCat;
                gridServicio.DataBind();
                gridServicio.Rebind();
                //----------------------------------------
            }
            catch (SqlException ex)
            {
                convertir.log("Error acum serv: " + ex.Message.ToString() + ", fecha: " + DateTime.Now.ToString());
                windowManager1.RadAlert("Error: " + ex.Message.ToString(), 300, 100, "Cargando acumulado por servicio", null);
            }
        }
Пример #3
0
        void cargarMovimientosByCentro(Int16?anio, Int16?mes, int producto, string title)
        {
            List <capascccmex.metadatos.movproducto> oCamposCat = new List <capascccmex.metadatos.movproducto>();

            capascccmex.biz.mov_producto obj = new capascccmex.biz.mov_producto();
            //1:propileno, 2:turbosina
            string sproc = producto == 1 ? "dbo.proc_getmov_productoByCentroServiciop" : "dbo.proc_getmov_productoByCentroServiciot";

            try
            {
                oCamposCat = obj.GetBizAcumuladoCentro(sproc, anio, mes);
                var sum = oCamposCat.Select(c => c.Cant_insp_mezcla).Sum();
                gridcentro.MasterTableView.Caption = title + string.Format(", TOTAL: {0:##,##0.000}", sum);
                gridcentro.DataSource = oCamposCat;
                gridcentro.DataBind();
                gridcentro.Rebind();
                //----------------------------------------
            }
            catch (SqlException ex)
            {
                convertir.log("Error acum centro: " + ex.Message.ToString() + ", fecha: " + DateTime.Now.ToString());
                windowManager1.RadAlert("Error: " + ex.Message.ToString(), 300, 100, "Cargando acumulado por centro", null);
            }
        }
Пример #4
0
        protected void cmdejecuta_Click(object sender, EventArgs e)
        {
            try
            {

                RadComboBox cmbcat1 = (RadComboBox)RadPanelBar1.FindItemByValue("info").FindControl("cmbservicio");
                RadComboBox cmbcat2 = (RadComboBox)RadPanelBar1.FindItemByValue("info").FindControl("cmbproducto");
                RadComboBox cmbcat3 = (RadComboBox)RadPanelBar1.FindItemByValue("info").FindControl("cmbcentro");

                RadButton rbt1 = (RadButton)RadPanelBar1.FindItemByValue("info").FindControl("rbtDefault");
                RadButton rbt2 = (RadButton)RadPanelBar1.FindItemByValue("info").FindControl("rbtRevisado");
                RadButton rbt3 = (RadButton)RadPanelBar1.FindItemByValue("info").FindControl("rbtTramite");
                RadButton rbt4 = (RadButton)RadPanelBar1.FindItemByValue("info").FindControl("rbtCancel");
                RadButton rbt5 = (RadButton)RadPanelBar1.FindItemByValue("info").FindControl("rbtaceptadopag");
                RadButton rbt6 = (RadButton)RadPanelBar1.FindItemByValue("info").FindControl("rbtarechazadopag");

                RadButton rbtimp = (RadButton)RadPanelBar1.FindItemByValue("info").FindControl("rbtnBarco");

                RadDatePicker rdp1 = (RadDatePicker)RadPanelBar1.FindItemByValue("info").FindControl("rdpFechaIni");
                RadDatePicker rdp2 = (RadDatePicker)RadPanelBar1.FindItemByValue("info").FindControl("rdpFechaFin");

                RadButton rbt7 = (RadButton)RadPanelBar1.FindItemByValue("info").FindControl("rbtAnio");
                RadButton rbt8 = (RadButton)RadPanelBar1.FindItemByValue("info").FindControl("rbtAniomes");

                Int64? _centro = cmbcat3.SelectedValue.Length > 0 ? convertir.toNInt64(cmbcat3.SelectedValue) : null;
                Int64? _prod = cmbcat2.SelectedValue.Length > 0 ? convertir.toNInt64(cmbcat2.SelectedValue) : null;
                String _serv = cmbcat1.SelectedValue.Length > 0 ? cmbcat1.SelectedValue.ToString() : null;
                String _rpagado = null;
                String _rrevisado = null;

                if (rbt1.Checked == true)
                    _rrevisado = "N";
                else if (rbt2.Checked == true)
                    _rrevisado = "S";
                else if (rbt3.Checked == true)
                    _rrevisado = "T";
                else if (rbt4.Checked == true)
                    _rrevisado = "C";
                else
                    _rrevisado = null;

                if (rbt5.Checked == true)
                    _rpagado = "A";
                else if (rbt6.Checked == true)
                    _rpagado = "P";
                else
                    _rpagado = null;



                DateTime? f1 = rdp1.SelectedDate.HasValue == true ? convertir.toNDateTime(string.Format("{0:dd/MM/yyyy}", rdp1.SelectedDate.Value)) : null;
                DateTime? f2 = rdp2.SelectedDate.HasValue == true ? convertir.toNDateTime(string.Format("{0:dd/MM/yyyy}", rdp2.SelectedDate.Value)) : null;

                bool? bi = Convert.ToBoolean(rbtimp.Checked);
                if (bi == false) bi = null;

                Int16? anio = null;
                Int16? mes = null;
                if (f1.HasValue)
                {

                    anio = rbt7.Checked == true ? convertir.toNInt16(rdp1.SelectedDate.Value.Year) : null;

                    if (rbt8.Checked == true)
                    {
                        anio = convertir.toNInt16(rdp1.SelectedDate.Value.Year);
                        mes = convertir.toNInt16(rdp1.SelectedDate.Value.Month);
                    }

                }

                List<capascccmex.metadatos.movproducto> oCamposCat = new List<capascccmex.metadatos.movproducto>();
                capascccmex.biz.mov_producto obj = new capascccmex.biz.mov_producto();

                oCamposCat = obj.GetBizProducto02(null, _rrevisado, _rpagado, _prod, _centro, _serv, null, anio, mes, f1, f2, bi, 0, 0);
                Session["getCamposCatMovimiento"] = oCamposCat;
                gridCapturas.DataSource = oCamposCat;
                gridCapturas.DataBind();
                gridCapturas.Rebind();
                //----------------------------------------

            }
            catch (Exception ex)
            {
                convertir.log("Error: " + ex.Message.ToString() + ", fecha: " + DateTime.Now.ToString());
                windowManager1.RadAlert("Error: " + ex.Message.ToString(), 300, 100, "Cargando info", null);
            }
        }