Example #1
0
        public Task <int> PostEmployeementIn(EmployeementIn familyStatus)
        {
            int result = 0;

            try
            {
                using (IDbConnection db = GetConnection())
                {
                    db.Open();

                    if (familyStatus.EmployeementInName != "")
                    {
                        var p = new DynamicParameters();

                        p.Add("@EmployeementId", familyStatus.EmployeementId, DbType.Int32, ParameterDirection.Input);
                        p.Add("@EmployeementInName", familyStatus.EmployeementInName, DbType.String, ParameterDirection.Input);
                        p.Add("@EmployeementCreatedDate", familyStatus.EmployeementCreatedDate, DbType.String, ParameterDirection.Input);
                        p.Add("@EmployeementCreatedBy", familyStatus.EmployeementCreatedBy, DbType.String, ParameterDirection.Input);
                        p.Add("@EmployeementModifiedDate", familyStatus.EmployeementModifiedDate, DbType.String, ParameterDirection.Input);
                        p.Add("@EmployeementModifiedBy", familyStatus.EmployeementModifiedBy, DbType.String, ParameterDirection.Input);
                        p.Add("@EmployeementStatus", Convert.ToInt32(RecordStatus.Active), DbType.String, ParameterDirection.Input);

                        if (familyStatus.EmployeementId == 0)
                        {
                            p.Add("@ActionType", ActionType.Add.ToString(), DbType.String, ParameterDirection.Input);
                        }
                        else
                        {
                            p.Add("@ActionType", ActionType.Update.ToString(), DbType.String, ParameterDirection.Input);
                        }

                        p.Add("@OutputData", familyStatus.EmployeementId, DbType.Int32, ParameterDirection.Input);

                        result = db.Execute("usp_CRED_EmployeementIn", p, commandType: CommandType.StoredProcedure);
                    }

                    return(Task.FromResult(result));
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
 public Task <int> PostEmployeementIn(EmployeementIn familyStatus)
 {
     return(employeementInServiceobj.PostEmployeementIn(familyStatus));
 }
 public Task <int> PostEmployeementIn(EmployeementIn employeementIn)
 {
     return(employeementInRepositoryobj.PostEmployeementIn(employeementIn));
 }