Пример #1
0
 protected override void Fill(ObjectWithId obj)
 {
     ExchangeRequest request = (ExchangeRequest) obj;
     REQ534 req = Serializer.FromXml<REQ534>(request.XmlIn);
     this.labelType.set_Text((string) new string[] { "Новый счетчик", "Счетчик опломбирован", "Счетчик снят", "Контрольные показания" }[req.TYPE_REQ.TYPE - 0x216]);
     this.tbFrom.set_Text(req.ORG.NAMEORG + "," + req.ORG.FIO);
     string str = string.Empty;
     if (!string.IsNullOrEmpty(req.BODY_REQ.PERSON.LAST_NAME))
     {
         str = str + req.BODY_REQ.PERSON.LAST_NAME + ' ';
     }
     if (!string.IsNullOrEmpty(req.BODY_REQ.PERSON.FIRST_NAME))
     {
         str = str + req.BODY_REQ.PERSON.FIRST_NAME + ' ';
     }
     if (!string.IsNullOrEmpty(req.BODY_REQ.PERSON.MIDDLE_NAME))
     {
         str = str + req.BODY_REQ.PERSON.MIDDLE_NAME + ' ';
     }
     if (!string.IsNullOrEmpty(req.BODY_REQ.PERSON.BIRTH_DATE))
     {
         str = str + req.BODY_REQ.PERSON.BIRTH_DATE + "г.р. ";
     }
     str = str + req.BODY_REQ.PERSON.CONTACT_DATA;
     this.fIO.set_Text(str);
     str = string.Empty;
     if (!string.IsNullOrEmpty(req.BODY_REQ.ADDRESS.CITY))
     {
         str = str + req.BODY_REQ.ADDRESS.CITY + ", ";
     }
     if (!string.IsNullOrEmpty(req.BODY_REQ.ADDRESS.STREET_NAME))
     {
         str = str + req.BODY_REQ.ADDRESS.STREET_TYPE + req.BODY_REQ.ADDRESS.STREET_NAME + ", ";
     }
     if (!string.IsNullOrEmpty(req.BODY_REQ.ADDRESS.HOUSE))
     {
         str = str + req.BODY_REQ.ADDRESS.HOUSE + '-';
     }
     if (!string.IsNullOrEmpty(req.BODY_REQ.ADDRESS.FLAT))
     {
         str = str + req.BODY_REQ.ADDRESS.FLAT;
     }
     this.apartmentAddress.set_Text(str);
     this.tbxPurpose.set_Text(req.BODY_REQ.COUNTER.PURPOSE);
     this.tbxPointAccount.set_Text(req.BODY_REQ.COUNTER.POINT_ACCOUNTING);
     this.tbPlomb.set_Text(req.BODY_REQ.COUNTER.STAMP);
     this.tbNumber.set_Text(req.BODY_REQ.COUNTER.NUMBER);
     this.tbName.set_Text(req.BODY_REQ.COUNTER.NAME);
     this.nudCounterSize.set_Text(req.BODY_REQ.COUNTER.SIZE);
     this.nudFactor.set_Text(req.BODY_REQ.COUNTER.FACTOR);
     this.cbMaddle.set_Text(req.BODY_REQ.COUNTER.MADDLE_TYPE);
     this.cbMark.set_Text(req.BODY_REQ.COUNTER.MARK);
     this.cbPlace.set_Text(req.BODY_REQ.COUNTER.PLACE);
     this.cbType.set_Text(req.BODY_REQ.COUNTER.TYPE);
     this.cbTypeScaleCounter.set_Text(req.BODY_REQ.COUNTER.TYPE_SCALE_COUNTER);
     this.dbBegin.set_Text(req.BODY_REQ.COUNTER.DATEB);
     this.dbEnd.set_Text(req.BODY_REQ.COUNTER.DATEE);
     this.dbStamp.set_Text(req.BODY_REQ.COUNTER.STAMP_DATE);
     this.controlDate.set_Text(req.BODY_REQ.COUNTER.CONTROL_DATE);
     this.controlIndication.set_Text(req.BODY_REQ.COUNTER.CONTROL_INDICATION);
     if (request.Account == null)
     {
         foreach (Apartment apartment in Apartment.FindByAddress(request.Address))
         {
             this.listApartments.Items.Add(apartment);
         }
     }
     else
     {
         this.listApartments.Items.Add(request.Account.GetApartment());
     }
     if (this.listApartments.Items.get_Count() > 0)
     {
         this.listApartments.set_SelectedIndex(0);
     }
     if (!string.IsNullOrEmpty(req.ORG.SIGNATURE))
     {
         try
         {
             ForQuery query = new ForQuery();
             this.labelSign.set_Text("Цифровая подпись: " + query.Check(req.ORG.FIO, req.ORG.SIGNATURE));
             return;
         }
         catch (System.Runtime.InteropServices.COMException exception)
         {
             AIS.SN.UI.Messages.ShowException(base.FindForm(), new System.ApplicationException("Ошибка при проверке цифровой подписи.", exception));
             return;
         }
     }
     this.labelSign.set_Text("Цифровая подпись отсутсвует. Регистратор: " + req.ORG.FIO);
     this.labelSign.set_ForeColor(System.Drawing.Color.Red);
 }
