Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 public StageWindow(ListWindowType windowType, StageQueryCondition qc)
 {
     this.queryCondition = qc;
     currentEntity       = null;
     this.windowType     = windowType;
     this.Init();
 }
Esempio n. 3
0
 public StageWindow()
     : base()
 {
     this.queryCondition = null;
     currentEntity       = null;
     this.Init();
 }
Esempio n. 4
0
        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;
            }
        }
Esempio n. 5
0
 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);
     }
 }
Esempio n. 6
0
        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;
        }
Esempio n. 7
0
        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);
        }
Esempio n. 8
0
 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;
 }
Esempio n. 9
0
 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;
 }
Esempio n. 10
0
 public void RefreshData()
 {
     this.dataGridView.queryCondition = this.queryCondition;
     this.dataGridView.RefreshGrid();
 }
Esempio n. 11
0
 public StageWindow(StageQueryCondition qc)
 {
     this.queryCondition = qc;
     currentEntity       = null;
     this.Init();
 }
Esempio n. 12
0
 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();
 }