public List <GK_OA_WorkLogModel> GetGK_OA_WorkLogList(string SortColumns, int StartRecord, int MaxRecords, int CodeEqual, DateTime DayWritedEqual, string UserIdEqual, string WeatherEqual, string MoodEqual, string ContextEqual, string WaiterEqual) { List <GK_OA_WorkLogModel> models = new List <GK_OA_WorkLogModel>(); GK_OA_WorkLogQueryModel objQueryModel = new GK_OA_WorkLogQueryModel(); objQueryModel.StartRecord = StartRecord; objQueryModel.MaxRecords = MaxRecords; objQueryModel.SortColumns = SortColumns; objQueryModel.CodeEqual = CodeEqual; objQueryModel.DayWritedEqual = DayWritedEqual; objQueryModel.UserIdEqual = UserIdEqual; objQueryModel.WeatherEqual = WeatherEqual; objQueryModel.MoodEqual = MoodEqual; objQueryModel.ContextEqual = ContextEqual; objQueryModel.WaiterEqual = WaiterEqual; using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { try { models = new GK_OA_WorkLogBLL().GetModels(objQueryModel, connection); connection.Close(); } catch (SqlException exception) { throw exception; } } return(models); }
protected void btSearch_Click(object sender, EventArgs e) { GK_OA_WorkLogQueryModel wlQueryModel = new GK_OA_WorkLogQueryModel(); GK_OA_WorkLogBFL wlBFL = new GK_OA_WorkLogBFL(); wlQueryModel.QueryConditionStr = this._ConstructQueryString(); this.GridView1.DataSource = wlBFL.ChangeWorkLogModel(wlQueryModel); this.GridView1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!user.HasRight("350201")) { this.NewButton.Visible = false; } GK_OA_WorkLogQueryModel wlQueryModel = new GK_OA_WorkLogQueryModel(); GK_OA_WorkLogBFL wlBFL = new GK_OA_WorkLogBFL(); wlQueryModel.UserIdEqual = user.UserID; this.GridView1.DataSource = wlBFL.ChangeWorkLogModel(wlQueryModel); this.GridView1.DataBind(); }
private List <GK_OA_WorkLogModel> _Select(GK_OA_WorkLogQueryModel qmObj) { List <GK_OA_WorkLogModel> list = new List <GK_OA_WorkLogModel>(); StringBuilder builder = new StringBuilder(); builder.Append("select * from GK_OA_WorkLog "); 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))) { GK_OA_WorkLogModel model = new GK_OA_WorkLogModel(); this.Initialize(sqlDataReader, model); list.Add(model); } num++; } } catch (SqlException exception) { throw exception; } } finally { if (sqlDataReader != null) { sqlDataReader.Close(); } } return(list); }
public List <GK_OA_WorkLogModel> ChangeWorkLogModel(GK_OA_WorkLogQueryModel queryModel) { List <GK_OA_WorkLogModel> list = this.GetGK_OA_WorkLogList(queryModel); foreach (GK_OA_WorkLogModel model in list) { string context = model.Context; if (context.Length >= 100) { model.Context = context.Substring(0, 50) + " ... ..."; } } return(list); }
public List <GK_OA_WorkLogModel> GetGK_OA_WorkLogList(GK_OA_WorkLogQueryModel QueryModel) { List <GK_OA_WorkLogModel> models = new List <GK_OA_WorkLogModel>(); using (SqlConnection connection = new SqlConnection(FunctionRule.GetConnectionString())) { try { connection.Open(); if (QueryModel == null) { QueryModel = new GK_OA_WorkLogQueryModel(); } models = new GK_OA_WorkLogBLL().GetModels(QueryModel, connection); connection.Close(); } catch (SqlException exception) { throw exception; } } return(models); }
public List <GK_OA_WorkLogModel> Select(GK_OA_WorkLogQueryModel qmObj) { return(this._Select(qmObj)); }
public List <GK_OA_WorkLogModel> Select() { GK_OA_WorkLogQueryModel qmObj = new GK_OA_WorkLogQueryModel(); return(this._Select(qmObj)); }
public List <GK_OA_WorkLogModel> GetModels(GK_OA_WorkLogQueryModel ObjQueryModel, SqlTransaction Transaction) { GK_OA_WorkLogDAL gdal = new GK_OA_WorkLogDAL(Transaction); return(gdal.Select(ObjQueryModel)); }