コード例 #1
0
        public ActionResult AuctionInfo(int id)
        {
            if (Session["hasLogged"] != null)
            {
                if ((bool)Session["hasLogged"] == true)
                {
                    TAuthHeader header = new TAuthHeader();
                    header.SessionID = (String)Session["sessionID"];
                    header.SessionKey = (String)Session["sessionKey"];
                    client.TAuthHeaderValue = header;
                }
                else
                {
                    client.TAuthHeaderValue = new GovernmentPurchases.WebReference.TAuthHeader();
                }
            }
            else
            {
                client.TAuthHeaderValue = new GovernmentPurchases.WebReference.TAuthHeader();
            }

            TAuction auction=new TAuction();

            client.GetAuctionInfo(id,ref auction);
            ViewBag.Header = auction.AuctionHeader;
            ViewBag.ContactPersons = auction.ContactPersons;
            ViewBag.AuctionInfo = auction.AuctionInfo;
            ViewBag.Customer = auction.Customer;
            ViewBag.Lots = auction.Lots;
            ViewBag.Docs= auction.Docs;
            ViewBag.Protocols = auction.Protocols;
            ViewBag.Events = auction.Events;
            return View();
        }
コード例 #2
0
        public ActionResult Add(int id)
        {
            TAuction auction = new TAuction();

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

            client.GetAuctionInfo(id, ref auction);

            ViewBag.AuctionID = auction.AuctionID;
            ViewBag.AuctionInfo = auction.AuctionInfo;

            return View();
        }
コード例 #3
0
        public ActionResult GetProtocols(int auctionID)
        {
            TDocument[] docsList = new TDocument[0];

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

            client.GetProtocols(auctionID, ref docsList);

            List<Document> docs = new List<Document>();
            for (int i = 0; i < docsList.Length; i++)
            {
                docs.Add(new Document(docsList[i].DocID, docsList[i].DocName, docsList[i].DocType, docsList[i].FileName));
            }

            return Json(docs);
        }
コード例 #4
0
        public ActionResult GetAgreemAuctionsList(int page = 1, string request="")
        {
            List<AuctionsListRec> agreements = new List<AuctionsListRec>();
            TViewSummary view = new TViewSummary();
            view.CurrentPage = page;
            if (!request.Equals(""))
            {
                view.SearchStr = request;
            }

            TAgreemAuctionsListRec[] list = new TAgreemAuctionsListRec[0];

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

            client.GetAgreemAuctionsList(ciAgrAuOwn,ref view, ref list);

            for (int i = 0; i < list.Length; i++)
            {
                agreements.Add(new AuctionsListRec(
                    list[i].AuctionID,
                    list[i].AuctionRegNumber,
                    list[i].AuctionStatusText,
                    list[i].CodeTender,
                    list[i].CustomerName,
                    list[i].OrganizerClientName,
                    DateTimeUtils.DoubleToDateTime(list[i].PublishDate).ToString("dd.MM.yyyy"),
                    list[i].RoleText,
                    list[i].SubjectName,
                    DateTimeUtils.DoubleToDateTime(list[i].TenderDate).ToString("dd.MM.yyyy hh:mm:ss")
                ));
            }

            PageStateStruc p;
            p.agreements = agreements;
            p.viewSummary = view;
            return Json(p);
        }
コード例 #5
0
        public ActionResult GetNotices(int page = 1, int type=0, string request="")
        {
            List<Notice> noticesList = new List<Notice>();
            TViewSummary view = new TViewSummary();
            view.CurrentPage = page;
            if (!request.Equals(""))
            {
                view.SearchStr = request;
            }

            TNotice[] notices = new TNotice[0];

            TAuthHeader header = new TAuthHeader();
            header.SessionID = (String)Session["sessionID"];
            header.SessionKey = (String)Session["sessionKey"];
            client.TAuthHeaderValue = header;
            try
            {
                client.GetNotices(type, ref view, ref notices);
            }
            catch (Exception ex)
            {
                return Json(ex.Message);
            }
            bool isRead = type == ciNoticeStatusUnread ? false : true;
            foreach (TNotice notice in notices)
            {
                noticesList.Add(new Notice(DateTimeUtils.DoubleToDateTime(notice.NoticeDate).ToString("dd.MM.yyyy HH:mm:ss"),
                    notice.Title, notice.HyperText.Equals("") ? notice.Text : notice.HyperText, notice.NoticeID, isRead, notice.IsSigned == 1 ? true : false));
            }
            PageStateStruc p;
            p.notices = noticesList;
            p.viewSummary = view;

            return Json(p);
        }
