Esempio n. 1
0
 public bool UpdateJobIndustryArea(JobIndustryAreaModel jobIndustry)
 {
     using (var connection = new SqlConnection(connectionString))
     {
         try
         {
             SqlParameter[] parameters = new SqlParameter[] {
                 new SqlParameter("@JobIndustryAreaId", jobIndustry.JobIndustryAreaId),
                 new SqlParameter("@JobIndustryAreaName", jobIndustry.JobIndustryAreaName),
             };
             var data =
                 SqlHelper.ExecuteNonQuery
                 (
                     connection,
                     CommandType.StoredProcedure,
                     "usp_UpdateJobIndustryArea",
                     parameters
                 );
             if (data > 0)
             {
                 return(true);
             }
         }
         finally
         {
             SqlHelper.CloseConnection(connection);
         }
     }
     throw new Exception("Unable to update data");
 }
Esempio n. 2
0
        public bool UpdateJobIndustryArea(JobIndustryAreaViewModel jobIndustryAreaViewModel)
        {
            JobIndustryAreaModel jobIndustryArea = new JobIndustryAreaModel
            {
                JobIndustryAreaId   = jobIndustryAreaViewModel.JobIndustryAreaId,
                JobIndustryAreaName = jobIndustryAreaViewModel.JobIndustryAreaName,
            };
            var result = _jobIndustryAreaHandler.UpdateJobIndustryArea(jobIndustryArea);

            if (result)
            {
                return(true);
            }
            throw new Exception("Unable to update data");
        }
        public List <JobIndustryAreaModel> JobIndustryArea()
        {
            DataTable dt = masterRepository.JobIndustryArea();
            List <JobIndustryAreaModel> jobIndustryArea = new List <JobIndustryAreaModel>();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                JobIndustryAreaModel JobIndustry = new JobIndustryAreaModel()
                {
                    JobIndustryAreaId   = Convert.ToInt32(dt.Rows[i]["JobIndustryAreaId"]),
                    JobIndustryAreaName = Convert.ToString(dt.Rows[i]["JobIndustryAreaName"]),
                };
                jobIndustryArea.Add(JobIndustry);
            }
            return(jobIndustryArea);
        }