public int Delete(TC_OA_LingYongMenonyModel ObjModel) { int num = 0; using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { connection.Open(); SqlTransaction transaction = connection.BeginTransaction(); try { try { num = new TC_OA_LingYongMenonyBLL().Delete(ObjModel.Code, transaction); transaction.Commit(); } catch (SqlException exception) { transaction.Rollback(); connection.Close(); throw exception; } return(num); } finally { connection.Close(); } } return(num); }
public List <TC_OA_LingYongMenonyModel> GetTC_OA_LingYongMenonyList(string SortColumns, int StartRecord, int MaxRecords, string BaiEqual, int AuditingEqual) { List <TC_OA_LingYongMenonyModel> models = new List <TC_OA_LingYongMenonyModel>(); TC_OA_LingYongMenonyQueryModel objQueryModel = new TC_OA_LingYongMenonyQueryModel(); objQueryModel.StartRecord = StartRecord; objQueryModel.MaxRecords = MaxRecords; if (SortColumns == null) { SortColumns = ""; } objQueryModel.SortColumns = SortColumns; objQueryModel.BaiEqual = BaiEqual; objQueryModel.AuditingEqual = AuditingEqual; using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { try { connection.Open(); models = new TC_OA_LingYongMenonyBLL().GetModels(objQueryModel, connection); connection.Close(); } catch (SqlException exception) { throw exception; } } return(models); }
public TC_OA_LingYongMenonyModel GetTC_OA_LingYongMenony(int Code) { TC_OA_LingYongMenonyModel model = new TC_OA_LingYongMenonyModel(); using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { try { connection.Open(); model = new TC_OA_LingYongMenonyBLL().GetModel(Code, connection); connection.Close(); } catch (SqlException exception) { throw exception; } } return(model); }
public List <TC_OA_LingYongMenonyModel> GetTC_OA_LingYongMenonyListOne(int Code) { List <TC_OA_LingYongMenonyModel> list = new List <TC_OA_LingYongMenonyModel>(); using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { try { connection.Open(); TC_OA_LingYongMenonyBLL ybll = new TC_OA_LingYongMenonyBLL(); list.Add(ybll.GetModel(Code, connection)); connection.Close(); } catch (SqlException exception) { throw exception; } } return(list); }
public List <TC_OA_LingYongMenonyModel> GetTC_OA_LingYongMenonyList(TC_OA_LingYongMenonyQueryModel QueryModel) { List <TC_OA_LingYongMenonyModel> models = new List <TC_OA_LingYongMenonyModel>(); using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { try { connection.Open(); if (QueryModel == null) { QueryModel = new TC_OA_LingYongMenonyQueryModel(); } models = new TC_OA_LingYongMenonyBLL().GetModels(QueryModel, connection); connection.Close(); } catch (SqlException exception) { throw exception; } } return(models); }