Esempio n. 1
0
 public bool AddEDoc(string SessionID, string SessionKey, int LinkType, TEDocument Doc, TEDContent DocContent, ref int DocID) {
     object[] results = this.Invoke("AddEDoc", new object[] {
                 SessionID,
                 SessionKey,
                 LinkType,
                 Doc,
                 DocContent,
                 DocID});
     DocID = ((int)(results[1]));
     return ((bool)(results[0]));
 }
        public ActionResult AddOffer(TOfferInitialData offerInitialData, TAuction auction, Lot4Offer[] lots,
            SecurityDoc[] securityDocs, String content1, String signature1, File[] files1,
            Contact[] contatcs, String content2, String signature2, File[] files2)
        {
            TOffer offer = new TOffer();

            //fill offer info
            TOfferInfo offerInfo = new TOfferInfo();
            offerInfo.OfferRegNumber = offerInitialData.OfferRegNumber;
            offerInfo.ExpiryOfferDate = auction.AuctionInfo.ExpiryOfferDate;
            offerInfo.SecurityPercent = auction.AuctionInfo.SecurityPercent;
            offerInfo.SubjectName = auction.AuctionInfo.SubjectName;
            offer.OfferInfo = offerInfo;

            offer.AuctionHeader = auction.AuctionHeader;
            offer.AuctionID = auction.AuctionID;
            offer.AuctionStatusText = auction.AuctionStatusText;
            offer.BudgetFunding = offerInitialData.BudgetFunding;
            offer.BudgetFundingText = offerInitialData.BudgetFundingText;
            //offer.ServiceFeeFlag =
            //offer.ServiceFeeText =
            offer.Participant = offerInitialData.Participant;

            //fill lots data
            TOfferLotInfo[] offerLots = new TOfferLotInfo[lots == null ? 0 : lots.Length];
            for (int i = 0; i < offerLots.Length; i++)
            {
                offerLots[i] = new TOfferLotInfo();
                offerLots[i].AddInfo = lots[i].OtherInfo;
                //offerLots[i].AuctionLotStatusText =
                offerLots[i].AgreementConsent = 1;
                offerLots[i].Currency = lots[i].CurrencyCode;
                offerLots[i].CurrencyAbb = lots[i].Currency;
                offerLots[i].DeliveryDate = lots[i].Time;
                offerLots[i].DeliveryPlace = lots[i].Place;
                offerLots[i].Description = lots[i].Description;
                offerLots[i].EdIzm = lots[i].EdIzmCode;
                offerLots[i].EdIzmAbb = lots[i].EdIzm;
                offerLots[i].FundingSource = int.Parse(lots[i].FinanceSourceCode);
                offerLots[i].FundingSourceText = lots[i].FinanceSource;
                offerLots[i].LotID = lots[i].LotID;
                offerLots[i].LotVolume = string.IsNullOrEmpty(lots[i].Value) ? 0 : double.Parse(lots[i].Value.Trim().Replace(" ", ""), System.Globalization.CultureInfo.InvariantCulture);
                offerLots[i].NumLot = lots[i].NumLot;
                TOKRBRec[] okrb = new TOKRBRec[lots[i].OKRB.Length];
                for (int j = 0; j < lots[i].OKRB.Length; j++)
                {
                    TOKRBRec okrbRec = new TOKRBRec();
                    okrbRec.OKRBCode = lots[i].OKRB[j].OKRBCode;
                    okrbRec.OKRBID = int.Parse(lots[i].OKRB[j].OKRBID);
                    okrbRec.OKRBName = lots[i].OKRB[j].OKRBName;
                    okrb[j] = okrbRec;
                }
                offerLots[i].OKRBList = okrb;
                offerLots[i].PrefPercent = string.IsNullOrEmpty(lots[i].Correction) ? 0 : double.Parse(lots[i].Correction.Trim().Replace(" ", ""), System.Globalization.CultureInfo.InvariantCulture);
                offerLots[i].PrefReason = lots[i].FoundingCorrection;
                offerLots[i].SecurityValue = auction.AuctionInfo.SecurityPercent;
                offerLots[i].StartPrice = string.IsNullOrEmpty(lots[i].Price) ? 0 : double.Parse(lots[i].Price.Trim().Replace(" ", ""), System.Globalization.CultureInfo.InvariantCulture);
                offerLots[i].VolumeMethod = lots[i].CalcMethod;
            }
            offer.Lots = offerLots;

            //fill contact data
            TContactPerson[] tContatcs=new TContactPerson[contatcs==null?0:contatcs.Length];
            for (int i = 0; i < contatcs.Length; i++)
            {
                tContatcs[i] = new TContactPerson();
                tContatcs[i].FIO = contatcs[i].FIO;
                tContatcs[i].Phone = contatcs[i].Phones;
                tContatcs[i].Fax = contatcs[i].Fax;
                tContatcs[i].Email = contatcs[i].Email;
                tContatcs[i].AddInfo = contatcs[i].OtherInfo;
            }
            offer.ContactPersons = tContatcs;

            //fill security docs data
            TSecurityDoc[] tSecurityDocs = new TSecurityDoc[securityDocs==null?0:securityDocs.Length];
            for (int i = 0; i < tSecurityDocs.Length; i++)
            {
                tSecurityDocs[i] = new TSecurityDoc();
                //tSecurityDocs[i].ConfirmDate = ...;
                tSecurityDocs[i].Currency = securityDocs[i].CurrencyCode;
                tSecurityDocs[i].CurrencyAbb = securityDocs[i].Currency;
                tSecurityDocs[i].DocDate = DateTimeUtils.DateTimeToDouble(DateTime.Parse(securityDocs[i].DocDate.Trim().Replace(" ", string.Empty)));
                tSecurityDocs[i].DocNum = securityDocs[i].DocNumber;
                tSecurityDocs[i].DocTypeText = securityDocs[i].SecurityView;
                tSecurityDocs[i].ExpiryDate = DateTimeUtils.DateTimeToDouble(DateTime.Parse(securityDocs[i].SecurityPeriod.Trim().Replace(" ", string.Empty)));
                tSecurityDocs[i].SecuritySum = string.IsNullOrEmpty(securityDocs[i].SecurityValue) ? 0 : double.Parse(securityDocs[i].SecurityValue, System.Globalization.CultureInfo.InvariantCulture);
            }
            offer.SecurityDocs = tSecurityDocs;

            GovernmentPurchases.WebReference.TEDContent eContent1 = new GovernmentPurchases.WebReference.TEDContent();
            eContent1.Content = content1;
            eContent1.Signature = signature1;

            GovernmentPurchases.WebReference.TEDContent eContent2 = new GovernmentPurchases.WebReference.TEDContent();
            eContent2.Content = content2;
            eContent2.Signature = signature2;

            TAuthHeader header = new TAuthHeader();
            header.SessionID = (String)Session["sessionID"];
            header.SessionKey = (String)Session["sessionKey"];
            client.TAuthHeaderValue = header;

            int offerID = new int();
            client.AddOffer(offer, eContent1, eContent2, ref offerID);

            //upload files
            GovernmentPurchases.IUploadFiles.IUploadFilesservice fileClient = new GovernmentPurchases.IUploadFiles.IUploadFilesservice();
            //upload I section files
            if (files1 != null)
            {
                GovernmentPurchases.IUploadFiles.TEDocument document = new GovernmentPurchases.IUploadFiles.TEDocument();
                GovernmentPurchases.IUploadFiles.TEDContent cont = new GovernmentPurchases.IUploadFiles.TEDContent();

                for (int i = 0; i < files1.Length; i++)
                {
                    document.IDParent = offerID;
                    document.FileName = files1[i].FileName;
                    document.NameDocument = files1[i].DocName;
                    document.TypeDocument = files1[i].DocType;

                    cont.Content = files1[i].Content;
                    cont.Signature = files1[i].Signature;

                    int DocID = new int();
                    fileClient.AddEDoc((String)Session["sessionID"], (String)Session["sessionKey"], C_LINK_OFFERS, document, cont, ref DocID);
                }
            }
            //upload II section files
            if (files2 != null)
            {
                GovernmentPurchases.IUploadFiles.TEDocument document = new GovernmentPurchases.IUploadFiles.TEDocument();
                GovernmentPurchases.IUploadFiles.TEDContent cont = new GovernmentPurchases.IUploadFiles.TEDContent();

                for (int i = 0; i < files2.Length; i++)
                {
                    document.IDParent = offerID;
                    document.FileName = files2[i].FileName;
                    document.NameDocument = files2[i].DocName;
                    document.TypeDocument = files2[i].DocType;

                    cont.Content = files2[i].Content;
                    cont.Signature = files2[i].Signature;

                    int DocID = new int();
                    fileClient.AddEDoc((String)Session["sessionID"], (String)Session["sessionKey"], C_LINK_OFFERS, document, cont, ref DocID);
                }
            }

            AppLogger.Info(Session, "AddOffer: " + offerID);

            return Json(true);
        }
