public ActionResult GetDocumentInfo(int docID) { IUploadFilesservice fileClient = new IUploadFilesservice(); TEDocument document = new TEDocument(); TESignature[] signatures = new TESignature[0]; string sessionID = (String)Session["sessionID"]; string sessionKey = (String)Session["sessionKey"]; fileClient.GetEDocInfo(sessionID, sessionKey, docID, ref document, ref signatures); EDocument doc = new EDocument(); doc.DocID = docID; doc.FileName = document.FileName; doc.IDDocument = document.IDDocument; doc.IDParent = document.IDParent; doc.NameDocument = document.NameDocument; doc.TypeDocument = document.TypeDocument; doc.FileSize = document.FileSize; ESignature[] signs = new ESignature[signatures.Length]; for (int i = 0; i < signatures.Length; i++) { signs[i] = new ESignature(DateTimeUtils.DoubleToDateTime(signatures[i].DateSignature).ToString("dd.MM.yyyy HH:mm:ss"), signatures[i].IDDigitalSignature, signatures[i].IDDocument, signatures[i].IDPerson, signatures[i].Signature, signatures[i].SubjectString, signatures[i].ValidSignature ? "Подпись верна" : "Подпись неверна"); } doc.Signatures = signs; return Json(doc); }
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); }
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])); }
/// <remarks/> public void GetEDocInfoAsync(string SessionID, string SessionKey, int DocID, TEDocument Doc, TESignature[] Signatures) { this.GetEDocInfoAsync(SessionID, SessionKey, DocID, Doc, Signatures, null); }
/// <remarks/> public void GetEDocInfoAsync(string SessionID, string SessionKey, int DocID, TEDocument Doc, TESignature[] Signatures, object userState) { if ((this.GetEDocInfoOperationCompleted == null)) { this.GetEDocInfoOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetEDocInfoOperationCompleted); } this.InvokeAsync("GetEDocInfo", new object[] { SessionID, SessionKey, DocID, Doc, Signatures}, this.GetEDocInfoOperationCompleted, userState); }
public bool GetEDocInfo(string SessionID, string SessionKey, int DocID, ref TEDocument Doc, ref TESignature[] Signatures) { object[] results = this.Invoke("GetEDocInfo", new object[] { SessionID, SessionKey, DocID, Doc, Signatures}); Doc = ((TEDocument)(results[1])); Signatures = ((TESignature[])(results[2])); return ((bool)(results[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); }
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])); }
/// <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); }
/// <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); }