コード例 #6
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);
        }
コード例 #7
0
        public ActionResult AddAuction(AuctionInitData auctionInitData, AuctionGeneralInfo generalInfo, Contact[] contacts,
            string auctionRole, Lot[] lots, String content, String signature, File[] files)
        {
            TAuction auction = new TAuction();

            //заполняем шапку
            TAuctionHeader auctionHeader = new TAuctionHeader();
            auctionHeader.AuctionRegNumber = auctionInitData.AuctionRegNumber;
            auctionHeader.PurchaseName = auctionInitData.PurchaseName;
            auctionHeader.PurchaseSite = auctionInitData.PurchaseSite;
            auction.AuctionHeader = auctionHeader;
            //заполняем информацию о заказчике
            TMemberInfo memeberInfo = new TMemberInfo();
            memeberInfo.Address = auctionInitData.Address;
            memeberInfo.MemberRegNumber = auctionInitData.MemberRegNumber;
            memeberInfo.MemberType = int.Parse(auctionInitData.MemberType);
            memeberInfo.Name = auctionInitData.Name;
            memeberInfo.UNP = auctionInitData.UNP;
            auction.Customer = memeberInfo;

            //заполняем общую информацию об аукционе
            TAuctionInfo auctionInfo = new TAuctionInfo();
            auctionInfo.AddInfo = generalInfo.AddInfo;
            auctionInfo.CodeTender = generalInfo.RegNum;
            //currency code
            auctionInfo.Currency = generalInfo.CurrencyCode;
            //currency label
            auctionInfo.CurrencyAbb = generalInfo.Currency;
            auctionInfo.EndOfferDate = DateTimeUtils.DateTimeToDouble(DateTime.Parse(generalInfo.EndOfferDate.Trim().Replace(" ", string.Empty)));
            auctionInfo.ExpiryOfferDate = DateTimeUtils.DateTimeToDouble(DateTime.Parse(generalInfo.TenderEndDate.Trim().Replace(" ", string.Empty)));
            auctionInfo.FinanceType = generalInfo.FinanceType;
            auctionInfo.MemberRequires = generalInfo.MemberRequires;
            auctionInfo.PublishDate = DateTimeUtils.DateTimeToDouble(DateTime.Parse(generalInfo.RegDate.Trim().Replace(" ", string.Empty)));
            auctionInfo.QualificationRequires = generalInfo.QualificationRequires;
            if (generalInfo.SecurityPercent != null)
            {
                auctionInfo.SecurityPercent = double.Parse(generalInfo.SecurityPercent, System.Globalization.CultureInfo.InvariantCulture);
            }
            else
            {
                auctionInfo.SecurityPercent = 0;
            }
            auctionInfo.ServiceFee = double.Parse(auctionInitData.ServiceFee, System.Globalization.CultureInfo.InvariantCulture);
            auctionInfo.TotalCost = double.Parse(auctionInitData.TotalCost, System.Globalization.CultureInfo.InvariantCulture);
            auctionInfo.SubjectName = generalInfo.Name;
            auctionInfo.TenderDate = DateTimeUtils.DateTimeToDouble(DateTime.Parse(generalInfo.TenderDate.Trim().Replace(" ", string.Empty) + " " + generalInfo.TenderTime.Trim().Replace(" ", string.Empty)));
            auction.AuctionInfo = auctionInfo;

            //заполняем роль заказчика
            auction.CustomerRoleText = auctionRole;

            //заполняем контактные лица
            TContactPerson[] contactsPerson = new TContactPerson[contacts.Length];
            for (int i = 0; i < contacts.Length; i++)
            {
                TContactPerson contact = new TContactPerson();
                contact.Email = contacts[i].Email;
                contact.FIO = contacts[i].FIO;
                contact.Phone = contacts[i].Phones;
                contact.Fax= contacts[i].Fax;
                contact.AddInfo = contacts[i].OtherInfo;
                contactsPerson[i] = contact;
            }
            auction.ContactPersons = contactsPerson;

            TLotInfo[] lotsInfo = new TLotInfo[lots.Length];
            for (int i = 0; i < lots.Length; i++)
            {
                TLotInfo lotInfo = new TLotInfo();
                lotInfo.AddInfo = lots[i].OtherInfo;
                //lotInfo.AgreementConsent=
                //lotInfo.AuctionLotStatusText=
                lotInfo.Currency = generalInfo.CurrencyCode;
                lotInfo.CurrencyAbb = generalInfo.Currency;
                lotInfo.DeliveryDate = lots[i].Time;
                lotInfo.DeliveryPlace = lots[i].Place;
                lotInfo.Description = lots[i].Description;
                lotInfo.EdIzm = lots[i].EdIzmCode;
                lotInfo.EdIzmAbb = lots[i].EdIzm;
                lotInfo.FundingSource = int.Parse(lots[i].FinanceSourceCode);
                lotInfo.FundingSourceText = lots[i].FinanceSource;
                //lotInfo.LotID=
                lotInfo.LotVolume = double.Parse(lots[i].Value, System.Globalization.CultureInfo.InvariantCulture);
                lotInfo.NumLot = i + 1;
                //lotInfo.OfferLotStatusText=
                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;
                }

                lotInfo.OKRBList = okrb;
                //lotInfo.PrefPercent = lots[i].
                //lotInfo.PrefReason = lots[i].
                //lotInfo.SecurityValue=
                lotInfo.StartPrice = double.Parse(lots[i].Price, System.Globalization.CultureInfo.InvariantCulture);
                lotInfo.VolumeMethod = lots[i].CalcMethod;

                lotsInfo[i] = lotInfo;
            }
            auction.Lots = lotsInfo;

            TEDContent eContent = new TEDContent();
            eContent.Content = content;
            eContent.Signature = signature;

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

            int AuctionID = new int();
            client.AddAuction(auction, eContent, ref AuctionID);

            if (files != null)
            {
                GovernmentPurchases.IUploadFiles.IUploadFilesservice fileClient = new GovernmentPurchases.IUploadFiles.IUploadFilesservice();
                GovernmentPurchases.IUploadFiles.TEDocument document = new GovernmentPurchases.IUploadFiles.TEDocument();
                GovernmentPurchases.IUploadFiles.TEDContent cont = new GovernmentPurchases.IUploadFiles.TEDContent();

                for (int i = 0; i < files.Length; i++)
                {

                    document.IDParent = AuctionID;
                    document.FileName = files[i].FileName;
                    document.NameDocument = files[i].DocName;
                    document.TypeDocument = files[i].DocType;

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

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

            client.LockAuctionForEdit(AuctionID, 0);

            return Json(true);
        }
コード例 #8
0
        public ActionResult GetAuctionJSON(int id)
        {
            TAuthHeader header = new TAuthHeader();
            header.SessionID = (String)Session["sessionID"];
            header.SessionKey = (String)Session["sessionKey"];
            client.TAuthHeaderValue = header;

            TAuction auction = new TAuction();
            client.GetAuctionInfo(id, ref auction);

            return Json(auction);
        }
コード例 #9
0
        public ActionResult CancelOffer(int id)
        {
            TAuthHeader header = new TAuthHeader();
            header.SessionID = (String)Session["sessionID"];
            header.SessionKey = (String)Session["sessionKey"];
            client.TAuthHeaderValue = header;

            client.DelOffer(id);
            return Json(true);
        }
コード例 #10
0
        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();
        }
