示例#1
0
 protected void ddlCuenta_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         this.ddlMes.Items.Clear();
         this.ddlMes.Items.Add("Seleccione un Mes");
         this.ddlMes.Enabled = false;
         if (this.ddlCuenta.SelectedIndex > 0)
         {
             RespuestaCmesdidsjv respuestaCmesdidsjv = HelperIbs.ibsConMesDisp(base.Afiliado.AF_CodCliente, base.Afiliado.sAF_Rif, this.ddlCuenta.getCuenta().SNroCuenta);
             string          sVecMesDip = respuestaCmesdidsjv.cmesdidsjv.SVecMesDip;
             List <DateTime> dateTimes  = new List <DateTime>();
             int             num        = 0;
             while (num < sVecMesDip.Length)
             {
                 string str = sVecMesDip.Substring(num, 4);
                 if (!str.Contains("0000"))
                 {
                     int num1 = int.Parse(str.Substring(0, 2));
                     int num2 = int.Parse(str.Substring(2, 2));
                     dateTimes.Add(new DateTime(num2, num1, 1));
                     num += 3;
                     num++;
                 }
                 else
                 {
                     break;
                 }
             }
             dateTimes.Sort((DateTime i, DateTime j) => ((IComparable)(object)j).CompareTo(i));
             foreach (DateTime dateTime in dateTimes)
             {
                 ListItem listItem = new ListItem()
                 {
                     Text  = Calendario.MonthName(dateTime.Month),
                     Value = dateTime.ToString("MMyy")
                 };
                 this.ddlMes.Items.Add(listItem);
                 this.ddlMes.Enabled = true;
             }
         }
         else
         {
             this.ddlCuenta.ClearSelection();
             this.ddlMes_SelectedIndexChanged(null, null);
         }
     }
     catch (IBException bException)
     {
         WebUtils.MessageBox2005(this, bException.IBMessage);
     }
 }
示例#2
0
        public static RespuestaCmesdidsjv ibsConMesDisp(long SUserId, string SCedRif, string SNroCta)
        {
            CmesdidsjvIn cmesdidsjvIn = new CmesdidsjvIn()
            {
                SUserId = SUserId.ToString(),
                SCedRif = SCedRif,
                SNroCta = SNroCta
            };
            RespuestaCmesdidsjv respuestaCmesdidsjv = null;

            using (IbsServiceService ibsServiceService = new IbsServiceService())
            {
                ibsServiceService.Timeout = 15000;
                try
                {
                    respuestaCmesdidsjv = ibsServiceService.ibaConMesDisp(cmesdidsjvIn);
                    if (respuestaCmesdidsjv == null)
                    {
                        throw new IBException(9998, "SQLIB");
                    }
                    if (!string.IsNullOrEmpty(respuestaCmesdidsjv.SError))
                    {
                        throw new IBException(respuestaCmesdidsjv.SError, "SQLIB");
                    }
                    if (respuestaCmesdidsjv.cmesdidsjv == null)
                    {
                        throw new IBException(9998, "SQLIB");
                    }
                    if ((respuestaCmesdidsjv.cmesdidsjv.EErrores == null ? false : !string.IsNullOrEmpty(respuestaCmesdidsjv.cmesdidsjv.EErrores.SVectorCod)))
                    {
                        throw new IBException(respuestaCmesdidsjv.cmesdidsjv.EErrores.SVectorCod, "IBS");
                    }
                }
                catch (WebException webException)
                {
                    throw new IBException(9997, "SQLIB");
                }
                catch (SoapException soapException)
                {
                    throw new IBException(9997, "SQLIB");
                }
            }
            return(respuestaCmesdidsjv);
        }