Ejemplo n.º 1
0
 void GridManagers_Managers_NeedChildDataSource(object sender, ComponentArt.Web.UI.GridNeedChildDataSourceEventArgs e)
 {
     string[] retMessage = new string[4];
     try
     {
         if (e.Item.Level == 0)
         {
             IList <Flow> ManagerDetailsList = this.ManagerBusiness.GetManagerDetail(decimal.Parse(e.Item["ID"].ToString()));
             e.DataSource = ManagerDetailsList;
         }
     }
     catch (UIValidationExceptions ex)
     {
         retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIValidationExceptions, ex, retMessage);
         this.ErrorHiddenField_Managers_Managers.Value = this.exceptionHandler.CreateErrorMessage(retMessage);
     }
     catch (UIBaseException ex)
     {
         retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.UIBaseException, ex, retMessage);
         this.ErrorHiddenField_Managers_Managers.Value = this.exceptionHandler.CreateErrorMessage(retMessage);
     }
     catch (Exception ex)
     {
         retMessage = this.exceptionHandler.HandleException(this.Page, ExceptionTypes.Exception, ex, retMessage);
         this.ErrorHiddenField_Managers_Managers.Value = this.exceptionHandler.CreateErrorMessage(retMessage);
     }
 }
Ejemplo n.º 2
0
        //private bool m_isHierarchicalEventCreated;
        //private Dictionary<int, WindowTabInfo> m_levelTabInfos = new Dictionary<int, WindowTabInfo>();
        //private MockDisplayManager m_dmMock = new MockDisplayManager();

        void Grid1_NeedChildDataSource(object sender, ComponentArt.Web.UI.GridNeedChildDataSourceEventArgs e)
        {
            //WindowTabInfo tabInfo = m_levelTabInfos[e.Item.Level];

            //ISearchManager sm = Feng.Windows.Forms.ArchiveFormFactory.GenerateSearchManager(tabInfo, m_dmMock);

            //m_dmMock.SetCurrentItem(e.Item);

            ////string exp = Helper.ReplaceParameterizedEntity(m_searchExpression, e.Item);
            ////object ret = m_innerSearchManager.FindData(new List<ISearchExpression> { SearchExpression.Parse(exp) }, null);

            //e.DataSource = ret;

            //Services.SoaDataService service = new Hd.Web.Services.SoaDataService();
            //ComponentArt.SOA.UI.SoaDataGridSelectResponse response = service.Select(new ComponentArt.SOA.UI.SoaDataGridSelectRequest());
            //e.DataSource = response.Data;


            //List<List<object>> ret = new List<List<object>>();
            //ret.Add(new List<object> { "a" });
            //ret.Add(new List<object> { "b" });
            //e.DataSource = ret;

            //if (args.Item.Level == 0)
            //{
            //    args.DataSource =
            //        (from product in db.Products
            //         where product.CategoryID == (int)args.Item["CategoryId"]
            //         select new
            //         {
            //             ProductId = product.ProductID,
            //             ProductName = product.ProductName,
            //             SupplierId = product.SupplierID,
            //             QuantityPerUnit = product.QuantityPerUnit,
            //             UnitPrice = product.UnitPrice,
            //             UnitsInStock = product.UnitsInStock
            //         }).ToList();
            //}
        }
        void GridUnderManagementPersonnelExeptionAccessView_UnderManagementPersonnelExeptionAccessView_NeedChildDataSource(object sender, ComponentArt.Web.UI.GridNeedChildDataSourceEventArgs e)
        {
            string conStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=";

            conStr += Server.MapPath("~/common/db/demo.mdb");
            System.Data.OleDb.OleDbConnection srcDB = new System.Data.OleDb.OleDbConnection(conStr);
            srcDB.Open();

            if (e.Item.Level == 0)
            {
                string sql = "SELECT * FROM DetailedUnderManagementPersonnelExeptionAccessView WHERE MasterUnderManagementPersonnelExeptionID = " + e.Item["ID"];
                System.Data.OleDb.OleDbDataAdapter daSrc = new System.Data.OleDb.OleDbDataAdapter(sql, srcDB);
                DataTable oTable = new DataTable();
                daSrc.Fill(oTable);

                e.DataSource = oTable;
            }
            srcDB.Close();
        }