コード例 #11
0
        public ActionResult Edit(int id)
        {
            if (Session["hasLogged"] != null)
            {
                if ((bool)Session["hasLogged"] == true)
                {
                    TAuction auction = new TAuction();
                    TAuthHeader header = new TAuthHeader();
                    header.SessionID = (String)Session["sessionID"];
                    header.SessionKey = (String)Session["sessionKey"];
                    client.TAuthHeaderValue = header;

                    client.GetAuctionInfo(id, ref auction);

                    ViewBag.AuctionID = id;
                    ViewBag.Header = auction.AuctionHeader;
                    ViewBag.ContactPersons = auction.ContactPersons;
                    ViewBag.AuctionInfo = auction.AuctionInfo;
                    ViewBag.Customer = auction.Customer;
                    ViewBag.CustomerRoleText = auction.CustomerRoleText;
                    ViewBag.Lots = auction.Lots;
                    ViewBag.Docs = auction.Docs;
                    ViewBag.Protocols = auction.Protocols;
                    ViewBag.Events = auction.Events;

                    //get currency
                    TBaseDomainItem[] items = new TBaseDomainItem[0];
                    client.GetDomain(14, ref items);
                    for (int i = 0; i < items.Length; i++)
                    {
                        if (((TStringDomainItem)items[i]).Key == auction.AuctionInfo.Currency)
                        {
                            ViewBag.CurrencyIndex = i;
                            break;
                        }
                    }

                    //get finance type
                    client.GetDomain(10, ref items);
                    for (int i = 0; i < items.Length; i++)
                    {
                        if (items[i].Value == auction.AuctionInfo.FinanceType)
                        {
                            ViewBag.FinanceTypeIndex = i;
                            break;
                        }
                    }

                    //get auction role
                    client.GetDomain(5, ref items);
                    for (int i = 0; i < items.Length; i++)
                    {
                        if (items[i].Value == auction.CustomerRoleText)
                        {
                            ViewBag.CustomerRoleTextIndex = i;
                            break;
                        }
                    }

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

                    client.LockAuctionForEdit(id, 1);

                }
            }
            return View();
        }
