Exemplo n.º 1
0
 private void MakeResponse(ExchangeRequest req, string responseType, string refuseReason)
 {
     RESFORM source = new RESFORM {
         TYPE_REQ = new RESFORMTYPE_REQ()
     };
     source.TYPE_REQ.QUERY_ID = req.QueryId;
     source.TYPE_REQ.GUID = req.Guid;
     source.TYPE_REQ.TYPE = req.Type;
     source.TYPE_REQ.TYPE_NAME = "Получение справки о начислениях и оплате для единого окна";
     source.TYPE_RES = new RESFORMTYPE_RES();
     source.TYPE_RES.TYPE = this.cbRefuse.get_Checked() ? ((byte) 1) : ((byte) 0);
     source.TYPE_RES.TYPE_NAME = responseType;
     source.TYPE_RES.DATE_RES = System.DateTime.Today.ToShortDateString();
     source.BODY_RES = new RESFORMBODY_RES();
     source.BODY_RES.USER = "******";
     source.BODY_RES.AREA = AIS.SN.Model.Constants.OrgName;
     source.BODY_RES.REASON = refuseReason;
     source.BODY_RES.FORM = "";
     source.BODY_RES.FORMXML = "";
     string inxml = Serializer.ToXml<RESFORM>(source, (System.Text.Encoding) System.Text.Encoding.Unicode);
     string str2 = new DocsVisionWebService().RespondSnDg(inxml);
     XmlDocument document = new XmlDocument();
     document.LoadXml(str2);
     string str3 = document.GetElementsByTagName("CODE").get_ItemOf(0).get_InnerText();
     if (str3 != "0")
     {
         string str4 = document.GetElementsByTagName("ERROR").get_ItemOf(0).get_InnerText();
         System.ApplicationException exception = new System.ApplicationException(string.Concat((string[]) new string[] { "Ошибка отправки сообщения", System.Environment.get_NewLine(), "Код ошибки: ", str3, System.Environment.get_NewLine(), "Сообщение: ", str4 }));
         exception.Data.Add("Code", str3);
         exception.Data.Add("Error", str4);
         throw exception;
     }
     req.XmlOut = inxml;
     req.Status = ExchangeStatus.Processed;
     req.Update();
 }
Exemplo n.º 2
0
 private void MakeResponse(ExchangeRequest req, string responseType, string refuseReason)
 {
     RESFORM source = new RESFORM {
         TYPE_REQ = new RESFORMTYPE_REQ()
     };
     source.TYPE_REQ.GUID = req.Guid;
     source.TYPE_REQ.TYPE = req.Type;
     source.TYPE_REQ.TYPE_NAME = "Регистрация данных о счетчике";
     source.TYPE_RES = new RESFORMTYPE_RES();
     source.TYPE_RES.TYPE = !this.cbRefuse.get_Checked() ? ((int) 0) : ((int) 1);
     source.TYPE_RES.TYPE_NAME = responseType;
     source.TYPE_RES.DATE_RES = System.DateTime.Today.ToShortDateString();
     source.BODY_RES = new RESFORMBODY_RES();
     source.BODY_RES.USER = User.CurrentUser.Name;
     source.BODY_RES.AREA = Constants.OrgName;
     source.BODY_RES.REASON = refuseReason;
     source.BODY_RES.FORM = string.Empty;
     source.BODY_RES.FORMXML = string.Empty;
     source.BODY_RES.FORM_SIGNATURE = new byte[0];
     source.BODY_RES.FORMXML_SIGNATURE = new byte[0];
     string inxml = Serializer.ToXml<RESFORM>(source, (System.Text.Encoding) System.Text.Encoding.Unicode);
     string str2 = new DocsVisionWebService().RespondSnDg(inxml);
     XmlDocument document = new XmlDocument();
     document.LoadXml(str2);
     string str3 = document.GetElementsByTagName("CODE").get_ItemOf(0).get_InnerText();
     if (str3 != "0")
     {
         string str4 = document.GetElementsByTagName("ERROR").get_ItemOf(0).get_InnerText();
         System.ApplicationException exception = new System.ApplicationException(string.Concat((string[]) new string[] { "Ошибка отправки сообщения", System.Environment.get_NewLine(), "Код ошибки: ", str3, System.Environment.get_NewLine(), "Сообщение: ", str4 }));
         throw exception;
     }
     req.XmlOut = inxml;
     req.Status = ExchangeStatus.Processed;
     req.Update();
 }
Exemplo n.º 3
0
 private void MakeResponse(ExchangeRequest req, string responseType, string refuseReason, string exportedReport, string xml)
 {
     RESFORM source = new RESFORM {
         TYPE_REQ = new RESFORMTYPE_REQ()
     };
     source.TYPE_REQ.QUERY_ID = req.QueryId;
     source.TYPE_REQ.GUID = req.Guid;
     source.TYPE_REQ.TYPE = req.Type;
     source.TYPE_REQ.TYPE_NAME = "Получение справки о начислениях и оплате для единого окна";
     source.TYPE_RES = new RESFORMTYPE_RES();
     source.TYPE_RES.TYPE = string.IsNullOrEmpty(exportedReport) ? ((byte) 1) : ((byte) 0);
     source.TYPE_RES.TYPE_NAME = responseType;
     source.TYPE_RES.DATE_RES = System.DateTime.Today.ToShortDateString();
     source.BODY_RES = new RESFORMBODY_RES();
     source.BODY_RES.USER = User.CurrentUser.Name;
     source.BODY_RES.AREA = AIS.SN.Model.Constants.OrgName;
     source.BODY_RES.REASON = refuseReason;
     source.BODY_RES.FORM = exportedReport;
     source.BODY_RES.FORMXML = xml;
     source.BODY_RES.FORM_SIGNATURE = new byte[0];
     source.BODY_RES.FORMXML_SIGNATURE = new byte[0];
     if (this.cbCrypt.get_Checked() && (exportedReport != ""))
     {
         Utilities utilities = new UtilitiesClass();
         source.BODY_RES.FORM_SIGNATURE = new ForBytes().Sign(System.Convert.FromBase64String(exportedReport));
         source.BODY_RES.FORMXML_SIGNATURE = new ForBytes().Sign((byte[]) utilities.BinaryStringToByteArray(xml));
     }
     string inxml = Serializer.ToXml<RESFORM>(source, (System.Text.Encoding) System.Text.Encoding.Unicode);
     string str2 = new DocsVisionWebService().RespondSnDg(inxml);
     XmlDocument document = new XmlDocument();
     document.LoadXml(str2);
     string str3 = document.GetElementsByTagName("CODE").get_ItemOf(0).get_InnerText();
     if (str3 != "0")
     {
         string str4 = document.GetElementsByTagName("ERROR").get_ItemOf(0).get_InnerText();
         System.ApplicationException exception = new System.ApplicationException(string.Concat((string[]) new string[] { "Ошибка отправки сообщения", System.Environment.get_NewLine(), "Код ошибки: ", str3, System.Environment.get_NewLine(), "Сообщение: ", str4 }));
         throw exception;
     }
     req.XmlOut = inxml;
     req.Status = ExchangeStatus.Processed;
     req.Update();
 }