public int Update(GK_OA_CarMaintenanceModel ObjModel) { int num = 0; using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { connection.Open(); SqlTransaction transaction = connection.BeginTransaction(); try { try { num = new GK_OA_CarMaintenanceBLL().Update(ObjModel, transaction); transaction.Commit(); } catch (SqlException exception) { transaction.Rollback(); connection.Close(); throw exception; } return(num); } finally { connection.Close(); } } return(num); }
public GK_OA_CarMaintenanceModel GetGK_OA_CarMaintenance(int Code) { GK_OA_CarMaintenanceModel model = new GK_OA_CarMaintenanceModel(); using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { try { connection.Open(); model = new GK_OA_CarMaintenanceBLL().GetModel(Code, connection); connection.Close(); } catch (SqlException exception) { throw exception; } } return(model); }
public List <GK_OA_CarMaintenanceModel> GetGK_OA_CarMaintenanceListOne(int Code) { List <GK_OA_CarMaintenanceModel> list = new List <GK_OA_CarMaintenanceModel>(); using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { try { connection.Open(); GK_OA_CarMaintenanceBLL ebll = new GK_OA_CarMaintenanceBLL(); list.Add(ebll.GetModel(Code, connection)); connection.Close(); } catch (SqlException exception) { throw exception; } } return(list); }
public List <GK_OA_CarMaintenanceModel> GetGK_OA_CarMaintenanceList(GK_OA_CarMaintenanceQueryModel QueryModel) { List <GK_OA_CarMaintenanceModel> models = new List <GK_OA_CarMaintenanceModel>(); using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { try { connection.Open(); if (QueryModel == null) { QueryModel = new GK_OA_CarMaintenanceQueryModel(); } models = new GK_OA_CarMaintenanceBLL().GetModels(QueryModel, connection); connection.Close(); } catch (SqlException exception) { throw exception; } } return(models); }
public List <GK_OA_CarMaintenanceModel> GetGK_OA_CarMaintenanceList(string SortColumns, int StartRecord, int MaxRecords, string Car_CodeEqual) { List <GK_OA_CarMaintenanceModel> models = new List <GK_OA_CarMaintenanceModel>(); GK_OA_CarMaintenanceQueryModel objQueryModel = new GK_OA_CarMaintenanceQueryModel(); objQueryModel.StartRecord = StartRecord; objQueryModel.MaxRecords = MaxRecords; objQueryModel.SortColumns = SortColumns; objQueryModel.Car_codeEqual = Car_CodeEqual; using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { try { connection.Open(); models = new GK_OA_CarMaintenanceBLL().GetModels(objQueryModel, connection); connection.Close(); } catch (SqlException exception) { throw exception; } } return(models); }