Пример #1
0
        public createDocResponse createDoc([System.Xml.Serialization.XmlElementAttribute("createDoc", Namespace = "http://BudjetLib/interfaces/bossnewdoc/IccBossNewDoc")] createDoc createDoc1)
        {
            object[] results = this.Invoke("createDoc", new object[] {
                createDoc1
            });

            return((createDocResponse)(results[0]));
        }
Пример #2
0
 /// <remarks/>
 public void createDocAsync(createDoc createDoc1, object userState)
 {
     if ((this.createDocOperationCompleted == null))
     {
         this.createDocOperationCompleted = new System.Threading.SendOrPostCallback(this.OncreateDocOperationCompleted);
     }
     this.InvokeAsync("createDoc", new object[] {
         createDoc1
     }, this.createDocOperationCompleted, userState);
 }
        public void ExportBillDemand(BillDemandForExport billDemandForExport)
        {
           
            using (var client = new IccBossNewDocExport_IccBossNewDocHttpService())
            {
                createDoc doc = new createDoc()
                                    {
                                        request = new BossNewDocRequest()
                                                      {
                                                          idPaydoc = billDemandForExport.Id.ToString("N"),
                                                          basePayDocIds =
                                                              billDemandForExport.PaymentPlanItemIds.Select(
                                                                  p => p.ToString(CultureInfo.InvariantCulture)).ToArray
                                                              (),
                                                          currCode = billDemandForExport.CurrencyCode,
                                                          currCourseDate = billDemandForExport.CurrencyRevisionDate,
                                                          currCourseDateSpecified = true,
                                                          custIdFrom =
                                                              billDemandForExport.CustomerCounteragentId.ToString(
                                                                  CultureInfo.InvariantCulture),
                                                          custIdTo =
                                                              billDemandForExport.CounteragentId.ToString(
                                                                  CultureInfo.InvariantCulture),
                                                          docDate =
                                                              billDemandForExport.DocumentDate,
                                                          docDateSpecified = true,
                                                          rDocDate = string.Format("{0:yyyy-MM-dd}",billDemandForExport.DocumentDate),
                                                          sDocStringNum = billDemandForExport.Number,
                                                          idFirm = billDemandForExport.FirmCode,
                                                          docStringNum = billDemandForExport.IdNumber.ToString(CultureInfo.InvariantCulture),
                                                          rDocStringNum = billDemandForExport.IdNumber.ToString(CultureInfo.InvariantCulture),
                                                          rootDocId =
                                                              billDemandForExport.ContractId.ToString(
                                                                  CultureInfo.InvariantCulture),
                                                          typeDoc = TypeDoc,
                                                          taxString =
                                                              billDemandForExport.NDSTaxValue.ToString("0.00",
                                                                                                       CultureInfo.
                                                                                                           CreateSpecificCulture
                                                                                                           ("en-US")),
                                                          docSum =
                                                              billDemandForExport.SumWIthNDS.ToString("0.00",
                                                                                                      CultureInfo.
                                                                                                          CreateSpecificCulture
                                                                                                          ("en-US")),
                                                          rUserSmeta = billDemandForExport.BudgetPartId.ToString(CultureInfo.InvariantCulture),
                                                          rUserExpenses = billDemandForExport.SmetaCode,
                                                          rUserCfuExpenses = billDemandForExport.OPCode,
                                                          rUserCfuPotreb = billDemandForExport.PPCode,
                                                          rUserProject = billDemandForExport.ProjectCode

                                                      }
                                    };

                if (billDemandForExport.AccountDate.HasValue)
                {
                    doc.request.sDocDate = billDemandForExport.AccountDate.Value;
                    doc.request.sDocDateSpecified = true;
                }
                else
                {
                    doc.request.sDocDateSpecified = false;
                }

#if DEBUG
                return;
               // throw new InvalidOperationException("sad");
#else
                try
                {
                    var response = client.createDoc(doc);
                    if (response.response.respCode != 0)
                        throw new InvalidOperationException(
                            string.Format("Не удалось выгрузить документ BillDemandId = {0} Описание ошибки = {1}",
                                          billDemandForExport.Id, response.response.errDesc));
                }
                catch (SoapException ex)
                {
                    Logger.Log.Error(string.Format("Не удалось выгрузить документ BillDemandId = {0} Описание ошибки = {1}", billDemandForExport.Id,ex.Detail.InnerText));
                    Logger.Log.Error(string.Format("Не удалось выгрузить документ BillDemandId = {0} Описание ошибки = {1}", billDemandForExport.Id, ex.Message));
                    string[] errorMessages = ex.Detail.InnerText.Split(']');
                    string errorMessage = errorMessages[errorMessages.Length - 1];

                    throw new InvalidOperationException(
                        string.Format("Не удалось выгрузить документ BillDemandId = {0} Описание ошибки = {1}", billDemandForExport.Id, string.IsNullOrEmpty(errorMessage) ? "Не определено" : errorMessage
                                      ));
                }
                  

#endif
            }
        }
 /// <remarks/>
 public void createDocAsync(createDoc createDoc1, object userState)
 {
     if ((this.createDocOperationCompleted == null))
     {
         this.createDocOperationCompleted = new System.Threading.SendOrPostCallback(this.OncreateDocOperationCompleted);
     }
     this.InvokeAsync("createDoc", new object[] {
             createDoc1}, this.createDocOperationCompleted, userState);
 }
 /// <remarks/>
 public void createDocAsync(createDoc createDoc1)
 {
     this.createDocAsync(createDoc1, null);
 }
 /// <remarks/>
 public System.IAsyncResult BegincreateDoc(createDoc createDoc1, System.AsyncCallback callback, object asyncState)
 {
     return this.BeginInvoke("createDoc", new object[] {
             createDoc1}, callback, asyncState);
 }
Пример #7
0
 /// <remarks/>
 public void createDocAsync(createDoc createDoc1)
 {
     this.createDocAsync(createDoc1, null);
 }
Пример #8
0
 /// <remarks/>
 public System.IAsyncResult BegincreateDoc(createDoc createDoc1, System.AsyncCallback callback, object asyncState)
 {
     return(this.BeginInvoke("createDoc", new object[] {
         createDoc1
     }, callback, asyncState));
 }