Пример #2
0
 protected override void Fill(ObjectWithId obj)
 {
     ExchangeRequest request = (ExchangeRequest) obj;
     REQ502 req = Serializer.FromXml<REQ502>(request.XmlIn);
     this.lastName.set_Text(req.BODY_REQ.PERSON.LAST_NAME);
     this.firstName.set_Text(req.BODY_REQ.PERSON.FIRST_NAME);
     this.middleName.set_Text(req.BODY_REQ.PERSON.MIDDLE_NAME);
     this.birthDate.set_Text(req.BODY_REQ.PERSON.BIRTH_DATE);
     this.phone.set_Text(req.BODY_REQ.PERSON.PHONE);
     this.city.set_Text(req.BODY_REQ.ADDRESS.CITY);
     this.street.set_Text(req.BODY_REQ.ADDRESS.STREET_NAME);
     this.house.set_Text(req.BODY_REQ.ADDRESS.HOUSE);
     this.flat.set_Text(req.BODY_REQ.ADDRESS.FLAT);
     this.address.set_Text((request.Address == null) ? ((string) "не разобран") : request.Address.ToString());
     if (request.Account == null)
     {
         foreach (Apartment apartment in Apartment.FindByAddress(request.Address))
         {
             foreach (Account account in apartment.GetAccounts())
             {
                 this.listAccounts.Items.Add(account);
             }
         }
     }
     else
     {
         this.listAccounts.Items.Add(request.Account);
     }
     if (this.listAccounts.Items.get_Count() > 0)
     {
         this.listAccounts.set_SelectedIndex(0);
     }
     this.datePeriod.DateBegin = System.Convert.ToDateTime(req.BODY_REQ.DATEB);
     this.datePeriod.DateEnd = System.Convert.ToDateTime(req.BODY_REQ.DATEE);
     this.printForm.set_Text((req.BODY_REQ.PRINT == 0) ? ((string) "ДА") : ((string) "НЕТ"));
     if (!string.IsNullOrEmpty(req.SIGNATURE))
     {
         ForQuery query = new ForQuery();
         try
         {
             this.labelSign.set_Text("Цифровая подпись: " + query.Check(req.ORG.FIO, req.SIGNATURE));
             goto Label_02C8;
         }
         catch (System.Exception exception)
         {
             AIS.SN.UI.Messages.ShowException(base.FindForm(), new System.ApplicationException("Ошибка при проверке цифровой подписи.", exception));
             goto Label_02C8;
         }
     }
     this.labelSign.set_Text("Цифровая подпись отсутсвует. Регистратор: " + req.ORG.FIO);
     this.labelSign.set_ForeColor(System.Drawing.Color.Red);
     Label_02C8:
     if (req.BODY_REQ.DOCS == null)
     {
         return;
     }
     REQ502.REQBODY_REQ.REQBODY_REQDOC[] dOCS = req.BODY_REQ.DOCS;
     for (int i = 0; i < dOCS.Length; i = (int) (i + 1))
     {
         REQ502.REQBODY_REQ.REQBODY_REQDOC reqbody_reqdoc = dOCS[i];
         try
         {
             if (string.IsNullOrEmpty(reqbody_reqdoc.DOC_BODY))
             {
                 throw new System.ApplicationException("Отсутствует изображение документа.");
             }
             DocVisionPersonDocument document = new DocVisionPersonDocument(reqbody_reqdoc.DOC_NAME);
             document.SetImage(reqbody_reqdoc.DOC_BODY);
             this.docs.Items.Add(document);
         }
         catch (System.Exception exception2)
         {
             AIS.SN.UI.Messages.ShowException(base.FindForm(), new System.ApplicationException("Ошибка при загрузке изображения.", exception2));
         }
     }
 }