Exemple #1
0
        public List <GK_OA_CarModel> GetGK_OA_CarList(string SortColumns, int StartRecord, int MaxRecords, string Index_NumLike, string Car_IdLike, string Car_TypeLike, DateTime Buy_DateStartEqual, DateTime Buy_DateEndEqual)
        {
            List <GK_OA_CarModel> models        = new List <GK_OA_CarModel>();
            GK_OA_CarQueryModel   objQueryModel = new GK_OA_CarQueryModel();

            objQueryModel.StartRecord        = StartRecord;
            objQueryModel.MaxRecords         = MaxRecords;
            objQueryModel.SortColumns        = SortColumns;
            objQueryModel.Index_NumLike      = Index_NumLike;
            objQueryModel.Car_IdLike         = Car_IdLike;
            objQueryModel.Car_TypeLike       = Car_TypeLike;
            objQueryModel.Buy_DateStartEqual = Buy_DateStartEqual;
            objQueryModel.Buy_DateEndEqual   = Buy_DateEndEqual;
            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    models = new GK_OA_CarBLL().GetModels(objQueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(models);
        }
Exemple #2
0
        public int Update(GK_OA_CarModel ObjModel)
        {
            int num = 0;

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

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    model = new GK_OA_CarBLL().GetModel(Code, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(model);
        }
Exemple #4
0
        public List <GK_OA_CarModel> GetGK_OA_CarListOne(int Car_Code)
        {
            List <GK_OA_CarModel> list = new List <GK_OA_CarModel>();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    GK_OA_CarBLL rbll = new GK_OA_CarBLL();
                    list.Add(rbll.GetModel(Car_Code, connection));
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(list);
        }
Exemple #5
0
        public List <GK_OA_CarModel> GetGK_OA_CarList(GK_OA_CarQueryModel QueryModel)
        {
            List <GK_OA_CarModel> models = new List <GK_OA_CarModel>();

            using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString()))
            {
                try
                {
                    connection.Open();
                    if (QueryModel == null)
                    {
                        QueryModel = new GK_OA_CarQueryModel();
                    }
                    models = new GK_OA_CarBLL().GetModels(QueryModel, connection);
                    connection.Close();
                }
                catch (SqlException exception)
                {
                    throw exception;
                }
            }
            return(models);
        }