コード例 #12
0
        public ActionResult GetAuctionInitialData()
        {
            TAuctionInitialData auctionInitData = new TAuctionInitialData();
            auctionInitData.Customer = new TMemberInfo();
            auctionInitData.AuctionHeader = new TAuctionHeader();

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

            client.TAuthHeaderValue = header;
            client.GetAuctionInitialData("", ref auctionInitData);

            return Json(auctionInitData);
        }
コード例 #13
0
        public ActionResult GetRefusedOffers(int page = 1, int status = 300, string request = "")
        {
            List<Offer> offers = new List<Offer>();
            TViewSummary view = new TViewSummary();
            view.CurrentPage = page;
            if (!request.Equals(""))
            {
                view.SearchStr = request;
            }

            TOffersListRec[] list = new TOffersListRec[0];

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

            client.GetOffersList(status, ref view, ref list);

            for (int i = 0; i < list.Length; i++)
            {
                offers.Add(new Offer(
                    list[i].OfferID,
                    list[i].AuctionRegNumber,
                    list[i].AuctionID,
                    list[i].SubjectName,
                    DateTimeUtils.DoubleToDateTime(list[i].EndOfferDate).ToString("dd.MM.yyyy HH:mm:ss"),
                    list[i].OfferRegNumber,
                    DateTimeUtils.DoubleToDateTime(list[i].OfferDate).ToString("dd.MM.yyyy HH:mm:ss"),
                    DateTimeUtils.DoubleToDateTime(list[i].TenderDate).ToString("dd.MM.yyyy HH:mm:ss"),
                    list[i].OfferStatusText
                ));
            }

            PageStateStruc p;
            p.offers = offers;
            p.viewSummary = view;
            return Json(p);
        }
