Exemple #1
0
        /// <summary>
        /// 流程列表双击事件
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void TFlowlist_DataGridRowDoubleClick(object sender, DataGridRowClickedArgs e)
        {
            V_FlowDefine item = e.DataGridRowItem as V_FlowDefine;

            if (item != null)
            {
                LoadFlowDefine(item.FlowCode);
            }
        }
Exemple #2
0
 /// <summary>
 /// 获取流程列表
 /// </summary>
 /// <param name="allOwnerCompanyId">公司ID</param>
 /// <returns>List<V_FlowDefine></returns>
 public List <V_FlowDefine> GetFlowDefineList(int pageSize, int pageIndex, string strFilter, string strOrderBy, ref int pageCount)
 {
     try
     {
         if (string.IsNullOrEmpty(strOrderBy))
         {
             strOrderBy = "a.createdate desc";
         }
         if (pageSize == 0)
         {
             pageSize = 15;
         }
         int number = pageIndex <= 1 ? 1 : 1 + ((pageIndex - 1) * pageSize);
         dao.Open();
         StringBuilder sb       = new StringBuilder();
         string        countSql = @"select count(1) from flow_flowdefine_t a
                             inner join flow_modelflowrelation_t b on a.flowcode=b.flowcode
                             inner join flow_modeldefine_t c on c.modelcode=b.modelcode where (1=1)";
         if (!string.IsNullOrWhiteSpace(strFilter))
         {
             countSql += strFilter + " ";
         }
         string sql = @"SELECT * FROM (SELECT A.*, ROWNUM Page FROM (select a.createdate, a.flowcode,a.description,b.companyid,
                             b.departmentid,b.companyname,b.departmentname, 
                             c.systemcode,c.modelcode,c.description modelname ,c.systemname from flow_flowdefine_t a
                             inner join flow_modelflowrelation_t b on a.flowcode=b.flowcode
                             inner join flow_modeldefine_t c on c.modelcode=b.modelcode
                             WHERE (1=1)  " + strFilter + "  order by   " + strOrderBy + " ) A WHERE (1=1) AND ROWNUM<= " + pageIndex * pageSize + " ";
         sql += ") WHERE  Page >= " + number + " ";
         DataTable dt = dao.GetDataTable(sql);
         LogHelper.WriteLog("查找到的流程SQL" + sql);
         pageCount = Convert.ToInt32(dao.ExecuteScalar(countSql));
         pageCount = (pageCount / pageSize) + ((pageCount % pageSize) > 0 ? 1 : 0);
         List <V_FlowDefine> list = new List <V_FlowDefine>();
         if (dt != null && dt.Rows.Count > 0)
         {
             foreach (DataRow dr in dt.Rows)
             {
                 V_FlowDefine entity = new V_FlowDefine();
                 entity.FlowCode       = dr["flowcode"].ToString();
                 entity.FlowName       = dr["description"] == null ? string.Empty : dr["description"].ToString();
                 entity.CompanyName    = dr["companyname"] == null ? string.Empty : dr["companyname"].ToString();
                 entity.DepartmentName = dr["departmentname"] == null ? string.Empty : dr["departmentname"].ToString();
                 entity.SystemName     = dr["systemname"] == null ? string.Empty : dr["systemname"].ToString();
                 entity.ModelName      = dr["modelname"] == null ? string.Empty : dr["modelname"].ToString();
                 entity.CREATEDATE     = Convert.ToDateTime(dr["createdate"].ToString());
                 list.Add(entity);
             }
         }
         return(list);
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message, ex);
     }
 }