Beispiel #1
0
 private DataTable QueryInBHData(string sql, SqlParameterInfo[] parms)
 {
     return Services.DataService.ExcuteDataTable(DSID_ORA, sql, parms,
         ZLSoft.BusinessHome.Application.ExeSqlType.CommonSql);
 }
Beispiel #2
0
 private void P6QueryRes(string sql, SqlParameterInfo[] parms)
 {
     this.ShowWaitCursor();
     try
     {
         DataTable dt = QueryInBHData(sql, parms);
         if (dt != null)
         {
             try
             {
                 dt.PrimaryKey = new DataColumn[] { dt.Columns["ID"] };
             }
             catch { }
         }
         DataGridView dgv = P6ResGetGrid();
         dgv.DataSource = dt;
         Helper.DataGridViewColumnsAutoSize(dgv);
     }
     finally
     {
         this.ShowDefaultCursor();
     }
 }
Beispiel #3
0
        private void btnP6ResTopTree_Click(object sender, EventArgs e)
        {
            try
            {
                string resId = P6ResGetFirstId();
                if (string.IsNullOrEmpty(resId))
                    return;

                string sql;
                if (this.chkP6ResTreeByID.Checked)
                {
                    sql = @"SELECT t1.displayname,t2.typename,t1.id,t1.parentid,t1.treecode,t1.displayname,t1.owner,t1.createtime,t1.lasteditor,t1.editetime
              FROM ResourceInfo t1,ResourceType t2
             WHERE (SELECT TreeCode
              FROM ResourceInfo
             WHERE ID=:P_ID) LIKE
               t1.TreeCode || '%'
               AND t1.ID<>'d782dd00-7347-45ba-8e8d-10adacf07db7'
               AND t1.resourcetypeid=t2.id(+)
             ORDER BY t1.treecode";
                }
                else
                {
                    sql = @"SELECT t1.displayname,t2.typename,t1.id,t1.parentid,t1.treecode,t1.displayname,t1.owner,t1.createtime,t1.lasteditor,t1.editetime
              FROM ResourceInfo t1,ResourceType t2
             WHERE (SELECT TreeCode
              FROM ResourceInfo
             WHERE ID=:P_ID) LIKE
               t1.TreeCode || '%'
               AND t1.ID<>'d782dd00-7347-45ba-8e8d-10adacf07db7'
               AND t1.resourcetypeid=t2.id(+)
             ORDER BY t1.treecode";
                }

                SqlParameterInfo[] parms = new SqlParameterInfo[] {
                    new SqlParameterInfo(":P_ID", BizFieldType.�ı�, resId),
                };

                P6QueryRes(sql, parms);
            }
            catch (Exception ex)
            {
                Helper.ShowError(this, ex.Message);
            }
        }
Beispiel #4
0
        private void btnP6TaskQuery_Click(object sender, EventArgs e)
        {
            try
            {
                int nTop = 0;
                if (!string.IsNullOrEmpty(this.txtP6Top.Text.Trim()))
                    int.TryParse(this.txtP6Top.Text.Trim(), out nTop);

                string sqlWhere = string.Empty;
                if (this.cboP6TaskType.SelectedIndex > 0)
                    sqlWhere = " and TaskType=" + (this.cboP6TaskType.SelectedIndex - 1).ToString();
                if (this.cboP6TaskCycle.SelectedItem as string == "һ����")
                    sqlWhere += " and CycleKind='O'";
                else if (this.cboP6TaskCycle.SelectedItem as string == "������")
                    sqlWhere += " and CycleKind<>'O'";
                if (this.cboP6TaskIsMultiPerson.SelectedItem as string == "����")
                    sqlWhere += " and MultiPerson=0";
                else if (this.cboP6TaskIsMultiPerson.SelectedItem as string == "����")
                    sqlWhere += " and MultiPerson=1";

                string sql;
                if (sqlWhere.Length > 0)
                    sql = "select * from tasklist where createtime between :P_TIME1 and :P_TIME2" + sqlWhere + " order by createtime desc";
                else
                    sql = "select * from tasklist where createtime between :P_TIME1 and :P_TIME2 order by createtime desc";
                if (nTop > 0)
                    sql = "select * from (" + sql + ") WHERE ROWNUM <= " + nTop.ToString();

                SqlParameterInfo[] parms = new SqlParameterInfo[] {
                    new SqlParameterInfo(":P_TIME1", BizFieldType.����ʱ��, this.timeP6TaskMin.Value),
                    new SqlParameterInfo(":P_TIME2", BizFieldType.����ʱ��, this.timeP6TaskMax.Value),
                };

                this.dgvP6Task.DataSource = QueryInBHData(sql, parms);
                Helper.DataGridViewColumnsAutoSize(this.dgvP6Task);
            }
            catch (Exception ex)
            {
                Helper.ShowError(this, ex.Message);
            }
        }
Beispiel #5
0
        private void btnP6ResRef_Click(object sender, EventArgs e)
        {
            try
            {
                string resId = P6ResGetFirstId();
                if (string.IsNullOrEmpty(resId))
                    return;

                string sql;
                if (this.chkP6ResIncludingChildren.Checked)
                {
                    sql = @"Select t1.displayname,t3.typename, t1.id, t1.treecode, t2.resourceid HostID, t2.referencetype, t2.isinner
              From ResourceInfo t1, Resourcereference t2, ResourceType t3
             Where t2.resourceid in (select id from resourceinfo where treecode like (select treecode from resourceinfo where id=:P_ID)||'%')
               And t1.id(+)=t2.referencedid
               And t1.resourcetypeid=t3.id(+)
             Order by HostID";
                }
                else
                {
                    sql = @"Select t1.displayname,t3.typename, t1.id, t1.treecode, t2.referencetype, t2.isinner
              From ResourceInfo t1, Resourcereference t2, ResourceType t3
             Where t2.resourceid=:P_ID And t1.id(+)=t2.referencedid And t1.resourcetypeid=t3.id(+)";
                }
                SqlParameterInfo[] parms = new SqlParameterInfo[] {
                    new SqlParameterInfo(":P_ID", BizFieldType.�ı�, resId),
                };

                P6QueryRes(sql, parms);
            }
            catch (Exception ex)
            {
                Helper.ShowError(this, ex.Message);
            }
        }