コード例 #14
0
        public ActionResult Index()
        {
            //IGvPurchSrvservice client = new IGvPurchSrvservice();
            //client.GetSrvTime();
            //TViewSummary view = new TViewSummary();
            //TNews[] news=new TNews[0];
            /*TAuctionesListRec[] list=new TAuctionesListRec[0];
            client.GetAuctionesList(1,1,"",ref view,ref list);*/
            //client.GetExchangeSettings();
            //client.GetNews(1,ref view,ref news);

            //!TODO remove
            /*Dictionary<String, Dictionary<String, String>[]> dict = new Dictionary<string, Dictionary<string, string>[]>();
            Dictionary<String, String>[] v = new Dictionary<string, string>[2];
            v[0] = new Dictionary<string, string>();
            v[1] = new Dictionary<string, string>();
            v[0].Add("lotNumber", "1");
            v[0].Add("lotShortName", "bla");
            v[0].Add("lotOKRB", "12.3.45.3");
            v[0].Add("lotDescr", "bla-bla-bla");
            v[0].Add("lotValue", "25 kg");
            v[0].Add("lotCalc", "-");
            v[0].Add("lotDeliveryPlace", "Mogilev");
            v[0].Add("lotDeliveryTime", "01.01.2012");
            v[0].Add("lotPrice", "100");
            v[0].Add("lotCurrency", "$");
            v[0].Add("lotOther", "none");
            v[0].Add("offerExpirationDate", "02.02.2012");
            v[0].Add("correction", "2%");
            v[0].Add("foundingCorrection", "smths");

            v[1].Add("lotNumber", "2");
            v[1].Add("lotShortName", "bla");
            v[1].Add("lotOKRB", "12.3.45.3");
            v[1].Add("lotDescr", "bla-bla-bla");
            v[1].Add("lotValue", "25 kg");
            v[1].Add("lotCalc", "-");
            v[1].Add("lotDeliveryPlace", "Mogilev");
            v[1].Add("lotDeliveryTime", "01.01.2012");
            v[1].Add("lotPrice", "100");
            v[1].Add("lotCurrency", "$");
            v[1].Add("lotOther", "none");
            v[1].Add("offerExpirationDate", "02.02.2012");
            v[1].Add("correction", "2%");
            v[1].Add("foundingCorrection", "smth");
            dict.Add("repeatingUnitLot", v);

            Dictionary<String, String>[] v2 = new Dictionary<string, string>[2];
            v2[0] = new Dictionary<string, string>();
            v2[1] = new Dictionary<string, string>();
            v2[0].Add("securityView", "qwerty");
            v2[0].Add("docNumber", "1");
            v2[0].Add("docDate", "01.03.2012");
            v2[0].Add("securityValue", "100 000");
            v2[0].Add("securityPeriod", "10 дней");

            v2[1].Add("securityView", "asd");
            v2[1].Add("docNumber", "2");
            v2[1].Add("docDate", "01.03.2012");
            v2[1].Add("securityValue", "100 000");
            v2[1].Add("securityPeriod", "10 дней");
            dict.Add("repeatingUnitSecurity", v2);

            Dictionary<String, String>[] v3 = new Dictionary<string, string>[2];
            v3[0] = new Dictionary<string, string>();
            v3[1] = new Dictionary<string, string>();
            v3[0].Add("docName", "1.doc");

            v3[1].Add("docName", "2.doc");
            dict.Add("repeatingUnitDoc", v3);

            Dictionary<String, String>[] v4 = new Dictionary<string, string>[1];
            v4[0] = new Dictionary<string, string>();
            v4[0].Add("offerNumber", "123456789");
            v4[0].Add("siteAddress", "www.test.ru");
            v4[0].Add("regNumber", "987654321");
            v4[0].Add("shortName", "short name");
            v4[0].Add("budgetOrg", "yes");
            v4[0].Add("securityValue", "2%");
            dict.Add("other", v4);

            TemplatesUtils.generateDocument(Server.MapPath("~") + "Content/static/templates/Offer Prt 1_19032012.html", dict);*/

            //!TODO remove this
            Session["sessionID"] = "260";
            Session["sessionKey"] = "{4D1DE906-EC71-470F-BCFE-6E9A09C90271}";
            //Session["sessionID"] = "251";
            //Session["sessionKey"] = "{C0FD8976-F2F9-4001-8004-B3D7E6A1EFAE}";
            Session["hasLogged"] = true;
            Session["Acred"] = true;

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

            TAuthUserInfo userInfo = new TAuthUserInfo();
            client.GetUserInfo(ref userInfo);
            Session["personName"] = userInfo.PersonName;
            return View();
            //return RedirectToAction("Index", "News");
        }
