Пример #1
0
        internal int Create(ContractorJob newContractorJob)
        {
            string sql = @"INSERT INTO contractorjob
            (jobId, contractorId, creatorId)
            VALUES
            (@JobId, @ContractorId, @CreatorId);
            SELECT LAST_INSERT_ID();";

            return(_db.ExecuteScalar <int>(sql, newContractorJob));
        }
 public ActionResult <ContractorJob> Create([FromBody] ContractorJob newCJ)
 {
     try
     {
         return(Ok(_service.Create(newCJ)));
     }
     catch (System.Exception err)
     {
         return(BadRequest(err.Message));
     }
 }
Пример #3
0
        public int Create(ContractorJob newCj)
        {
            string sql = @"
            INSERT INTO contractorJobs
            (contractorId, jobId, creatorId)
            VALUES
            (@ContractorId, @JobId, @CreatorId);
            SELECT LAST_INSERT_ID();";

            return(_db.ExecuteScalar <int>(sql, newCj));
        }
Пример #4
0
        public void FindContractor()
        {
            DataTable dt = SelectedJob.Find();


            contractorJobCollection.Clear();
            // MessageBox.Show(dt.Rows.Count.ToString());
            int i        = 0;
            int assigned = 0;

            IsContractorSelected = true;
            foreach (DataRow dr in dt.Rows)
            {
                if (i == 0)
                {
                    SelectedContractor = new ContractorJob(dr);
                }
                i++;
                // MessageBox.Show(dr[0].ToString());
                if (dr[0].ToString().Equals("Proposed") || dr[0].ToString().Equals("Accepted") || dr[0].ToString().Equals("Completed"))
                {
                    assigned++;
                    //   MessageBox.Show(IsContractorSelected.ToString());
                }


                //  Contractor contractor = new Contractor(dr);
                // MessageBox.Show(dr[0].ToString());
                if (!(dr[0].ToString().Equals("Rejected")))
                {
                    ContractorJob contractorjob = new ContractorJob(dr);
                    contractorJobCollection.Add(contractorjob);
                }
            }
            if (contractorJobCollection.Count == 0)
            {
                IsContractorSelected = false;
                MessageBox.Show("No contractor availiable!", "Find Contractor", MessageBoxButton.OK, MessageBoxImage.Information);
            }
            else
            {
                if (assigned == 0)
                {
                    IsContractorSelected = true;
                }
                else
                {
                    IsContractorSelected = false;
                }
            }


            //MessageBox.Show(IsContractorSelected.ToString());
        }
Пример #5
0
        internal ContractorJob Create(ContractorJob newCJ)
        {
            string sql = @"
      INSERT INTO contractorjobs 
      (jobId, contractorId, creatorId) 
      VALUES 
      (@JobId, @ContractorId, @CreatorId);
      SELECT LAST_INSERT_ID();";
            int    id  = _db.ExecuteScalar <int>(sql, newCJ);

            newCJ.Id = id;
            return(newCJ);
        }
Пример #6
0
        public async Task <ActionResult <ContractorJob> > CreateAsync([FromBody] ContractorJob newCJ)
        {
            try
            {
                Profile userInfo = await HttpContext.GetUserInfoAsync <Profile>();

                newCJ.CreatorId = userInfo.Id;
                return(Ok(_cjservice.Create(newCJ)));
            }
            catch (System.Exception err)
            {
                return(BadRequest(err.Message));
            }
        }
        public async Task <ActionResult <ContractorJob> > Create([FromBody] ContractorJob newContractorJob)
        {
            try
            {
                Profile userInfo = await HttpContext.GetUserInfoAsync <Profile>();

                newContractorJob.CreatorId = userInfo.Id;
                ContractorJob created = _cjs.Create(newContractorJob);
                return(Ok(created));
            }
            catch (System.Exception error)
            {
                return(BadRequest(error.Message));
            }
        }
 internal ContractorJob Create(ContractorJob newCJ)
 {
     return(_repo.Create(newCJ));
 }
 internal ContractorJob Create(ContractorJob newCJ)
 {
     //TODO if they are creating a ContractorJob, make sure they are the creator of the list
     return(_repo.Create(newCJ));
 }
 internal ContractorJob Create(ContractorJob newCJ)
 {
     //TODO if they are creating a wishlistproduct, make sure they are the creator of the list
     return(_cjrepo.Create(newCJ));
 }
Пример #11
0
 public ContractorJob Create(ContractorJob newCj)
 {
     newCj.Id = _repo.Create(newCj);
     return(newCj);
 }
 internal ContractorJob Create(ContractorJob newCJ)
 {
     throw new NotImplementedException();
 }
Пример #13
0
 internal ContractorJob Create(ContractorJob newContractorJob)
 {
     newContractorJob.Id = _repo.Create(newContractorJob);
     return(newContractorJob);
 }