Exemple #1
0
        public int Update(OAPersonStudyModel ObjModel)
        {
            int num = 0;

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                connection.Open();
                SqlTransaction transaction = connection.BeginTransaction();
                try
                {
                    try
                    {
                        num = new OAPersonStudyBLL().Update(ObjModel, transaction);
                        transaction.Commit();
                    }
                    catch (SqlException exception)
                    {
                        transaction.Rollback();
                        connection.Close();
                        throw exception;
                    }
                    return(num);
                }
                finally
                {
                    connection.Close();
                }
            }
            return(num);
        }
Exemple #2
0
        public OAPersonStudyModel GetOAPersonStudy(int Code)
        {
            OAPersonStudyModel model = new OAPersonStudyModel();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    model = new OAPersonStudyBLL().GetModel(Code, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(model);
        }
Exemple #3
0
        public List <OAPersonStudyModel> GetOAPersonStudyListOne(int Code)
        {
            List <OAPersonStudyModel> list = new List <OAPersonStudyModel>();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    OAPersonStudyBLL ybll = new OAPersonStudyBLL();
                    list.Add(ybll.GetModel(Code, connection));
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(list);
        }
Exemple #4
0
        public List <OAPersonStudyModel> GetOAPersonStudyList(OAPersonStudyQueryModel QueryModel)
        {
            List <OAPersonStudyModel> models = new List <OAPersonStudyModel>();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    if (QueryModel == null)
                    {
                        QueryModel = new OAPersonStudyQueryModel();
                    }
                    models = new OAPersonStudyBLL().GetModels(QueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(models);
        }
Exemple #5
0
        public List <OAPersonStudyModel> GetOAPersonStudyList(string SortColumns, int StartRecord, int MaxRecords, string personidEqual)
        {
            List <OAPersonStudyModel> models        = new List <OAPersonStudyModel>();
            OAPersonStudyQueryModel   objQueryModel = new OAPersonStudyQueryModel();

            objQueryModel.StartRecord   = StartRecord;
            objQueryModel.MaxRecords    = MaxRecords;
            objQueryModel.SortColumns   = SortColumns;
            objQueryModel.personidEqual = personidEqual;
            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    models = new OAPersonStudyBLL().GetModels(objQueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(models);
        }