コード例 #15
0
        public ActionResult GetOfferInitialData(int id)
        {
            TOfferInitialData offerInitialData=new TOfferInitialData();

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

            client.GetOfferInitialData(id, ref offerInitialData);

            return Json(offerInitialData);
        }
コード例 #16
0
        public ActionResult GetAgreements(int auctionID)
        {
            TAgreementsListRec[] agreementsList = new TAgreementsListRec[0];

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

            client.GetAgreements(auctionID, ciAgrAuOwn, ref agreementsList);

            List<AgreementRec>  recs = new List<AgreementRec>();
            for (int i = 0; i < agreementsList.Length; i++)
            {
                recs.Add(new AgreementRec(
                    DateTimeUtils.DoubleToDateTime(agreementsList[i].AgreementDate).ToString("dd.MM.yyyy"), agreementsList[i].AgreementForm,
                    agreementsList[i].AgreementRegNum, agreementsList[i].AgreementStatusText, agreementsList[i].CostWithPref.ToString("#,##.####"),
                    agreementsList[i].CurrencyAbb, agreementsList[i].Description, agreementsList[i].DocID, agreementsList[i].LotID,
                    agreementsList[i].NumLot, agreementsList[i].ParticipantName,
                    agreementsList[i].RatePref.ToString("#,##.####"))
                    );
            }

            return Json(recs);
        }
コード例 #17
0
        public ActionResult GetAuctionMoneyValues(MoneyValue[] money, string auctionCurrency)
        {
            TAuctionInitialData auctionInitData = new TAuctionInitialData();
            auctionInitData.Customer = new TMemberInfo();
            auctionInitData.AuctionHeader = new TAuctionHeader();

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

            client.TAuthHeaderValue = header;

            TMoneyRec[] moneyRecs = new TMoneyRec[money.Length];
            for (int i = 0; i < moneyRecs.Length; i++)
            {
                TMoneyRec moneyRec = new TMoneyRec();
                moneyRec.Currency = money[i].Currency;
                moneyRec.Money = double.Parse(money[i].Money, System.Globalization.CultureInfo.InvariantCulture);
                moneyRecs[i] = moneyRec;
            }

            double totalCost=0;
            double serviceFee=0;
            client.GetAuctionMoneyValues(moneyRecs,auctionCurrency, ref totalCost, ref serviceFee);
            MoneyWrapper wrapper;
            wrapper.totalCost = totalCost;
            wrapper.serviceFee = serviceFee;
            return Json(wrapper);
        }
コード例 #18
0
        public ActionResult ValidateAuctionCheckPoints(string regDate, string endOfferDate, string tenderDate, string tenderTime, string tenderEndDate)
        {
            TAuctionCheckPoints checkPoints = new TAuctionCheckPoints();
            checkPoints.PublishDate = DateTimeUtils.DateTimeToDouble(DateTime.Parse(regDate));
            checkPoints.TenderDate = DateTimeUtils.DateTimeToDouble(DateTime.Parse(tenderTime+" "+tenderDate));
            checkPoints.EndOfferDate = DateTimeUtils.DateTimeToDouble(DateTime.Parse(endOfferDate));
            checkPoints.ExpiryOfferDate = DateTimeUtils.DateTimeToDouble(DateTime.Parse(tenderEndDate));

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

            try
            {
                client.ValidateAuctionCheckPoints(checkPoints);
            }
            catch (SoapException ex)
            {
                return Json(ex.Message);
            }

            return Json(true);
        }
