示例#1
0
 /// <summary>
 /// 显示概览
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void dgObject_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
 {
     if (Global.g_userrole == 8)  //总经理可以看到所有信息
     {
         this.panel.Children.Clear();
         if (dgObject.SelectedItem == null)
         {
             return;
         }
         TB_PROJECT proj = dgObject.SelectedItem as TB_PROJECT;
         ucPreview2 uc   = new ucPreview2(proj.Id);
         uc.Loaded += uc_Loaded;
         uc.Width   = panel.Width;
         this.panel.Children.Add(uc);
     }
     else
     {
         this.panel.Children.Clear();
         if (dgObject.SelectedItem == null)
         {
             return;
         }
         TB_PROJECT proj = dgObject.SelectedItem as TB_PROJECT;
         ucPreview  uc   = new ucPreview(proj.Id);
         uc.Loaded += uc_Loaded;
         uc.Width   = panel.Width;
         //uc.IsEnabled = false;
         this.panel.Children.Add(uc);
     }
 }
示例#2
0
 private int mUserRole; //登录用户角色
 public ucMainProj()
 {
     InitializeComponent();
     mUserRole = Global.g_userrole;
     BindSourceData();
     BindProjectData();//("", "", 0, null, null);
     this.dtpBeginDate.DateTime = dtpEndDate.DateTime.AddMonths(-1);
     if (Global.g_userrole == 8)
     {
         ucPreview2 uc = new ucPreview2(0);
         uc.Loaded += uc_Loaded;
         uc.Width   = panel.Width;
         this.panel.Children.Add(uc);
     }
     else
     {
         ucPreview uc = new ucPreview(0);
         uc.Loaded += uc_Loaded;
         uc.Width   = panel.Width;
         this.panel.Children.Add(uc);
         uc.IsEnabled = false;
     }
 }