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

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

            return(approvalModel);
        }
예제 #2
0
        public ApprovalModel GetOneApprovalByNumber(int approvalNumber)
        {
            DataTable     dt  = new DataTable();
            ApprovalModel app = new ApprovalModel();

            using (OleDbCommand command = new OleDbCommand())
            {
                dt = GetMultipleQuery(ApprovalStringsInner.GetOneApprovalByNumber(approvalNumber));
            }

            foreach (DataRow ms in dt.Rows)
            {
                app = ApprovalModel.ToObject(ms);
            }
            return(app);
        }
예제 #3
0
        public List <ApprovalModel> GetAllApprovals()
        {
            DataTable            dt  = new DataTable();
            List <ApprovalModel> apv = new List <ApprovalModel>();


            using (OleDbCommand command = new OleDbCommand())
            {
                dt = GetMultipleQuery(ApprovalStringsInner.GetAllApprovals());
            }

            foreach (DataRow ms in dt.Rows)
            {
                apv.Add(ApprovalModel.ToObject(ms));
            }
            return(apv);
        }
        public List <ApprovalModel> GetAllApprovals()
        {
            DataTable dt = new DataTable();

            using (MySqlCommand command = new MySqlCommand())
            {
                dt = GetMultipleQuery(ApprovalStringsMySql.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 (MySqlCommand command = new MySqlCommand())
            {
                dt = GetMultipleQuery(ApprovalStringsMySql.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 (MySqlCommand command = new MySqlCommand())
            {
                dt = GetMultipleQuery(ApprovalStringsMySql.GetOneApprovalByPersonId(personId));
            }

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

            return(approvalModel);
        }