public override void remove(IList <string> ids) { if (ids == null || ids.Count <= 0) { return; } foreach (string id in ids) { StageQueryCondition qc = new StageQueryCondition(); qc.project_id = id; IList <Stage> stages = this.stageDao.query(qc); IList <string> stageIds = new List <string>(); foreach (Stage s in stages) { stageIds.Add(s.id); } this.stageDao.remove(stageIds); this.removeAllOverviewMedias(id); MediaQueryCondition mqc = new MediaQueryCondition(); mqc.project_id = id; IList <Media> medias = this.mediaDao.query(mqc); IList <string> mediaIds = new List <string>(); foreach (Media m in medias) { mediaIds.Add(m.id); } this.mediaDao.remove(mediaIds); } base.remove(ids); }
public StageWindow(ListWindowType windowType, StageQueryCondition qc) { this.queryCondition = qc; currentEntity = null; this.windowType = windowType; this.Init(); }
public StageWindow() : base() { this.queryCondition = null; currentEntity = null; this.Init(); }
protected override void setQueryParameters(OleDbParameterCollection parameters, QueryCondition queryCondition) { StageQueryCondition qc = (StageQueryCondition)queryCondition; if (!string.IsNullOrWhiteSpace(qc.project_id)) { parameters.Add("@project_id", OleDbType.VarWChar, 255).Value = qc.project_id; } }
private void toolStripMenuItem_QueryStage_Click(object sender, EventArgs e) { if (this.dataGridView.SelectedExistData()) { IList <string> ids = this.dataGridView.SelectedIds(); StageQueryCondition qc = new StageQueryCondition(); qc.project_id = ids[0]; StageWindow queryWindow = new StageWindow(qc); queryWindow.ShowDialog(this); } }
private void comboBox_Project_SelectedIndexChanged(object sender, EventArgs e) { if (this.comboBox_Project.SelectedValue == null) { return; } StageQueryCondition qc = new StageQueryCondition(); qc.project_id = (string)this.comboBox_Project.SelectedValue; this.stageList = this.stageDao.query(qc); this.bindingSource_Stage.DataSource = this.stageList; }
protected override String getQuerySQL(QueryCondition queryCondition) { StageQueryCondition qc = (StageQueryCondition)queryCondition; string rs = SQL_QUERY; string conditions = null; if (!string.IsNullOrWhiteSpace(qc.project_id)) { conditions += this.getConditionsPre(conditions, "AND", "s.project_id = @project_id"); } rs += conditions; return(rs); }
private void comboBox_Query_Project_SelectedIndexChanged(object sender, EventArgs e) { if (this.comboBox_Query_Project.SelectedValue != null) { StageQueryCondition qc = new StageQueryCondition(); qc.project_id = (string)this.comboBox_Query_Project.SelectedValue; this.stageList = this.stageDao.query(qc); } else { this.stageList = new List <Stage>(); } stageList.Insert(0, Utils.getHeadStage()); this.bindingSource_Stage.DataSource = this.stageList; }
private void InitData() { projectList = this.projectDao.queryAll(); this.bindingSource_Project.DataSource = projectList; if (projectList.Count > 0) { StageQueryCondition qc = new StageQueryCondition(); qc.project_id = projectList.ElementAt(0).getId(); stageList = stageDao.query(qc); } else { stageList = new List <Stage>(); } this.bindingSource_Stage.DataSource = stageList; }
public void RefreshData() { this.dataGridView.queryCondition = this.queryCondition; this.dataGridView.RefreshGrid(); }
public StageWindow(StageQueryCondition qc) { this.queryCondition = qc; currentEntity = null; this.Init(); }
private void button_Search_Click(object sender, EventArgs e) { this.queryCondition = new StageQueryCondition(); this.queryCondition.project_id = (string)this.comboBox_Query_Project.SelectedValue; this.RefreshData(); }