示例#1
0
        //}

        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");
        }
示例#2
0
        // GET: Work
        public ActionResult Index()
        {
            JobsModel model = new JobsModel();

            model.Jobs = _workService.GetJobsByName(User.Identity.Name);
            return(View(model));
        }
示例#3
0
        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);
            }
        }
示例#5
0
 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());
        }
示例#10
0
        public ActionResult JobDeleteConfirmed(int id)
        {
            JobsModel jobsModel = db.Jobs.Find(id);

            db.Jobs.Remove(jobsModel);
            db.SaveChanges();
            return(RedirectToAction("AllJobs"));
        }
示例#11
0
        public ActionResult SingleJob(int id)
        {
            JobsModel Jobs = new JobsModel()
            {
                singleJobs = UserJobPostingservice.GetJobsbyId(id)
            };

            return(View(Jobs));
        }
示例#12
0
文件: Mill.cs 项目: EmilieS/Gleipnir
 public Mill(Village v, JobsModel job)
     : base(v)
 {
     Name = "Moulin";
     _name = Name;
     Hp = MaxHp = 50;
     _job = job;
     this.CostPrice = 375;
 }
示例#13
0
 public Restaurant(Village v, JobsModel job)
     : base(v)
 {
     Name = "Restaurant";
     _name = Name;
     Hp = MaxHp = 50;
     _job = job;
     this.CostPrice = 400;
 }
示例#14
0
 public UnionOfCrafter(Village v, JobsModel job)
     : base(v)
 {
     Name = "Syndicat";
     _name = Name;
     Hp = MaxHp = 50;
     _job = job;
     this.CostPrice = 50;
 }
示例#15
0
 public ClothesShop(Village v, JobsModel job)
     : base(v)
 {
     Name = "Magasin";
     _name = Name;
     Hp = MaxHp = 50;
     _job = job;
     this.CostPrice = 300;
 }
示例#16
0
文件: Forge.cs 项目: EmilieS/Gleipnir
 public Forge(Village v, JobsModel job)
     : base(v)
 {
     Name = "Forge";
     _name = Name;
     Hp = MaxHp = 50;
     _job = job;
     this.CostPrice = 100;
 }
示例#17
0
 public MilitaryCamp(Village v, JobsModel job)
     : base(v)
 {
     Name = "QG";
     _name = Name;
     Hp = MaxHp = 50;
     _job = job;
     this.CostPrice = 800;
 }
示例#18
0
 public JobInfo(JobsModel job)
 {
     InitializeComponent();
     this.job = job;
     checkBoxComplete.Checked = job.Completed;
     GetInfo();
     SetJobInfo();
     SetDataGridView();
 }
示例#19
0
        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));
        }
示例#20
0
 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));
 }
示例#21
0
        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));
        }
示例#22
0
        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);
        }
示例#24
0
 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 = "" }));
 }
示例#25
0
        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 + " - Посади";
        }
示例#27
0
        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);
        }
示例#28
0
        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;
            }
        }
示例#29
0
        // 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));
        }
示例#30
0
        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));
        }
示例#31
0
        // 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));
        }
示例#32
0
        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();
        }
示例#33
0
        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());
        }
示例#34
0
        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 }));
        }
示例#36
0
        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);
        }