public List <GK_OA_OilModel> GetGK_OA_OilList(string SortColumns, int StartRecord, int MaxRecords, string IndexNumLike, string Car_idLike, DateTime GetDateStartEqual, DateTime GetDateEndEqual) { List <GK_OA_OilModel> models = new List <GK_OA_OilModel>(); GK_OA_OilQueryModel objQueryModel = new GK_OA_OilQueryModel(); objQueryModel.StartRecord = StartRecord; objQueryModel.MaxRecords = MaxRecords; objQueryModel.SortColumns = SortColumns; objQueryModel.Car_idLike = Car_idLike; objQueryModel.GetDateStartEqual = GetDateStartEqual; objQueryModel.GetDateEndEqual = GetDateEndEqual; objQueryModel.IndexNumLike = IndexNumLike; using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { try { connection.Open(); models = new GK_OA_OilBLL().GetModels(objQueryModel, connection); connection.Close(); } catch (SqlException exception) { throw exception; } } return(models); }
public int Update(GK_OA_OilModel ObjModel) { int num = 0; using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { connection.Open(); SqlTransaction transaction = connection.BeginTransaction(); try { try { num = new GK_OA_OilBLL().Update(ObjModel, transaction); transaction.Commit(); } catch (SqlException exception) { transaction.Rollback(); connection.Close(); throw exception; } return(num); } finally { connection.Close(); } } return(num); }
public GK_OA_OilModel GetGK_OA_Oil(int Code) { GK_OA_OilModel model = new GK_OA_OilModel(); using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { try { connection.Open(); model = new GK_OA_OilBLL().GetModel(Code, connection); connection.Close(); } catch (SqlException exception) { throw exception; } } return(model); }
public List <GK_OA_OilModel> GetGK_OA_OilListOne(int Code) { List <GK_OA_OilModel> list = new List <GK_OA_OilModel>(); using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { try { connection.Open(); GK_OA_OilBLL lbll = new GK_OA_OilBLL(); list.Add(lbll.GetModel(Code, connection)); connection.Close(); } catch (SqlException exception) { throw exception; } } return(list); }
public List <GK_OA_OilModel> GetGK_OA_OilList(GK_OA_OilQueryModel QueryModel) { List <GK_OA_OilModel> models = new List <GK_OA_OilModel>(); using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { try { if (QueryModel == null) { QueryModel = new GK_OA_OilQueryModel(); } connection.Open(); models = new GK_OA_OilBLL().GetModels(QueryModel, connection); connection.Close(); } catch (SqlException exception) { throw exception; } } return(models); }