public List <FileTemplateVersionModel> GetFileTemplateVersionList(string SortColumns, int StartRecord, int MaxRecords, int CodeEqual, int FileTemplateCodeEqual, string WorkFlowProcedureNameEqual, string VersionNumberEqual, string IsPigeonholeEqual, string PigeonholeTimeEqual, string SaveTermEqual, string RecordKindEqual, string MarkingSNRuleEqual, string IsAvailabilityEqual) { List <FileTemplateVersionModel> models = new List <FileTemplateVersionModel>(); FileTemplateVersionQueryModel objQueryModel = new FileTemplateVersionQueryModel(); objQueryModel.StartRecord = StartRecord; objQueryModel.MaxRecords = MaxRecords; objQueryModel.SortColumns = SortColumns; objQueryModel.CodeEqual = CodeEqual; objQueryModel.FileTemplateCodeEqual = FileTemplateCodeEqual; objQueryModel.WorkFlowProcedureNameEqual = WorkFlowProcedureNameEqual; objQueryModel.VersionNumberEqual = VersionNumberEqual; objQueryModel.IsPigeonholeEqual = IsPigeonholeEqual; objQueryModel.PigeonholeTimeEqual = PigeonholeTimeEqual; objQueryModel.SaveTermEqual = SaveTermEqual; objQueryModel.RecordKindEqual = RecordKindEqual; objQueryModel.MarkingSNRuleEqual = MarkingSNRuleEqual; objQueryModel.IsAvailabilityEqual = IsAvailabilityEqual; using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { try { connection.Open(); models = new FileTemplateVersionBLL().GetModels(objQueryModel, connection); connection.Close(); } catch (SqlException exception) { throw exception; } } return(models); }
private List <FileTemplateVersionModel> _Select(FileTemplateVersionQueryModel qmObj) { List <FileTemplateVersionModel> list = new List <FileTemplateVersionModel>(); StringBuilder builder = new StringBuilder(); builder.Append("select * from FileTemplateVersion "); builder.Append(qmObj.QueryConditionStr); if (qmObj.SortColumns.Length == 0) { builder.Append(" ORDER BY Code desc"); } else { builder.Append(" ORDER BY " + qmObj.SortColumns); } this._DataProcess.CommandText = builder.ToString(); this._DataProcess.SqlParameters = qmObj.Parameters; SqlDataReader sqlDataReader = null; int num = 0; try { try { sqlDataReader = this._DataProcess.GetSqlDataReader(); while (sqlDataReader.Read()) { if ((num >= qmObj.StartRecord) && ((list.Count < qmObj.MaxRecords) || (qmObj.MaxRecords == -1))) { FileTemplateVersionModel model = new FileTemplateVersionModel(); this.Initialize(sqlDataReader, model); list.Add(model); } num++; } } catch (SqlException exception) { throw exception; } } finally { if (sqlDataReader != null) { sqlDataReader.Close(); } } return(list); }
public void DeleteVersionByTemplate(FileTemplateModel model) { FileTemplateVersionBFL nbfl = new FileTemplateVersionBFL(); FileTemplateVersionQueryModel queryModel = new FileTemplateVersionQueryModel(); queryModel.FileTemplateCodeEqual = model.Code; List <FileTemplateVersionModel> fileTemplateVersionList = new List <FileTemplateVersionModel>(); fileTemplateVersionList = nbfl.GetFileTemplateVersionList(queryModel); if (fileTemplateVersionList != null) { foreach (FileTemplateVersionModel model3 in fileTemplateVersionList) { nbfl.Delete(model3); } } }
public List <FileTemplateVersionModel> GetFileTemplateVersionList(FileTemplateVersionQueryModel QueryModel) { List <FileTemplateVersionModel> models = new List <FileTemplateVersionModel>(); using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { try { connection.Open(); if (QueryModel == null) { QueryModel = new FileTemplateVersionQueryModel(); } models = new FileTemplateVersionBLL().GetModels(QueryModel, connection); connection.Close(); } catch (SqlException exception) { throw exception; } } return(models); }
public List <FileTemplateVersionModel> GetModels(FileTemplateVersionQueryModel ObjQueryModel, SqlTransaction Transaction) { FileTemplateVersionDAL ndal = new FileTemplateVersionDAL(Transaction); return(ndal.Select(ObjQueryModel)); }
public List <FileTemplateVersionModel> Select(FileTemplateVersionQueryModel qmObj) { return(this._Select(qmObj)); }
public List <FileTemplateVersionModel> Select() { FileTemplateVersionQueryModel qmObj = new FileTemplateVersionQueryModel(); return(this._Select(qmObj)); }