Example #1
0
        public int Update(GK_OAPersonWorkModel ObjModel)
        {
            int num = 0;

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

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

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    GK_OAPersonWorkBLL kbll = new GK_OAPersonWorkBLL();
                    list.Add(kbll.GetModel(Code, connection));
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(list);
        }
Example #4
0
        public List <GK_OAPersonWorkModel> GetGK_OAPersonWorkList(GK_OAPersonWorkQueryModel QueryModel)
        {
            List <GK_OAPersonWorkModel> models = new List <GK_OAPersonWorkModel>();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    if (QueryModel == null)
                    {
                        QueryModel = new GK_OAPersonWorkQueryModel();
                    }
                    models = new GK_OAPersonWorkBLL().GetModels(QueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(models);
        }
Example #5
0
        public List <GK_OAPersonWorkModel> GetGK_OAPersonWorkList(string SortColumns, int StartRecord, int MaxRecords, string PersonIDEqual)
        {
            List <GK_OAPersonWorkModel> models        = new List <GK_OAPersonWorkModel>();
            GK_OAPersonWorkQueryModel   objQueryModel = new GK_OAPersonWorkQueryModel();

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