コード例 #19
0
        public ActionResult LockAuction(int AuctionID, int lockStatus)
        {
            TAuthHeader header = new TAuthHeader();
            header.SessionID = (String)Session["sessionID"];
            header.SessionKey = (String)Session["sessionKey"];
            client.TAuthHeaderValue = header;

            client.LockAuctionForEdit(AuctionID, lockStatus);
            return Json(true);
        }
コード例 #20
0
        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);
        }
コード例 #21
0
        public ActionResult SetNoticeStatus(int noticeID, int noticeStatus)
        {
            int[] notices=new int[1];
            notices[0]=noticeID;

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

            client.SetNoticesStatus(noticeStatus,notices);

            return Json(true);
        }
コード例 #22
0
        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();
        }
コード例 #23
0
        public ActionResult GetAnnouncedAuctions(int page = 1, int status=100, string request="")
        {
            List<Auction> auctions = new List<Auction>();
            TViewSummary view = new TViewSummary();
            view.CurrentPage = page;
            if (!request.Equals(""))
            {
                view.SearchStr = request;
            }

            TAuctionsListRec[] list = new TAuctionsListRec[0];

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

            client.GetAuctionsList(status, false, ref view, ref list);

            for (int i = 0; i < list.Length; i++)
            {
                auctions.Add(new Auction(
                    list[i].AuctionRegNumber,
                    DateTimeUtils.DoubleToDateTime(list[i].PublishDate).ToString("dd.MM.yyyy"),
                    list[i].SubjectName,
                    list[i].Customer,
                    list[i].FinanceType,
                    DateTimeUtils.DoubleToDateTime(list[i].EndOfferDate).ToString("dd.MM.yyyy"),
                    DateTimeUtils.DoubleToDateTime(list[i].TenderDate).ToString("dd.MM.yyyy HH:mm:ss"),
                    list[i].AuctionStatusText,
                    list[i].OfferAvailable,
                    list[i].AuctionID.ToString()

                ));
            }

            PageStateStruc p;
            p.auctions = auctions;
            p.viewSummary = view;
            return Json(p);
        }
