public ActionResult GetOfferJSON(int id)
        {
            TOffer offer = new TOffer();

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

            client.GetOfferInfo(id, ref offer);

            SecurityDoc[] securityDocs = new SecurityDoc[offer.SecurityDocs.Length];
            for (int i = 0; i < offer.SecurityDocs.Length; i++)
            {
                securityDocs[i] = new SecurityDoc();
                securityDocs[i].SecurityView = offer.SecurityDocs[i].DocTypeText;
                securityDocs[i].DocNumber = offer.SecurityDocs[i].DocNum;
                securityDocs[i].DocDate = DateTimeUtils.DoubleToDateTime(offer.SecurityDocs[i].DocDate).ToString("dd.MM.yyyy");
                securityDocs[i].SecurityValue = offer.SecurityDocs[i].SecuritySum.ToString();
                securityDocs[i].Currency = offer.SecurityDocs[i].CurrencyAbb;
                securityDocs[i].CurrencyCode = offer.SecurityDocs[i].Currency;
                securityDocs[i].SecurityPeriod = DateTimeUtils.DoubleToDateTime(offer.SecurityDocs[i].ExpiryDate).ToString("dd.MM.yyyy");
            }

            OfferStruc o;
            o.offer = offer;
            o.securityDocs = securityDocs;

            return Json(o);
        }
        public ActionResult OfferInfo(int id)
        {
            TAuthHeader header = new TAuthHeader();
            header.SessionID = (String)Session["sessionID"];
            header.SessionKey = (String)Session["sessionKey"];
            client.TAuthHeaderValue = header;

            TOffer offer = new TOffer();
            client.GetOfferInfo(id, ref offer);

            ViewBag.Header = offer.AuctionHeader;
            ViewBag.AuctionID = offer.AuctionID;
            ViewBag.ContactPersons = offer.ContactPersons;
            ViewBag.OfferInfo = offer.OfferInfo;
            ViewBag.Lots = offer.Lots;
            ViewBag.Participant = offer.Participant;
            ViewBag.Section1Docs = offer.Section1Docs;
            ViewBag.Section2Docs = offer.Section2Docs;
            ViewBag.SecurityDocs = offer.SecurityDocs;
            return View();
        }
        public ActionResult Edit(int id)
        {
            TAuthHeader header = new TAuthHeader();
            header.SessionID = (String)Session["sessionID"];
            header.SessionKey = (String)Session["sessionKey"];
            client.TAuthHeaderValue = header;

            TOffer offer = new TOffer();
            client.GetOfferInfo(id, ref offer);

            ViewBag.AuctionID = offer.AuctionID;
            ViewBag.OfferID = offer.OfferID;
            ViewBag.ExpiryOfferDate = offer.OfferInfo.ExpiryOfferDate;

            return View();
        }
        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);
        }
Example #5
0
 /// <remarks/>
 public void GetOfferInfoAsync(int OfferID, TOffer Offer) {
     this.GetOfferInfoAsync(OfferID, Offer, null);
 }
Example #6
0
 /// <remarks/>
 public void GetOfferInfoAsync(int OfferID, TOffer Offer, object userState) {
     if ((this.GetOfferInfoOperationCompleted == null)) {
         this.GetOfferInfoOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetOfferInfoOperationCompleted);
     }
     this.InvokeAsync("GetOfferInfo", new object[] {
                 OfferID,
                 Offer}, this.GetOfferInfoOperationCompleted, userState);
 }
Example #7
0
 /// <remarks/>
 public void EditOfferAsync(TOffer Offer, TEDContent Section1, TEDContent Section2, int[] DelDocs, object userState) {
     if ((this.EditOfferOperationCompleted == null)) {
         this.EditOfferOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEditOfferOperationCompleted);
     }
     this.InvokeAsync("EditOffer", new object[] {
                 Offer,
                 Section1,
                 Section2,
                 DelDocs}, this.EditOfferOperationCompleted, userState);
 }
Example #8
0
 public bool GetOfferInfo(int OfferID, ref TOffer Offer) {
     object[] results = this.Invoke("GetOfferInfo", new object[] {
                 OfferID,
                 Offer});
     Offer = ((TOffer)(results[1]));
     return ((bool)(results[0]));
 }
Example #9
0
 /// <remarks/>
 public void EditOfferAsync(TOffer Offer, TEDContent Section1, TEDContent Section2, int[] DelDocs) {
     this.EditOfferAsync(Offer, Section1, Section2, DelDocs, null);
 }
Example #10
0
 public bool EditOffer(TOffer Offer, TEDContent Section1, TEDContent Section2, int[] DelDocs) {
     object[] results = this.Invoke("EditOffer", new object[] {
                 Offer,
                 Section1,
                 Section2,
                 DelDocs});
     return ((bool)(results[0]));
 }
Example #11
0
 /// <remarks/>
 public void AddOfferAsync(TOffer Offer, TEDContent Section1, TEDContent Section2, int OfferID, object userState) {
     if ((this.AddOfferOperationCompleted == null)) {
         this.AddOfferOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddOfferOperationCompleted);
     }
     this.InvokeAsync("AddOffer", new object[] {
                 Offer,
                 Section1,
                 Section2,
                 OfferID}, this.AddOfferOperationCompleted, userState);
 }
Example #12
0
 /// <remarks/>
 public void AddOfferAsync(TOffer Offer, TEDContent Section1, TEDContent Section2, int OfferID) {
     this.AddOfferAsync(Offer, Section1, Section2, OfferID, null);
 }
Example #13
0
 public bool AddOffer(TOffer Offer, TEDContent Section1, TEDContent Section2, ref int OfferID) {
     object[] results = this.Invoke("AddOffer", new object[] {
                 Offer,
                 Section1,
                 Section2,
                 OfferID});
     OfferID = ((int)(results[1]));
     return ((bool)(results[0]));
 }