Пример #1
0
        public void Obtener_MetaPresupuestoCabDet(int idEmpresa, int codigoUsuario, int anno, int mes, string id_vendedor,
                                                  ref USP_Sel_MetaPresupuestoCabResult eMetaPreCab, ref List <USP_Sel_MetaPresupuestoDetResult> lstMetaPreDet)
        {
            PlanificacionBL objPlanificacion = new PlanificacionBL();

            try
            {
                objPlanificacion.Obtener_MetaPresupuestoCabDet(idEmpresa, codigoUsuario, anno, mes, id_vendedor,
                                                               ref eMetaPreCab, ref lstMetaPreDet);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #2
0
        public void Obtener_MetaPresupuestoCabDet(int idEmpresa, int codigoUsuario, int anno, int mes, string id_vendedor,
                                                  ref USP_Sel_MetaPresupuestoCabResult eMetaPreCab, ref List <USP_Sel_MetaPresupuestoDetResult> lstMetaPreDet)
        {
            using (dmIntranetDataContext dci = new dmIntranetDataContext(GS.configuration.Init.GetValue(Constant.sistema, Constant.key, "genesys")))
            {
                dmGenesysDataContext dcg = new dmGenesysDataContext(string.Format(GS.configuration.Init.GetValue(Constant.sistema, Constant.key, dci.Empresa.SingleOrDefault(x => x.idEmpresa == idEmpresa).baseDatos), "usrGEN" + (10000 + codigoUsuario).ToString().Substring(1, 4)));

                try
                {
                    eMetaPreCab   = dcg.USP_Sel_MetaPresupuestoCab(anno, mes, id_vendedor).ToList().First();
                    lstMetaPreDet = dcg.USP_Sel_MetaPresupuestoDet(anno, mes, id_vendedor).ToList();
                }
                catch (Exception ex)
                {
                    dci.Excepcion_Registrar(ex.Message, ex.TargetSite.Name);
                    dci.SubmitChanges();
                    throw new ArgumentException("ERROR EN EL SERVICIO: No se pudo listar los presupuestos");
                }
            }
        }
Пример #3
0
        private void CargarPresupuesto(int anno, int mes, string id_vendedor)
        {
            USP_Sel_MetaPresupuestoCabResult eCab = new USP_Sel_MetaPresupuestoCabResult();

            _lstdetalle = new List <USP_Sel_MetaPresupuestoDetResult>();
            USP_Sel_MetaPresupuestoDetResult[] lstdet = null;

            objPlanificacion = new PlanificacionWCFClient();
            objPlanificacion.Obtener_MetaPresupuestoCabDet(
                ((Usuario_LoginResult)HttpContext.Current.Session["Usuario"]).idEmpresa,
                ((Usuario_LoginResult)HttpContext.Current.Session["Usuario"]).codigoUsuario, anno, mes, id_vendedor, ref eCab, ref lstdet);
            _lstdetalle = lstdet.ToList();
            CargarVendedorZona();
            rmyPre.SelectedDate = new DateTime(eCab.Anno, eCab.Mes, 1);
            lblestado.Text      = eCab.Aprobado == true ? "Aprobado" : "Registrado";

            rmyPre.Enabled     = eCab.Aprobado == true ? false : ((_lstdetalle.Any()) ? false : true);
            btnguardar.Enabled = eCab.Aprobado == true ? false : true;
            btnagregar.Enabled = eCab.Aprobado == true ? false : true;

            gvwItems.DataSource = _lstdetalle;
            gvwItems.DataBind();
            Session["lstdetalle"] = JsonHelper.JsonSerializer(_lstdetalle);
        }