public void ListJobNo(Auth auth, List_JobNo request, List_JobNo_Logic list_JobNo_Logic, CommonResponse ecr, string[] token, string uri) { if (auth.AuthResult(token, uri)) { List<job> JobList = new List<job>(); HashSet<string> hsResult = list_JobNo_Logic.GetList(request); if (hsResult.Count > 0) { ecr.meta.code = 200; ecr.meta.message = "OK"; } else { ecr.meta.code = 612; ecr.meta.message = "The specified resource does not exist"; } foreach (string strJobNo in hsResult) { job j = new job(); j.JobNo = strJobNo; j.ContainerCounts = list_JobNo_Logic.GetCount(request.PhoneNumber, strJobNo).ToString(); JobList.Add(j); } ecr.data.results = JobList; } else { ecr.meta.code = 401; ecr.meta.message = "Unauthorized"; } }
//JobsController - CreateJobMechanic(job jobMechanic) public HttpStatusCodeResult AssigningMechanic(job incomingJob) { db.Entry(incomingJob).State = System.Data.EntityState.Modified; db.SaveChanges(); return new HttpStatusCodeResult(200); }
public override bool processSelectedItem(string selection, Player playerObject) { if (displayingJobs) { displayingJobs = false; foreach(job currJob in selectedJobs) { if(currJob.missionText == selection) { menuText = selection + "\n"; menuText += "Mission reward: $" + currJob.moneyValue + "\n"; menuText += "Control reward: " + currJob.controlValue + "\n"; menuText += "Number of required Muscle: " + currJob.muscleRequired + "\n"; menuText += "Number of required bodyguards: " + currJob.bodyguardsRequired + "\n"; menuText += "Number of required hitmen: " + currJob.hitmenRequired + "\n"; menuOptions.Clear(); menuOptions.Add("Accept"); menuOptions.Add("Decline"); displayedJob = currJob; break; } } return false; } else { if (selection == "Accept") { //need some way of adding this job to a queue back on game. Also only want one job accepted at a time, also need to check that the job is doable. if (playerObject.haveRequiredNumberOfBodyguards(displayedJob.bodyguardsRequired) && playerObject.haveRequiredNumberOfHitmen(displayedJob.hitmenRequired) && playerObject.haveRequiredNumberOfMuscle(displayedJob.muscleRequired)) { playerObject.assignJob(displayedJob); menuText = "Sorry Boss, we can only support one job at a time, come back tomorrow"; menuOptions.Clear(); menuOptions.Add("Ok"); return true; } else { return false; } } else { displayingJobs = true; menuText = originalMenuText; updateMenuOptions(); return false; } } }
// // GET: /Job/Edit/5 public ActionResult Edit(int id = 0) { ViewData["Tasks"] = db.tasks.ToList(); job job = db.jobs.Find(id); if (job == null) { return(HttpNotFound()); } return(View(job)); }
// Use this for initialization void Start() { found = false; current = job.search; home = GameObject.FindGameObjectWithTag("home"); ui = home.GetComponent <UIManager>(); agent = GetComponent <NavMeshAgent>(); search = GetComponent <SphereCollider>(); resourceManager = GameObject.FindGameObjectWithTag("resourcemanager"); agent.speed = moveSpeed; //Set home & resourcemanager }
public ActionResult editDetails(job_model model) { ViewBag.category = new SelectList(db.job_categories.ToList(), "jobcat_id", "category_name"); ViewBag.districts = new SelectList(db.nepal_district.ToList(), "district_name", "district_name"); if (ModelState.IsValid) { try { job job = new job(); job = db.jobs.Find(model.job_id); job.title = model.title; job.submission_date = Convert.ToDateTime(model.submission_date); job.description = model.description; job.category = Convert.ToInt16(model.category); job.job_type = model.job_type; job.job_level = model.job_level; job.gender = model.gender; job.salaryfrom = model.salaryfrom; job.salaryto = model.salaryto; job.experience = Convert.ToInt32(model.experience); job.state = model.state; job.district = model.district; job.city = model.city; job.postalcode = model.postalcode; job.full_address = model.full_address; job.created_at = DateTime.Now; job.openings = model.openings; job.status = 1; job.skills = model.skills; if (db.SaveChanges() > 0) { ViewBag.message = "<div class='alert alert-success'><center>Sucessfully Inserted!</center></div>"; ModelState.Clear(); return(RedirectToAction("jobDetails", new RouteValueDictionary( new { controller = "employer", action = "jobDetails", id = job.job_id }))); } else { ViewBag.message = "<div class='alert alert-danger'>Something went wrong!</div>"; return(View()); } } catch (Exception ex) { ViewBag.error = ex.ToString(); return(View()); } } else { return(View()); } }
public ActionResult <job> Create([FromBody] job newJob) { try { FakeDB.Jobs.Add(newJob); return(Created($"api/job/{newJob.Id}", newJob)); } catch (Exception e) { return(BadRequest(e.Message)); } }
public ActionResult EditApplication(job newapplication) // { if (ModelState.IsValid) { db.Entry(newapplication).State = System.Data.Entity.EntityState.Modified; db.SaveChanges(); return(RedirectToAction("RecrutierApplication", "Recrutier", new { @id = newapplication.Userid })); } return(View(newapplication)); }
public ActionResult <job> Edit([FromBody] job updated, int id) { try { updated.Id = id; return(Ok(_service.Edit(updated))); } catch (Exception e) { return(BadRequest(e.Message)); } }
public IHttpActionResult Postjob(job job) { if (!this.ModelState.IsValid) { return(this.BadRequest(this.ModelState)); } this.db.jobs.Add(job); this.db.SaveChanges(); return(this.CreatedAtRoute("DefaultApi", new { id = job.job_Id }, job)); }
public ActionResult Edit([Bind(Include = "job_id,title,sector,about,aim,who,banner_image,icon_image,privacy,content,post_date,group_id,user_id")] job job) { if (ModelState.IsValid) { db.Entry(job).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.group_id = new SelectList(db.groups, "group_id", "title", job.group_id); ViewBag.user_id = new SelectList(db.users, "user_id", "user_asp_id", job.user_id); return(View(job)); }
public IHttpActionResult Postjob(job job) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } db.jobs.Add(job); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = job.id }, job)); }
public static job GenerateRandomJob(bool RandomPay) { var RandomChosen = JobsList.Keys.ToArray()[R.Next(0, JobsList.Count)]; var Job = new job() { Name = RandomChosen, Pay = RandomPay ? R.Next(1, 750) : JobsList[RandomChosen], StillAvailable = true, }; return(Job); }
public ActionResult Create([Bind(Include = "job_id,employee_id,job_position,job_description,job_salary")] job job) { if (ModelState.IsValid) { db.jobs.Add(job); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.employee_id = new SelectList(db.employees, "employee_id", "employee_name", job.employee_id); return(View(job)); }
public ActionResult Create([Bind(Include = "id,PassengerId,PassengerName,PassengerPhone,DriverId,DriverName,dateAndTime,pickUp,PdoorNumber,DropUP,DdoorNumber,CarType,JobType,Price,DriverMessage,status,Hours,Mile,Attribute,Message")] job job) { if (ModelState.IsValid) { db.jobs.Add(job); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.PassengerId = new SelectList(db.Passengers, "Id", "UserFirstName", job.PassengerId); return(View(job)); }
public ActionResult Edit([Bind(Include = "jobID,locationLat,locationLong,date,time,description,numVolsNeed,createdBy")] job job) { if (ModelState.IsValid) { db.Entry(job).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.createdBy = new SelectList(db.user, "userID", "firstName", job.createdBy); ViewBag.jobID = new SelectList(db.jobPics, "jobID", "before", job.jobID); return(View(job)); }
internal job Edit(job updated) { // REVIEW job data = GetById(updated.Id); //null check properties you are editing in repo data.Commander = updated.Commander != null ? updated.Commander : data.Commander; data.Name = updated.Name != null ? updated.Name : data.Name; data.Defense = updated.Defense != null ? updated.Defense : data.Defense; return(_repo.Edit(data)); }
internal job Create(job newjob) { string sql = @" INSERT INTO jobs (name, commander, id, defense) VALUES (@Name, @Commander, @Id, @Defense); SELECT LAST_INSERT_ID();"; int id = _db.ExecuteScalar <int>(sql, newjob); newjob.Id = id; return(newjob); }
public ActionResult Edit(int id, job o) { try { // TODO: Add update logic here jobb.UpdateJob(o); return(RedirectToAction("Index")); } catch { return(View()); } }
public clsPegawai(int id, int nip, string nama, int jenisKelamin, string alamat, double gaji, DateTime tanggalMasuk, DateTime tanggalLahir, int profesi) { this.id = id; this.nip = nip; this.nama = nama; this.jenisKelamin = (gender)jenisKelamin; this.alamat = alamat; this.gaji = gaji; this.tanggalLahir = tanggalLahir; this.tanggalMasuk = tanggalMasuk; this.profesi = (job)profesi; }
internal job Edit(job updatedjob) { string sql = @" UPDATE jobs SET name = @Name, commander = @Commander, defense = @Defense WHERE id = @Id; SELECT * FROM jobs WHERE id = @Id;"; job returnjob = _db.QueryFirstOrDefault <job>(sql, updatedjob); return(returnjob); }
// GET: jobs/Details/5 public ActionResult Details(int?id) //job Details { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } job job = db.jobs.Find(id); if (job == null) { return(HttpNotFound()); } return(View(job)); }
public ActionResult AddReward(int id) { job job = _jobService.GetById(id); if (job == null) { return(HttpNotFound()); } return(View(new JobViewDetailsModel() { User = CurrentUser, Job = job })); }
public IHttpActionResult Deletejob(int id) { job job = db.jobs.Find(id); if (job == null) { return(NotFound()); } db.jobs.Remove(job); db.SaveChanges(); return(Ok(job)); }
// GET: jobs/Edit/5 public ActionResult Edit(short?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } job job = db.jobs.Find(id); if (job == null) { return(HttpNotFound()); } return(View(job)); }
public ActionResult Create(job j) { if (ModelState.IsValid) { jobb.AddService(j); return(RedirectToAction("Index")); } else { return(View()); } }
public ActionResult Edit([Bind(Include = "job_id,job_desc,min_lvl,max_lvl")] job job) { if (ModelState.IsValid) { db.Entry(job).State = EntityState.Modified; db.SaveChanges(); TempData["message_css"] = "alert alert-success"; TempData["message"] = "Successful"; return(RedirectToAction("Index")); } TempData["message_css"] = "alert alert-danger"; TempData["message"] = "Invalid input"; return(View(job)); }
public ActionResult postJob(job_model model) { ViewBag.category = new SelectList(db.company_type.ToList(), "id", "category_name"); ViewBag.districts = new SelectList(db.nepal_district.ToList(), "district_name", "district_name"); if (ModelState.IsValid) { try { int sessionid = Convert.ToInt32(Session["userid"].ToString()); job job = new job(); job.title = model.title; job.submission_date = Convert.ToDateTime(model.submission_date); job.description = model.description; job.category = Convert.ToInt16(model.category); job.job_type = model.job_type; job.job_level = model.job_level; job.gender = model.gender; job.salaryfrom = model.salaryfrom; job.salaryto = model.salaryto; job.experience = Convert.ToInt32(model.experience); job.state = model.state; job.district = model.district; job.city = model.city; job.postalcode = model.postalcode; job.full_address = model.full_address; job.created_at = DateTime.Now; job.openings = model.openings; job.status = 1; job.skills = model.skills; job.employer = (from a in db.employer_info where a.login_info == sessionid select a.emp_id).FirstOrDefault(); db.jobs.Add(job); if (db.SaveChanges() > 0) { ViewBag.message = "<div class='alert alert-success'><center>Sucessfully Inserted!</center></div>"; ModelState.Clear(); } else { ViewBag.message = "<div class='alert alert-danger'>Something went wrong!</div>"; } } catch (Exception ex) { return(null); } } return(View("postJob")); }
public bool commitInsert(string _title, string _desc, DateTime _date) { jobsDataContext objJobDC = new jobsDataContext(); using (objJobDC) { job objNewJob = new job(); objNewJob.title = _title; objNewJob.description = _desc; objNewJob.last_date_apply = _date; objJobDC.jobs.InsertOnSubmit(objNewJob); objJobDC.SubmitChanges(); return true; } }
public IHttpActionResult Postjob(job Job) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } string userId = User.Identity.GetUserId(); Job.UserId = userId; db.jobs.Add(Job); db.SaveChanges(); return(CreatedAtRoute("DefaultApi", new { id = Job.Id }, Job)); }
// GET: jobs/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } job job = db.jobs.Find(id); if (job == null) { return(HttpNotFound()); } ViewBag.PassengerId = new SelectList(db.Passengers, "Id", "UserFirstName", job.PassengerId); return(View(job)); }
// The id parameter name should match the DataKeyNames value set on the control public void fv_DeleteItem(Int16 job_id) { var item = this.contextWrapper.GetEFContext().jobs.FirstOrDefault(x => x.job_id == job_id); if (item == null) { this.ModelState.AddModelError(string.Empty, string.Format("Item with id {0} not found", job_id)); return; } var job = new job { job_id = job_id }; this.contextWrapper.GetEFContext().Entry(job).State = System.Data.EntityState.Deleted; this.contextWrapper.GetEFContext().SaveChanges(); }
// GET: jobs/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } job job = db.jobs.Find(id); if (job == null) { return(HttpNotFound()); } ViewBag.employee_id = new SelectList(db.employees, "employee_id", "employee_name", job.employee_id); return(View(job)); }
public ActionResult DeleteConfirmed(short id) { job job = db.jobs.Find(id); db.jobs.Remove(job); try { db.SaveChanges(); } catch (Exception e) { return(RedirectToAction("../Home/Error")); } return(RedirectToAction("Index")); }
public ActionResult Delete(int id) { try { job jo = db.jobs.Find(id); db.jobs.Remove(jo); db.SaveChanges(); return(RedirectToAction("Index")); } catch { return(View()); } }
public void UpdateJob(Int16 ID, string Description, byte Minimum, byte Maximum) { var ctx = new PubsEntities(); var job = new job(); job.job_id = ID; job.job_desc = Description; job.min_lvl = Minimum; job.max_lvl = Maximum; ctx.jobs.Attach(job); ctx.Entry(job).State = System.Data.EntityState.Modified; ctx.ChangeTracker.DetectChanges(); ctx.SaveChanges(); }
public job Insert_job_select(int ID) { job = job.Select(ID); Insert_address_id_txt.Text = Convert.ToString(job.address_id); Insert_company_id_txt.Text = Convert.ToString(job.company_id); Insert_job_cat_id_txt.Text = Convert.ToString(job.job_cat_id); Insert_job_posted_date_txt.Text = Convert.ToString(job.job_posted_date); Insert_job_status_txt.Text = Convert.ToString(job.job_status); Insert_job_title_txt.Text = Convert.ToString(job.job_title); Insert_Work_Classification_Full_time_txt.Text = Convert.ToString(job.Work_Classification_Full_time); Insert_Work_Classification_Part_time_txt.Text = Convert.ToString(job.Work_Classification_Part_time); Insert_Work_Payment_Freq_Weekly_txt.Text = Convert.ToString(job.Work_Payment_Freq_Weekly); Insert_Work_Payment_Freq_Bi_Weekly_txt.Text = Convert.ToString(job.Work_Payment_Freq_Bi_Weekly); Insert_Work_Payment_Freq_Monthly_txt.Text = Convert.ToString(job.Work_Payment_Freq_Monthly); Insert_Work_Payment_Freq_Bi_Monthly_txt.Text = Convert.ToString(job.Work_Payment_Freq_Bi_Monthly); return job; }
protected void addNew_Click(object sender, EventArgs e) { var j = new job { job_desc = this.description.Text, max_lvl = Convert.ToByte(this.maximum.Text), min_lvl = Convert.ToByte(this.minimum.Text) }; var ctx = new PubsEntities(); ctx.jobs.Add(j); ctx.SaveChanges(); this.status.Text = "Job added"; this.gv.DataBind(); }
public HttpStatusCodeResult CreateJob(job j) { var modelid = (from a in db.cars join b in db.bookings on a.CarID equals b.CarID where b.BookingID == j.BookingID select a.ModelID).SingleOrDefault(); j.Difficulty = (from x in db.model_jobslist where x.ModelID == modelid && x.JobslistID == j.JobsListID select x.Difficulty).SingleOrDefault(); j.TimeAllowed = (from x in db.model_jobslist where x.ModelID == modelid && x.JobslistID == j.JobsListID select x.ApproxTime).SingleOrDefault(); j.Status = "new"; db.jobs.Add(j); db.SaveChanges(); return new HttpStatusCodeResult(HttpStatusCode.OK); }
protected void Insert_Select_Record(object sender, EventArgs e) { job = Insert_job_select(Convert.ToInt32(Insert_job_GridView.SelectedValue)); }
//===========// //MechanicJob// //===========// public int CurrentTimeOfJob(job j) { if (j.TimeAllowed == null) return 0; return (int)j.TimeAllowed; }
//mechanics comment when finishing job public ActionResult UserComment(job incomingJob) { db.Entry(incomingJob).State = System.Data.EntityState.Modified; db.SaveChanges(); return new HttpStatusCodeResult(HttpStatusCode.OK); }
public timessheet FindCurrentTimeSheet(job jb) { var timesheet = db.timessheets.Where(x => x.JobID == jb.JobID).OrderByDescending(x => x.StartTime).First(); return timesheet; }
partial void Deletejob(job instance);
partial void Updatejob(job instance);
partial void Insertjob(job instance);
//creates a new notification when mechanic is added to job public HttpStatusCodeResult newNotification(job j) { notification newNotification = new notification(); newNotification.MechanicID = (int)j.MechanicID; newNotification.Read = false; newNotification.Message = "'" + UppercaseFirst(j.jobslist.Name) + "' on Car: " + UppercaseFirst(j.booking.car.model.make.MakeName) + " " + UppercaseFirst(j.booking.car.model.ModelName) + " with Reg " + j.booking.car.Registration; newNotification.Date = DateTime.Now; newNotification.MechanicID = (int)j.MechanicID; newNotification.JobID = j.JobID; db.notifications.Add(newNotification); db.SaveChanges(); return new HttpStatusCodeResult(200); }
public job job_insert() { job.address_id = Convert.ToInt32(Insert_address_id_txt.Text); job.company_id = Convert.ToInt32(Insert_company_id_txt.Text); job.job_cat_id = Convert.ToInt32(Insert_job_cat_id_txt.Text); job.job_posted_date = Convert.ToDateTime(Insert_job_posted_date_txt.Text); job.job_status = Insert_job_status_txt.Text; job.job_title = Insert_job_title_txt.Text; job.Work_Classification_Full_time = Insert_Work_Classification_Full_time_txt.Text; job.Work_Classification_Part_time = Insert_Work_Classification_Part_time_txt.Text; job.Work_Payment_Freq_Weekly = Insert_Work_Payment_Freq_Weekly_txt.Text; job.Work_Payment_Freq_Bi_Weekly = Insert_Work_Payment_Freq_Bi_Weekly_txt.Text; job.Work_Payment_Freq_Monthly = Insert_Work_Payment_Freq_Monthly_txt.Text; job.Work_Payment_Freq_Bi_Monthly = Insert_Work_Payment_Freq_Bi_Monthly_txt.Text; job = job.Insert(job); Insert_job_GridView.DataBind(); Update_job_GridView.DataBind(); Delete_job_GridView.DataBind(); return job; }
protected void Update_Select_Record(object sender, EventArgs e) { job = Update_job_select(Convert.ToInt32(Update_job_GridView.SelectedValue)); }
protected void UPDATE(object sender, EventArgs e) { job = job_update(Convert.ToInt32(Update_job_GridView.SelectedValue)); }
public ActionResult CreateJob(job j) { if (ModelState.IsValid) { var job = _repo.CreateJob(j); return job; } else { return new HttpStatusCodeResult(HttpStatusCode.BadRequest); } }
protected void INSERT(object sender, EventArgs e) { job = job_insert(); }