Esempio n. 3
0
 /// <remarks/>
 public void GetEDocAsync(string SkessionID, string SessionKey, int DocID, TEDocument Doc, TEDContent DocContent, bool WithSignatures, TESignature[] Signatures, object userState) {
     if ((this.GetEDocOperationCompleted == null)) {
         this.GetEDocOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetEDocOperationCompleted);
     }
     this.InvokeAsync("GetEDoc", new object[] {
                 SkessionID,
                 SessionKey,
                 DocID,
                 Doc,
                 DocContent,
                 WithSignatures,
                 Signatures}, this.GetEDocOperationCompleted, userState);
 }
Esempio n. 4
0
 /// <remarks/>
 public void GetEDocAsync(string SkessionID, string SessionKey, int DocID, TEDocument Doc, TEDContent DocContent, bool WithSignatures, TESignature[] Signatures) {
     this.GetEDocAsync(SkessionID, SessionKey, DocID, Doc, DocContent, WithSignatures, Signatures, null);
 }
Esempio n. 5
0
 public bool GetEDoc(string SkessionID, string SessionKey, int DocID, ref TEDocument Doc, ref TEDContent DocContent, bool WithSignatures, ref TESignature[] Signatures) {
     object[] results = this.Invoke("GetEDoc", new object[] {
                 SkessionID,
                 SessionKey,
                 DocID,
                 Doc,
                 DocContent,
                 WithSignatures,
                 Signatures});
     Doc = ((TEDocument)(results[1]));
     DocContent = ((TEDContent)(results[2]));
     Signatures = ((TESignature[])(results[3]));
     return ((bool)(results[0]));
 }
Esempio n. 6
0
 /// <remarks/>
 public void AddEDocAsync(string SessionID, string SessionKey, int LinkType, TEDocument Doc, TEDContent DocContent, int DocID, object userState) {
     if ((this.AddEDocOperationCompleted == null)) {
         this.AddEDocOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddEDocOperationCompleted);
     }
     this.InvokeAsync("AddEDoc", new object[] {
                 SessionID,
                 SessionKey,
                 LinkType,
                 Doc,
                 DocContent,
                 DocID}, this.AddEDocOperationCompleted, userState);
 }
Esempio n. 7
0
 /// <remarks/>
 public void AddEDocAsync(string SessionID, string SessionKey, int LinkType, TEDocument Doc, TEDContent DocContent, int DocID) {
     this.AddEDocAsync(SessionID, SessionKey, LinkType, Doc, DocContent, DocID, null);
 }