Esempio n. 1
0
        // TODO: изменить статус у заявки при принятии ее от тендера

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                id            = Convert.ToInt32(Request.QueryString["id"]);
                TenderRequest = TendersHelper.GetTenderRequest(id);
            }
        }
    public TenderRequest addTenderList(Hunter _hunter)
    {
        string        index  = Time.time + "h" + Random.Range(-10000, 10000);
        TenderRequest tender = new TenderRequest(index, _hunter);

        tenderList.Add(index, tender);
        return(tender);
    }
Esempio n. 3
0
        public void AddTender(TenderRequest tenderRequest)
        {
            var tender = new Tender
            {
                TenderName = tenderRequest.TenderName,
                EmployeeId = tenderRequest.EmployeeId,
                State      = tenderRequest.State
            };

            _tenderRepository.AddTender(tender);
        }
Esempio n. 4
0
        public void EditTender(int id, TenderRequest tenderValue)
        {
            var tender = new Tender()
            {
                Id         = id,
                TenderName = tenderValue.TenderName,
                State      = tenderValue.State,
                EmployeeId = tenderValue.EmployeeId
            };

            _tenderRepository.EditTender(tender);
        }
    public TenderRequest checkTenderList()
    {
        TenderRequest tender = null;

        foreach (string key in tenderList.Keys)
        {
            if (tenderList[key].available)
            {
                tenderList[key].available = false;
                tender = tenderList[key];
            }
        }
        return(tender);
    }
    public override bool perform(GameObject agent)
    {
        if (startTime == 0)
        {
            enableBubbleIcon(agent);
            Hunter hunter = (Hunter)agent.GetComponent(typeof(Hunter));

            TenderRequest tender = targetCenter.checkTenderList();
            if (tender == null)
            {
                Debug.Log("AAAHH no tender");
                TenderRequest newTender = targetCenter.addTenderList(hunter);
                hunter.tenderRequest = newTender;
            }
            else
            {
                Hunter targetHunter = tender.hunter;
                // This hunter
                hunter.tenderRequest = tender;
                hunter.coopHunter    = targetHunter;
                hunter.leader        = false;
                //The other hunter
                targetHunter.coopHunter = hunter;
                targetHunter.leader     = true;

                //Copy other's states
                hunter.actualPrey = targetHunter.actualPrey;
                Debug.Log("Coop Hunter found!");
                // Debug line
                Debug.DrawLine(targetHunter.transform.position, agent.transform.position, Color.red, 3, false);
            }
            startTime = Time.time;
        }

        if (Time.time - startTime > duration)
        {
            disableBubbleIcon(agent);
            isChecked = true;
        }
        return(true);
    }
Esempio n. 7
0
        protected void ButtonAddRequest_Click(object sender, EventArgs e)
        {
            int    cost        = Convert.ToInt32(TextBoxCost.Text);
            string description = TextBoxDescription.Text;
            int    tenderId    = Convert.ToInt32(Request.QueryString["id"]);

            tender = TendersHelper.GetTenderById(tenderId);

            TenderRequest tenderRequest = new TenderRequest()
            {
                // ид текущего пользователя
                ProviderId = User.UserId,
                // id владельца тендера
                CustomerId   = tender.UserOwnerId,
                Description  = description,
                Cost         = cost,
                TenderId     = tenderId,
                ProviderName = User.UserName
            };

            TendersHelper.CreateTenderRequest(tenderRequest);
        }
Esempio n. 8
0
        public List <TenderRequest> SelectAllTenders()
        {
            var tenderRes     = _tenderRepository.SelectAllTenders();
            var listOfTenders = new List <TenderRequest>();


            foreach (var e in tenderRes)
            {
                var tenderRequest = new TenderRequest
                {
                    EmployeeId = e.EmployeeId,
                    State      = e.State,
                    TenderId   = e.Id,
                    TenderName = e.TenderName
                };
                var employee = _employeeRepository.SelectEmployeeById(tenderRequest.EmployeeId);
                tenderRequest.Employee = employee.FName + " " + employee.LName;

                tenderRequest.TotalWh = EstimateTotalWorkhours(tenderRequest.TenderId);
                listOfTenders.Add(tenderRequest);
            }

            return(listOfTenders);
        }
Esempio n. 9
0
 public void Post(int id, [FromBody] TenderRequest tenderValue)
 {
     _tenderModule.EditTender(id, tenderValue);
 }
Esempio n. 10
0
 public void Post([FromBody] TenderRequest tenderValue)
 {
     _tenderModule.AddTender(tenderValue);
 }
 public void removeTenderList(TenderRequest _tender)
 {
     tenderList.Remove(_tender.index);
 }