Esempio n. 1
0
        public ApprovalTypeModel UpdateApprovalType(ApprovalTypeModel approvalTypeModel)
        {
            DataTable dt = new DataTable();

            using (SqlCommand command = new SqlCommand())
            {
                dt = GetMultipleQuery(ApprovalTypeStringsSql.UpdateApprovalType(approvalTypeModel));
            }
            foreach (DataRow ms in dt.Rows)
            {
                approvalTypeModel = ApprovalTypeModel.ToObject(ms);
            }

            return(approvalTypeModel);
        }
Esempio n. 2
0
        public ApprovalTypeModel GetOneApprovalTypeByCode(string approvalCode)
        {
            DataTable         dt = new DataTable();
            ApprovalTypeModel approvalModelType = new ApprovalTypeModel();

            using (OleDbCommand command = new OleDbCommand())
            {
                dt = GetMultipleQuery(ApprovalTypeStringsInner.GetOneApprovalTypeByCode(approvalCode));
            }
            foreach (DataRow ms in dt.Rows)
            {
                approvalModelType = ApprovalTypeModel.ToObject(ms);
            }
            return(approvalModelType);
        }
Esempio n. 3
0
        public List <ApprovalTypeModel> GetAllApprovalTypes()
        {
            DataTable dt = new DataTable();
            List <ApprovalTypeModel> arrApprovalType = new List <ApprovalTypeModel>();

            using (OleDbCommand command = new OleDbCommand())
            {
                dt = GetMultipleQuery(ApprovalTypeStringsInner.GetAllApprovalTypes());
            }
            foreach (DataRow ms in dt.Rows)
            {
                arrApprovalType.Add(ApprovalTypeModel.ToObject(ms));
            }
            return(arrApprovalType);
        }
Esempio n. 4
0
        public ApprovalTypeModel GetOneApprovalTypeByCode(string approvalCode)
        {
            DataTable dt = new DataTable();

            if (approvalCode.Equals(string.Empty) || approvalCode.Equals(""))
            {
                throw new ArgumentOutOfRangeException();
            }
            ApprovalTypeModel approvalModelType = new ApprovalTypeModel();

            using (SqlCommand command = new SqlCommand())
            {
                dt = GetMultipleQuery(ApprovalTypeStringsSql.GetOneApprovalTypeByCode(approvalCode));
            }

            foreach (DataRow ms in dt.Rows)
            {
                approvalModelType = ApprovalTypeModel.ToObject(ms);
            }

            return(approvalModelType);
        }