public async Task <int> PostAddEdit(OccupationSpecification occupationSpecification)
 {
     try
     {
         return(await occupationSpecificationServiceobj.PostOccupationSpec(occupationSpecification).ConfigureAwait(true));
     }
     catch (Exception)
     {
         throw;
     }
 }
        public Task <int> PostOccupationSpec(OccupationSpecification occupationSpecificationInsertUpdate)
        {
            int result = 0;

            using (IDbConnection db = GetConnection())
            {
                try
                {
                    db.Open();
                    if (occupationSpecificationInsertUpdate.OccupationSpecificationType != "")
                    {
                        var p = new DynamicParameters();

                        p.Add("@OccupationSpecificationId", occupationSpecificationInsertUpdate.OccupationSpecificationId, DbType.Int32, ParameterDirection.Input);
                        p.Add("@OccupationId", occupationSpecificationInsertUpdate.OccupationId, DbType.Int32, ParameterDirection.Input);
                        p.Add("@OccupationSpecificationType", occupationSpecificationInsertUpdate.OccupationSpecificationType, DbType.String, ParameterDirection.Input);
                        p.Add("@OccupationSpecificationCreatedDate", occupationSpecificationInsertUpdate.OccupationSpecificationCreatedDate, DbType.DateTime, ParameterDirection.Input);
                        p.Add("@OccupationSpecificationCreatedBy", occupationSpecificationInsertUpdate.OccupationSpecificationCreatedBy, DbType.Int32, ParameterDirection.Input);
                        p.Add("@OccupationSpecificationModifiedDate", occupationSpecificationInsertUpdate.OccupationSpecificationModifiedDate, DbType.Date, ParameterDirection.Input);
                        p.Add("@OccupationSpecificationModifiedBy", occupationSpecificationInsertUpdate.OccupationSpecificationModifiedBy, DbType.Int32, ParameterDirection.Input);
                        p.Add("@OccupationSpecificationStatus", occupationSpecificationInsertUpdate.OccupationSpecificationStatus, DbType.Int32, ParameterDirection.Input);
                        if (occupationSpecificationInsertUpdate.OccupationSpecificationId == 0)
                        {
                            p.Add("@ActionType", ActionType.AddOccupation.ToString(), DbType.String, ParameterDirection.Input);
                        }
                        else
                        {
                            p.Add("@ActionType", ActionType.UpdateOccupation.ToString(), DbType.String, ParameterDirection.Input);
                        }

                        p.Add("@OutputData", occupationSpecificationInsertUpdate.OccupationId, DbType.Int32, ParameterDirection.Output);

                        result = db.Execute("usp_CRED_OcupationSpecification", p, commandType: CommandType.StoredProcedure);
                    }
                    return(Task.FromResult(result));
                }
                catch (Exception)
                {
                    throw;
                }
            }
        }
 public async Task <int> PostOccupationSpec(OccupationSpecification occupationSpecification)
 {
     return(await occupationSpecificationRepositoryobj.PostOccupationSpec(occupationSpecification));
 }