Beispiel #1
0
        public int Update(OAPersonHomeModel ObjModel)
        {
            int num = 0;

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

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

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    OAPersonHomeBLL ebll = new OAPersonHomeBLL();
                    list.Add(ebll.GetModel(Code, connection));
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(list);
        }
Beispiel #4
0
        public List <OAPersonHomeModel> GetOAPersonHomeList(OAPersonHomeQueryModel QueryModel)
        {
            List <OAPersonHomeModel> models = new List <OAPersonHomeModel>();

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

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