//} public void ExportData(int empID, string startDate, string endDate) { JobsModel jm = new JobsModel(); jm.EmpID = Convert.ToInt32(empID); jm.startDate = Convert.ToDateTime(startDate); jm.endDate = Convert.ToDateTime(endDate); //ViewBag.EmployeeeName = jm.GetName(); //return View(jm.GetJobDetails()); GridView gv = new GridView(); //gv.DataSource = db.Studentrecord.ToList(); gv.DataSource = jm.GetJobDetails(); gv.DataBind(); Response.ClearContent(); Response.Buffer = true; Response.AddHeader("content-disposition", "attachment; filename=Marklist.xls"); Response.ContentType = "application/ms-excel"; Response.Charset = ""; StringWriter sw = new StringWriter(); HtmlTextWriter htw = new HtmlTextWriter(sw); gv.RenderControl(htw); Response.Output.Write(sw.ToString()); Response.Flush(); Response.End(); //return RedirectToAction("StudentDetails"); }
// GET: Work public ActionResult Index() { JobsModel model = new JobsModel(); model.Jobs = _workService.GetJobsByName(User.Identity.Name); return(View(model)); }
public async Task <IActionResult> Edit(int id, [Bind("ID,company,title,job_number,last_checked,last_updated,date_applied,status,notes,interview,rejected,city,state,country")] JobsModel jobsModel) { if (id != jobsModel.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(jobsModel); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!JobsModelExists(jobsModel.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(jobsModel)); }
private void Button2_Click(object sender, EventArgs e) { if (listBox1.SelectedItems.Count == 0) { return; } int id = JobsModel.GetOneJobs(listBox1.SelectedItem.ToString()).First().Id; if (id == 0) { return; } var employeeByID = MainModel.GetByJobsID(id); // Если пользователь привязан к этому ID if (employeeByID.Count() != 0) { MessageBox.Show( "Працівник: " + employeeByID.First().LName + " " + employeeByID.First().FName + " [#" + employeeByID.First().Id + "] - займає цю посаду", "Помилка" ); return; } int isDeleted = JobsModel.DeleteObject <JobsTable>(id); if (isDeleted == 1) { listBox1.Items.Remove(listBox1.SelectedItem); } }
public EditJob(JobsModel job) { InitializeComponent(); this.job = job; Text = $"Edit Job# {job.JobNumber}"; FillJobInfo(); }
public ActionResult Update(JobsModel proj) { try { List<JobsModel> JobsInfo = new List<JobsModel>(); using (var client = new HttpClient()) { client.BaseAddress = new Uri(Baseurl); //HTTP GET var responseTask = client.PutAsJsonAsync("api/Jobs/update", proj); responseTask.Wait(); var result = responseTask.Result; if (result.IsSuccessStatusCode) { //Storing the response details recieved from web api var JobsResponse = result.Content.ReadAsStringAsync().Result; //Deserializing the response recieved from web api and storing into the Sub SORType list JobsInfo = JsonConvert.DeserializeObject<List<JobsModel>>(JobsResponse); } } int id = proj.projId; return RedirectToAction("Index", id); } catch (Exception ex) { ExceptionLogHandler.LogData(ex); throw ex; } }
public List <JobsModel> GetAll() { using (SqlConnection con = new SqlConnection(connectionString)) { con.Open(); var command = con.CreateCommand(); command.CommandText = "JobsTable_GetAll"; command.CommandType = System.Data.CommandType.StoredProcedure; using (SqlDataReader reader = command.ExecuteReader()) { var results = new List <JobsModel>(); while (reader.Read()) { var job = new JobsModel(); job.Id = (int)reader["Id"]; job.Company = (string)reader["Company"]; job.Position = (string)reader["Position"]; job.DateApplied = (string)reader["DateApplied"]; job.Website = (string)reader["Website"]; job.FollowUp = (string)reader["FollowUp"]; results.Add(job); } return(results); } } }
private void Button1_Click(object sender, EventArgs e) { if (string.IsNullOrWhiteSpace(textBox1.Text)) { return; } if (isEdit) { int isUpdate = JobsModel.Update(new JobsTable { Id = JobsModel.GetOneJobs(listBox1.SelectedItem.ToString()).First().Id, Title = textBox1.Text }); if (isUpdate == 1) { listBox1.Items.Remove(listBox1.SelectedItem); listBox1.Items.Add(textBox1.Text); textBox1.Text = string.Empty; } return; } int isInsert = JobsModel.Insert(new JobsTable { Title = textBox1.Text }); if (isInsert == 1) { listBox1.Items.Add(textBox1.Text); } }
public ActionResult Jobs(JobsModel jobs) { LoginModel login = Session["Account"] as LoginModel; jobs.ID_Job = user.getID(login.Username.ToString()); user.addNewJob(jobs); return(View()); }
public ActionResult JobDeleteConfirmed(int id) { JobsModel jobsModel = db.Jobs.Find(id); db.Jobs.Remove(jobsModel); db.SaveChanges(); return(RedirectToAction("AllJobs")); }
public ActionResult SingleJob(int id) { JobsModel Jobs = new JobsModel() { singleJobs = UserJobPostingservice.GetJobsbyId(id) }; return(View(Jobs)); }
public Mill(Village v, JobsModel job) : base(v) { Name = "Moulin"; _name = Name; Hp = MaxHp = 50; _job = job; this.CostPrice = 375; }
public Restaurant(Village v, JobsModel job) : base(v) { Name = "Restaurant"; _name = Name; Hp = MaxHp = 50; _job = job; this.CostPrice = 400; }
public UnionOfCrafter(Village v, JobsModel job) : base(v) { Name = "Syndicat"; _name = Name; Hp = MaxHp = 50; _job = job; this.CostPrice = 50; }
public ClothesShop(Village v, JobsModel job) : base(v) { Name = "Magasin"; _name = Name; Hp = MaxHp = 50; _job = job; this.CostPrice = 300; }
public Forge(Village v, JobsModel job) : base(v) { Name = "Forge"; _name = Name; Hp = MaxHp = 50; _job = job; this.CostPrice = 100; }
public MilitaryCamp(Village v, JobsModel job) : base(v) { Name = "QG"; _name = Name; Hp = MaxHp = 50; _job = job; this.CostPrice = 800; }
public JobInfo(JobsModel job) { InitializeComponent(); this.job = job; checkBoxComplete.Checked = job.Completed; GetInfo(); SetJobInfo(); SetDataGridView(); }
public async Task <IActionResult> Create([Bind("ID,company,title,job_number,last_checked,last_updated,date_applied,status,notes,interview,rejected,city,state,country")] JobsModel jobsModel) { if (ModelState.IsValid) { _context.Add(jobsModel); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(jobsModel)); }
public ActionResult JobEdit([Bind(Include = "ID,UserID,Name,Description,City,State,RequiredSkills,Photo,Pay,IsComplete")] JobsModel jobsModel) { if (ModelState.IsValid) { db.Entry(jobsModel).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("AllJobs")); } ViewBag.UserID = new SelectList(db.Admins, "ID", "FirstName", jobsModel.UserID); return(View(jobsModel)); }
public ActionResult Create([Bind(Include = "ID,UserID,Name,Description,City,State,RequiredSkills,Photo,Pay,IsComplete")] JobsModel jobsModel) { if (ModelState.IsValid) { db.Jobs.Add(jobsModel); db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.UserID = new SelectList(db.Admins, "ID", "FirstName", jobsModel.UserID); return(View(jobsModel)); }
public async Task <JobsModel> GetModel(string path) { JobsModel model = null; HttpResponseMessage response = await httpClient.GetAsync(jenkinsUrl); if (response.IsSuccessStatusCode) { model = await response.Content.ReadAsAsync <JobsModel>(); } return(model); }
public void testParseTopLevelConfig() { string content = ResourceHelper.GetEmbeddedResource("/top_level_projects.json"); string url = "http://test"; HttpClient moqClient = HttpClientMoqHelper.CreateHttpClientMoq(url, content); JenkinsConnector connector = new JenkinsConnector(moqClient, url, null, null); JobsModel modelTask = connector.GetModel("/").Result; Assert.AreEqual(modelTask.Jobs.Count, 3); }
public ActionResult SingleJob(int id) { if (Session["UserId"] != null) { JobsModel Jobs = new JobsModel() { singleJobs = UserJobPostingservice.GetJobsbyId(id) }; return(View(Jobs)); } return(RedirectToAction(LoginPages.Login, LoginPages.Account, new { area = "" })); }
private void MarkJobCompleted(bool completed) { JobsModel editJob = new JobsModel() { Id = job.Id, JobNumber = job.JobNumber, Customer = job.Customer, Model = job.Model, Completed = completed }; PrepAndPaintDB.EditJob(editJob); }
public FormJobs() { InitializeComponent(); var jobs = JobsModel.GetAllJobs(); foreach (var job in jobs) { listBox1.Items.Add(job.Title); } Text = Config.PROJECT_NAME + " - Посади"; }
public static void AddItems(MainTable mt) { var job = JobsModel.GetOneJobs(mt.JobId); string JobTitle = job.Count() > 0 ? job.First().Title : ""; l.Items.Add(new ListViewItem(new[] { T(mt.Id), T(mt.FName), T(mt.LName), T(mt.MName), JobTitle, T(mt.Email), T(mt.TelWork), mt.Sex ? "Чоловік" : "Жінка", T(mt.IsActivity), T(mt.EmploymentDate), T(mt.UpdateAt) })); ColorRows(GetCountItems() - 1, mt); }
private void EditorSelector_Clicked(object sender, MouseButtonEventArgs e) { var panel = sender as Grid; string panelName = panel.Name; switch (panelName) { case "jobInfoChangedGrid": HideAllEditingPlanes(); SetJobBoxesToReadWrite(); companyNameBox.IsReadOnly = false; break; case "locationInfoChangedGrid": HideAllEditingPlanes(); SetLocationBoxesToReadWrite(); break; case "recruiterInfoChangedGrid": HideAllEditingPlanes(); MessageBoxResult result; if (IsRecruiterInitialized == false) { result = MessageBox.Show("This job was not created with a recruiter. Would you like to add one?", "Recruiter", MessageBoxButton.YesNo, MessageBoxImage.Question); if (result == MessageBoxResult.Yes) { Recruiter recruiter = new Recruiter() { RecruiterName = "", PhoneNumber = "", LinkedInLink = "", Email = "" }; SQLConnections sql = new SQLConnections(); int newRecruiterID = sql.AddRecruiterGetID(recruiter); sql.UpdateJobWithRecruiterID(newRecruiterID, jobsModel.SelectedJob.CompanyId); jobsModel = new JobsModel(); jobsModel.SelectedJob = jobsModel.AllJobs.Where(x => x.CompanyId == SelectedJobID).FirstOrDefault(); IsRecruiterInitialized = true; } else { ShowAllEditingPlanes(); return; } } SetRecruiterBoxesToReadWrite(); break; } }
// GET: JobsModel/Details/5 public ActionResult JobDetails(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } JobsModel jobsModel = db.Jobs.Find(id); if (jobsModel == null) { return(HttpNotFound()); } return(View(jobsModel)); }
public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } JobsModel jobsModel = db.Jobs.Find(id); if (jobsModel == null) { return(HttpNotFound()); } ViewBag.UserID = jobsModel.UserID; return(View(jobsModel)); }
// GET: JobsModel/Edit/5 public ActionResult JobEdit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } JobsModel jobsModel = db.Jobs.Find(id); if (jobsModel == null) { return(HttpNotFound()); } ViewBag.UserID = new SelectList(db.Admins, "ID", "FirstName", jobsModel.UserID); return(View(jobsModel)); }
private void BtnSave_Click(object sender, EventArgs e) { JobsModel edited = new JobsModel() { Id = job.Id, JobNumber = job.JobNumber, Customer = txtCustomer.Text, Model = txtModel.Text }; PrepAndPaintDB.EditJob(edited); jobId = edited.Id; DialogResult = DialogResult.OK; Close(); }
public async Task <IActionResult> OnGetAsync(int?id) { if (id == null) { return(NotFound()); } JobsModel = await _context.JobsModel.FirstOrDefaultAsync(m => m.ID == id); if (JobsModel == null) { return(NotFound()); } return(Page()); }
public async Task CreateJob(JobsModel model) { var putItemRequest = new PutItemRequest { TableName = TableName, Item = new Dictionary <string, AttributeValue> { ["Id"] = new AttributeValue { S = model.Id }, ["MobileNumber"] = new AttributeValue { S = model.MobileNumber }, ["Name"] = new AttributeValue { S = model.Name }, ["Location"] = new AttributeValue { S = model.Location }, ["Lat"] = new AttributeValue { S = model.Lat }, ["Long"] = new AttributeValue { S = model.Long }, ["TimestampRequested"] = new AttributeValue { S = model.TimestampRequested.ToString("yyyy-MM-dd HH:mm:ss") }, ["TimestampRequiredFor"] = new AttributeValue { S = model.TimestampRequiredFor.ToString("yyyy-MM-dd HH:mm:ss") }, ["Message"] = new AttributeValue { S = model.Message }, ["TranslatedMessage"] = new AttributeValue { S = model.TranslatedMessage }, ["LanguageRequested"] = new AttributeValue { S = model.LanguageRequested }, ["Disabilities"] = new AttributeValue { SS = model.Disabilities } } }; await _dynamoDbClient.PutItemAsync(putItemRequest); }
public IActionResult PostJob([FromBody] JobsModel JobModel) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } if (!_jobRepository.CreateJob(JobModel)) { ModelState.AddModelError("", $"Something went wrong saving the job " + $"{JobModel.Title}"); return(StatusCode(500, ModelState)); } return(Ok(new { Job = JobModel.Title, jobCreated = true })); }
public async Task Update(JobsModel jobsModel, Dictionary <string, AttributeValueUpdate> attributeValueUpdates) { var updateItemRequest = new UpdateItemRequest { TableName = TableName, Key = new Dictionary <string, AttributeValue> { ["Id"] = new AttributeValue { S = jobsModel.Id } }, AttributeUpdates = attributeValueUpdates }; await _dynamoDbClient.UpdateItemAsync(updateItemRequest); }