コード例 #1
0
 /// <summary>
 /// Muestra resumen de la regla que se desea activar asi como las demas reglas pertenecientes
 /// al mismo corporativo si es que existen
 /// </summary>
 private void ShowInformation()
 {
     listInfoFeeRule = GetInfoFeeRuleByAttribute1BL.GetInfoFeeRule(null, Convert.ToInt32(txtRuleNumber.Text), Login.OrgId);
     if (listInfoFeeRule.Count == 0)
     {
         MessageBox.Show("EL NÚMERO DE REGLA DE CARGO POR SERVICIO NO EXISTE", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
         txtRuleNumber.Focus();
     }
     else if (listInfoFeeRule.Count > 1)
     {
         for (int i = 0; i < listInfoFeeRule.Count; i++)
         {
             if (listInfoFeeRule[i].RuleNumber.Equals(Convert.ToInt32(txtRuleNumber.Text)))
             {
                 aux   = i;
                 agent = listInfoFeeRule[i].Agent;
                 corp  = listInfoFeeRule[i].Attribute1;
                 break;
             }
         }
         if (listInfoFeeRule[aux].ActivationSatate)
         {
             MessageBox.Show("EL NÚMERO DE REGLA DE CARGO POR SERVICIO YA SE ENCUENTRA ACTIVA", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
             Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME);
         }
         else
         {
             btnAccept.Visible           = false;
             lblInfoRuleByAttribute.Text = string.Concat("La regla ", txtRuleNumber.Text, " pertenece al corporativo ", listInfoFeeRule[0].Attribute1,
                                                         " el cual contiene las siguientes\nreglas:");
             attribute1 = listInfoFeeRule[0].Attribute1;
             string info            = string.Empty;
             int    indexRuleNumber = 0;
             for (int i = 0; i < listInfoFeeRule.Count; i++)
             {
                 if (listInfoFeeRule[i].RuleNumber == Convert.ToInt32(txtRuleNumber.Text))
                 {
                     indexRuleNumber = i;
                 }
                 info = string.Concat(info, "Regla: ", listInfoFeeRule[i].RuleNumber);
                 info = string.Concat(info, "\n", "Descripción: ", listInfoFeeRule[i].Description);
                 info = string.Concat(info, "\n", "Prioridad: ", listInfoFeeRule[i].Priority);
                 info = string.Concat(info, "\n", "% De Tarifa Base: ", listInfoFeeRule[i].DefaultFee);
                 info = string.Concat(info, "\n", "Cantidad Fija: ", listInfoFeeRule[i].DefaultMount.ToString("0.00"));
                 info = string.Concat(info, "\n", "Monto: ", (listInfoFeeRule[i].Mandatory) ? "No Negociable" : "Negociable");
                 info = string.Concat(info, "\n", "Status: ", (listInfoFeeRule[i].ActivationSatate == true) ? "Activa" : "Inactiva", "\n");
                 if (listInfoFeeRule[i].StartDate != Types.DateNullValue)
                 {
                     info = string.Concat(info, "Inicio de regla: ", listInfoFeeRule[i].StartDate.ToString("dd-MM-yyyy"), "\n");
                 }
                 if (listInfoFeeRule[i].ExpirationDate != Types.DateNullValue)
                 {
                     info = string.Concat(info, "Fin de regla: ", listInfoFeeRule[i].ExpirationDate.ToString("dd-MM-yyyy"), "\n");
                 }
                 info = string.Concat(info, "\n");
             }
             string[] infoList = info.Split(new char[] { '\n' });
             txtInfoRuleByAttribute1.Lines   = infoList;
             lblInfoRuleByAttribute.Visible  = true;
             txtInfoRuleByAttribute1.Visible = true;
             lblInfoActivationRule.Text      = string.Concat("La regla ", txtRuleNumber.Text, " aplica bajo los siguientes criterios:");
             listInformationRule             = GetInformationRuleAppliedBL.GetInfoRule(Convert.ToInt32(txtRuleNumber.Text), false);
             string info2 = string.Empty;
             info2 = string.Concat("% DE LA TARIFA BASE: ", listInformationRule[0].DefaultFee, "\n");
             info2 = string.Concat(info2, "Cantidad Fija: $", listInformationRule[0].DefaultMount.ToString("0.00"), "\n");
             info2 = string.Concat(info2, "Monto: ", (listInformationRule[0].Mandatory) ? "No Negociable" : "Negociable", "\n");
             if (listInfoFeeRule[indexRuleNumber].StartDate != Types.DateNullValue)
             {
                 info2 = string.Concat(info2, "Inicio de regla: ", listInfoFeeRule[indexRuleNumber].StartDate.ToString("dd-MM-yyyy"), "\n");
             }
             if (listInfoFeeRule[indexRuleNumber].ExpirationDate != Types.DateNullValue)
             {
                 info2 = string.Concat(info2, "Fin de regla: ", listInfoFeeRule[indexRuleNumber].ExpirationDate.ToString("dd-MM-yyyy"), "\n");
             }
             if (!string.IsNullOrEmpty(listInformationRule[0].Value2) && !string.IsNullOrEmpty(listInformationRule[0].Target))
             {
                 for (int i = 0; i < listInformationRule.Count; i++)
                 {
                     info2 = string.Concat(info2,
                                           listInformationRule[i].Target,
                                           ": ",
                                           listInformationRule[i].Value2,
                                           "\n");
                 }
             }
             listLocationDK = SetLocationDKNotAcceptedBL.SetLocationDKNotAccepted(Convert.ToInt32(txtRuleNumber.Text), null);
             string locationDKNotAccepted = string.Empty;
             if (listLocationDK.Count > 0)
             {
                 for (int j = 0; j < listLocationDK.Count; j++)
                 {
                     locationDKNotAccepted = string.Concat(locationDKNotAccepted, listLocationDK[j].LocationDK, ", ");
                 }
                 locationDKNotAccepted = locationDKNotAccepted.Trim().TrimEnd(new char[] { ',' });
                 info2 = string.Concat(info2, "LocationDK Excluyente: ", locationDKNotAccepted, "\n");
             }
             string[] infoList2 = info2.Split(new char[] { '\n' });
             txtInfoRuleNumber.Lines       = infoList2;
             txtInfoRuleNumber.Visible     = true;
             lblInfoActivationRule.Visible = true;
             if (statusButtons)
             {
                 btnActivation.Location = new Point(btnActivation.Location.X, btnActivation.Location.Y + 180);
                 btnClear.Location      = new Point(btnClear.Location.X, btnClear.Location.Y + 180);
                 statusButtons          = false;
             }
             btnActivation.Visible  = true;
             btnClear.Visible       = true;
             txtRuleNumber.ReadOnly = true;
             btnActivation.Focus();
         }
     }
     else if (listInfoFeeRule.Count == 1)
     {
         if (listInfoFeeRule[0].ActivationSatate)
         {
             MessageBox.Show("EL NÚMERO DE REGLA DE CARGO POR SERVICIO YA SE ENCUENTRA ACTIVA", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
             Loader.AddToPanel(Loader.Zone.Middle, this, Resources.Constants.UCWELCOME);
         }
         else
         {
             agent                       = listInfoFeeRule[0].Agent;
             corp                        = listInfoFeeRule[0].Attribute1;
             btnAccept.Visible           = false;
             lblInfoRuleByAttribute.Text = string.Concat("La regla ", txtRuleNumber.Text, " pertenece al corporativo ", listInfoFeeRule[0].Attribute1,
                                                         " y se aplica bajo los siguientes\ncriterios:");
             attribute1          = listInfoFeeRule[0].Attribute1;
             listInformationRule = GetInformationRuleAppliedBL.GetInfoRule(Convert.ToInt32(txtRuleNumber.Text), false);
             string info = string.Empty;
             info = string.Concat("% DE LA TARIFA BASE: ", listInformationRule[0].DefaultFee, "\n");
             info = string.Concat(info, "Cantidad Fija: $", listInformationRule[0].DefaultMount.ToString("0.00"), "\n");
             info = string.Concat(info, "Monto: ", (listInformationRule[0].Mandatory) ? "No Negociable" : "Negociable", "\n");
             if (listInfoFeeRule[0].StartDate != Types.DateNullValue)
             {
                 info = string.Concat(info, "Inicio de regla: ", listInfoFeeRule[0].StartDate.ToString("dd-MM-yyyy"), "\n");
             }
             if (listInfoFeeRule[0].ExpirationDate != Types.DateNullValue)
             {
                 info = string.Concat(info, "Fin de regla: ", listInfoFeeRule[0].ExpirationDate.ToString("dd-MM-yyyy"), "\n");
             }
             if (!string.IsNullOrEmpty(listInformationRule[0].Value2) && !string.IsNullOrEmpty(listInformationRule[0].Target))
             {
                 for (int i = 0; i < listInformationRule.Count; i++)
                 {
                     info = string.Concat(info,
                                          listInformationRule[i].Target,
                                          ": ",
                                          listInformationRule[i].Value2,
                                          "\n");
                 }
             }
             listLocationDK = SetLocationDKNotAcceptedBL.SetLocationDKNotAccepted(Convert.ToInt32(txtRuleNumber.Text), null);
             string locationDKNotAccepted = string.Empty;
             if (listLocationDK.Count > 0)
             {
                 for (int j = 0; j < listLocationDK.Count; j++)
                 {
                     locationDKNotAccepted = string.Concat(locationDKNotAccepted, listLocationDK[j].LocationDK, ", ");
                 }
                 locationDKNotAccepted = locationDKNotAccepted.Trim().TrimEnd(new char[] { ',' });
                 info = string.Concat(info, "LocationDK Excluyente: ", locationDKNotAccepted, "\n");
             }
             string[] infoList = info.Split(new char[] { '\n' });
             txtInfoRuleByAttribute1.Lines   = infoList;
             lblInfoRuleByAttribute.Visible  = true;
             txtInfoRuleByAttribute1.Visible = true;
             if (!statusButtons)
             {
                 btnActivation.Location = new Point(btnActivation.Location.X, btnActivation.Location.Y - 180);
                 btnClear.Location      = new Point(btnClear.Location.X, btnClear.Location.Y - 180);
                 statusButtons          = true;
             }
             btnActivation.Visible  = true;
             btnClear.Visible       = true;
             txtRuleNumber.ReadOnly = true;
             btnActivation.Focus();
         }
     }
 }
コード例 #2
0
 /// <summary>
 /// Valiada que el corporativo sea valido
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnCorp_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(txtAttribute1.Text))
     {
         MessageBox.Show("DEBE INGRESAR EL CORPORATIVO AL QUE SE LE APLICARA LA REGLA DE CARGO POR SERVICIO", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
         txtAttribute1.Focus();
     }
     else
     {
         //string[] locationDK = null;
         WsMyCTS wsServ = new WsMyCTS();
         MyCTS.Services.ValidateDKsAndCreditCards.GetOnlyAttribute1[] locationDK = null;
         try
         {
             locationDK = wsServ.GetLocationByAttribute1(txtAttribute1.Text);
         }
         catch
         {
             CommandsAPI2.send_MessageToEmulator("VALIDANDO CORPORATIVO, FAVOR DE ESPERAR........");
             listAttribute1 = new List <MyCTS.Entities.GetOnlyAttribute1>();
             listAttribute1 = GetOnlyAttribute1BL.GetAttribute1(txtAttribute1.Text);
         }
         if ((locationDK != null && locationDK.Length > 0) ||
             (listAttribute1 != null && listAttribute1.Count > 0))
         {
             if (listAttribute1 == null || listAttribute1.Count.Equals(0))
             {
                 listAttribute1 = new List <MyCTS.Entities.GetOnlyAttribute1>();
                 for (int i = 0; i < locationDK.Length; i++)
                 {
                     MyCTS.Entities.GetOnlyAttribute1 objAttribute1 = new MyCTS.Entities.GetOnlyAttribute1();
                     objAttribute1.LocationDK = locationDK[i].LocationDK;
                     listAttribute1.Add(objAttribute1);
                 }
             }
             listInfoFeeRule = GetInfoFeeRuleByAttribute1BL.GetInfoFeeRule(txtAttribute1.Text, 0, Login.OrgId);
             if (listInfoFeeRule.Count > 0)
             {
                 //mostrar info de lo que contenga la lista
                 string info = string.Empty;
                 info = string.Concat("El corporativo ", txtAttribute1.Text, " cuenta con las siguientes reglas:");
                 for (int i = 0; i < listInfoFeeRule.Count; i++)
                 {
                     info = string.Concat(info, "\n");
                     info = string.Concat(info, "\n", "Regla: ", listInfoFeeRule[i].RuleNumber);
                     info = string.Concat(info, "\n", "Nombre: ", listInfoFeeRule[i].Description);
                     info = string.Concat(info, "\n", "Prioridad: ", listInfoFeeRule[i].Priority);
                     info = string.Concat(info, "\n", "% De Tarifa Base: ", listInfoFeeRule[i].DefaultFee);
                     info = string.Concat(info, "\n", "Cantidad Fija: ", listInfoFeeRule[i].DefaultMount.ToString("0.00"));
                     info = string.Concat(info, "\n", "Monto: ", (listInfoFeeRule[i].Mandatory) ? "No Negociable" : "Negociable");
                     info = string.Concat(info, "\n", "Status: ", (listInfoFeeRule[i].ActivationSatate == true) ? "Activa" : "Inactiva");
                     if (listInfoFeeRule[i].StartDate != Types.DateNullValue)
                     {
                         info = string.Concat(info, "\n", "Inicio de regla: ", Convert.ToString(listInfoFeeRule[i].StartDate).Substring(0, 10));
                     }
                     if (listInfoFeeRule[i].ExpirationDate != Types.DateNullValue)
                     {
                         info = string.Concat(info, "\n", "Fin de regla: ", Convert.ToString(listInfoFeeRule[i].ExpirationDate).Substring(0, 10));
                     }
                 }
                 infoattribute1 = info;
                 string[] infoList = info.Split(new char[] { '\n' });
                 if (possition == true)
                 {
                     foreach (Control txt in this.Controls)
                     {
                         if (!(txt.TabIndex.Equals(0) || txt.TabIndex.Equals(1) || txt.Name == "btnCorp" || txt.Name == "txtInfoRuleByAttribute1"))
                         {
                             txt.Location = new Point(txt.Location.X, txt.Location.Y + 100);
                         }
                     }
                 }
                 possition = false;
                 txtInfoRuleByAttribute1.Lines = infoList;
                 ShowContols(true);
                 txtDescription.Focus();
             }
             else
             {
                 if (possition == false)
                 {
                     foreach (Control txt in this.Controls)
                     {
                         if (!(txt.TabIndex.Equals(0) || txt.TabIndex.Equals(1) || txt.Name == "btnCorp" || txt.Name == "txtInfoRuleByAttribute1"))
                         {
                             txt.Location = new Point(txt.Location.X, txt.Location.Y - 100);
                         }
                     }
                 }
                 possition = true;
                 ShowContols(true);
                 txtInfoRuleByAttribute1.Visible = false;
                 txtDescription.Focus();
             }
         }
         else
         {
             MessageBox.Show("EL CORPORATIVO NO EXISTE EN INTEGRA", Resources.Constants.MYCTS, MessageBoxButtons.OK, MessageBoxIcon.Information);
             txtAttribute1.Focus();
             ShowContols(false);
         }
     }
 }