public int DeleteApprovalById(string approvalPersonId)
        {
            int i = 0;

            using (SqlCommand command = new SqlCommand())
            {
                i = ExecuteNonQuery(ApprovalStringsSql.DeleteApprovalById(approvalPersonId));
            }

            return(i);
        }
        public int DeleteApproval(int approvalNumber)
        {
            int i = 0;

            using (SqlCommand command = new SqlCommand())
            {
                i = ExecuteNonQuery(ApprovalStringsSql.DeleteApproval(approvalNumber));
            }

            return(i);
        }
        public ApprovalModel AddApproval(ApprovalModel approvalModel)
        {
            DataTable dt = new DataTable();

            using (SqlCommand command = new SqlCommand())
            {
                dt = GetMultipleQuery(ApprovalStringsSql.AddApproval(approvalModel));
            }
            foreach (DataRow ms in dt.Rows)
            {
                approvalModel = ApprovalModel.ToObject(ms);
            }

            return(approvalModel);
        }
        public List <ApprovalModel> GetAllApprovals()
        {
            DataTable dt = new DataTable();

            using (SqlCommand command = new SqlCommand())
            {
                dt = GetMultipleQuery(ApprovalStringsSql.GetAllApprovals());
            }

            List <ApprovalModel> arrApproval = new List <ApprovalModel>();

            foreach (DataRow ms in dt.Rows)
            {
                arrApproval.Add(ApprovalModel.ToObject(ms));
            }

            return(arrApproval);
        }
        public ApprovalModel GetOneApprovalByNumber(int approvalNumber)
        {
            DataTable dt = new DataTable();

            if (approvalNumber < 1)
            {
                throw new ArgumentOutOfRangeException();
            }
            ApprovalModel approvalModel = new ApprovalModel();

            using (SqlCommand command = new SqlCommand())
            {
                dt = GetMultipleQuery(ApprovalStringsSql.GetOneApprovalByNumber(approvalNumber));
            }

            foreach (DataRow ms in dt.Rows)
            {
                approvalModel = ApprovalModel.ToObject(ms);
            }

            return(approvalModel);
        }
        public ApprovalModel GetOneApprovalByPersonId(string personId)
        {
            DataTable dt = new DataTable();

            if (personId.Equals(string.Empty) || personId.Equals(""))
            {
                throw new ArgumentOutOfRangeException();
            }
            ApprovalModel approvalModel = new ApprovalModel();

            using (SqlCommand command = new SqlCommand())
            {
                dt = GetMultipleQuery(ApprovalStringsSql.GetOneApprovalByPersonId(personId));
            }

            foreach (DataRow ms in dt.Rows)
            {
                approvalModel = ApprovalModel.ToObject(ms);
            }

            return(approvalModel);
        }