コード例 #24
0
        public ActionResult Login(string tempKey, string tempKeySignature, string[] certInfo)
        {
            bool res = true;
            IDSLogin.IDSLoginservice loginClient = new IDSLogin.IDSLoginservice();
            IDSLogin.TUserData userData=new IDSLogin.TUserData();
            userData.ClientLocalIP = Request.ServerVariables["REMOTE_ADDR"];
            //!TODO change this
            userData.ClientHardwareID = "6B50564A9446D655BF6BC077F866E9B4";
            userData.ClientSoftwareGUID = "{1234806C-6DB0-4E27-B85E-990DCAFA8E4A}";
            userData.ClientSoftwareVersion = "1.0.0.0";

            CertInfo cert = new CertInfo();
            cert.CNOwner = certInfo[0];
            cert.OrganizationOwner = certInfo[1];
            cert.CountryOwner = certInfo[2];
            cert.Area = certInfo[3];
            cert.LocalityOwner = certInfo[4];
            cert.StreetOwner = certInfo[5];
            cert.Post = certInfo[6];
            cert.SurnameOwner = certInfo[7];
            cert.NameAndMiddleName = certInfo[8];
            cert.CNPublisher = certInfo[9];
            cert.OrganizationPublisher = certInfo[10];
            cert.CountryPublisher = certInfo[11];
            cert.SectionPublisher = certInfo[12];
            cert.LocalityPublisher = certInfo[13];
            cert.StreetPublisher = certInfo[14];
            cert.EmailPublisher = certInfo[15];
            cert.IDKey = certInfo[16];
            cert.BasicLimits = certInfo[17];
            cert.Key4Use = certInfo[18];
            cert.IDKeySubject = certInfo[19];
            cert.ImprovedKey = certInfo[20];
            cert.UNP = certInfo[21];
            cert.DurationPublicKey = certInfo[22];
            cert.PassportData = certInfo[23];
            cert.PublicKey = certInfo[24];

            Session["certInfo"] = cert;

            //эти данные будут нужны для "тихой" повторной авторизации
            Session["tempKey"] = tempKey;
            Session["tempKeySignature"] = tempKeySignature;

            string sessionKey = null;
            string sessisonID = null;
            Session["Acred"] = false;
            try
            {
                sessisonID = loginClient.LogInWeb(tempKey, tempKeySignature, ref userData, out sessionKey);
            }
            catch (SoapException ex)
            {
                Session["hasLogged"] = false;
                string errtext = ex.Message;
                string[] sep = { "\n" };
                string[] sepdata = { "\t" };
                string[] strarray = errtext.Split(sep, StringSplitOptions.None);

                string errCritical = strarray[0];
                string errCode = strarray[1];
                string errData = strarray[2];
                string errMessage = "";

                for (int i = 3; i < strarray.Length; i++ )
                {
                    errMessage += strarray[i];
                }

                if (errCritical == "0")
                {
                    Session["errCode"] = errCode;

                    switch (errCode)
                    {
                        case c_Err_MmbrNoFnd_UsrNoFnd:
                            {
                                Session["Acred"] = true;
                                res = false;
                                ErrorMessage errorMessage;
                                errorMessage.message = errMessage;
                                errorMessage.result = res;
                                return Json(errorMessage);
                            }
                        case c_Err_MmbrFnd_UsrNoFnd:
                            {
                                string[] strData = errData.Split(sepdata, StringSplitOptions.None);
                                Hashtable ht = new Hashtable();
                                for (int i = 0; i < strData.Length; i++)
                                {
                                    ht.Add(strData[i].Split('=')[0], strData[i].Split('=')[1]);
                                }

                                Session["Acred"] = true;
                                res = false;
                                ErrorMessage errorMessage;
                                errorMessage.message = errMessage;
                                errorMessage.result = res;
                                return Json(errorMessage);
                            }
                        case c_Err_MmbrFnd_UsrFnd_NoReg:
                            {
                                Session["Acred"] = true;
                                res = false;
                                ErrorMessage errorMessage;
                                errorMessage.message = errMessage;
                                errorMessage.result = res;
                                return Json(errorMessage);
                            }
                        default:
                            {
                                Session["Acred"] = true;
                                res = false;
                                ErrorMessage errorMessage;
                                errorMessage.message = errMessage;
                                errorMessage.result = res;
                                return Json(errorMessage);
                            }
                    }
                }
                else if (errCritical == "1")
                {
                    //throw new Exception("Ошибка сервера");
                    throw new Exception(errMessage);
                }

            }

            Session["sessionID"] = sessisonID;
            Session["sessionKey"] = sessionKey;

            Session["hasLogged"] = true;
            Session["Acred"] = true;

            Session["MemberStatus"] = userData.MemberStatus;
            Session["PersonStatus"] = userData.PersonStatus;

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

            TAuthUserInfo userInfo = new TAuthUserInfo();
            client.GetUserInfo(ref userInfo);
            Session["personName"] = userInfo.PersonName;

            return Json(res);
        }
コード例 #25
0
        public ActionResult CancelAuction(int id)
        {
            TAuthHeader header = new TAuthHeader();
            header.SessionID = (String)Session["sessionID"];
            header.SessionKey = (String)Session["sessionKey"];
            client.TAuthHeaderValue = header;

            client.DelAuction(id, "Аукцион отменен заказчиком");
            return Json(true);
        }