public int Delete(TY_ReferendumReportModel ObjModel) { int num = 0; using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { connection.Open(); SqlTransaction transaction = connection.BeginTransaction(); try { try { num = new TY_ReferendumReportBLL().Delete(ObjModel.ReferendumReportCode, transaction); transaction.Commit(); } catch (SqlException exception) { transaction.Rollback(); connection.Close(); throw exception; } return(num); } finally { connection.Close(); } } return(num); }
public List <TY_ReferendumReportModel> GetTY_ReferendumReportList(string SortColumns, int StartRecord, int MaxRecords, int ReferendumReportCodeEqual, string NumberEqual, DateTime StartDateEqual, string StartPersonEqual, string TextTitleEqual, string TextContentEqual, string AuditEqual, string Field1Equal) { List <TY_ReferendumReportModel> models = new List <TY_ReferendumReportModel>(); TY_ReferendumReportQueryModel objQueryModel = new TY_ReferendumReportQueryModel(); objQueryModel.StartRecord = StartRecord; objQueryModel.MaxRecords = MaxRecords; objQueryModel.SortColumns = SortColumns; objQueryModel.ReferendumReportCodeEqual = ReferendumReportCodeEqual; objQueryModel.NumberEqual = NumberEqual; objQueryModel.StartDateEqual = StartDateEqual; objQueryModel.StartPersonEqual = StartPersonEqual; objQueryModel.TextTitleEqual = TextTitleEqual; objQueryModel.TextContentEqual = TextContentEqual; objQueryModel.AuditEqual = AuditEqual; objQueryModel.Field1Equal = Field1Equal; using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { connection.Open(); try { models = new TY_ReferendumReportBLL().GetModels(objQueryModel, connection); connection.Close(); } catch (SqlException exception) { throw exception; } } return(models); }
public TY_ReferendumReportModel GetTY_ReferendumReport(int Code) { TY_ReferendumReportModel model = new TY_ReferendumReportModel(); using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { connection.Open(); try { model = new TY_ReferendumReportBLL().GetModel(Code, connection); connection.Close(); } catch (SqlException exception) { throw exception; } } return(model); }
public List <TY_ReferendumReportModel> GetTY_ReferendumReportListOne(int Code) { List <TY_ReferendumReportModel> list = new List <TY_ReferendumReportModel>(); using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { connection.Open(); try { TY_ReferendumReportBLL tbll = new TY_ReferendumReportBLL(); list.Add(tbll.GetModel(Code, connection)); connection.Close(); } catch (SqlException exception) { throw exception; } } return(list); }
public List <TY_ReferendumReportModel> GetTY_ReferendumReportList(TY_ReferendumReportQueryModel QueryModel) { List <TY_ReferendumReportModel> models = new List <TY_ReferendumReportModel>(); using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { connection.Open(); try { if (QueryModel == null) { QueryModel = new TY_ReferendumReportQueryModel(); } models = new TY_ReferendumReportBLL().GetModels(QueryModel, connection); connection.Close(); } catch (SqlException exception) { throw exception; } } return(models); }