Ejemplo n.º 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);
     }
 }
Ejemplo n.º 2
0
 private void ExpendAnimal(double k1, double k2, Border b = null)
 {
     if (dgObject.SelectedItem != null)
     {
         TB_PROJECT proj = dgObject.SelectedItem as TB_PROJECT;
         ucPreview  uc   = new ucPreview(proj.Id);
         this.ExpenseListPanel.Children.Clear();
         this.ExpenseListPanel.Children.Add(uc);
         if (b == null)
         {
             if (this.spBorder.Width == k2)
             {
                 DoubleAnimation wAnimation = new DoubleAnimation(k1, k2, new Duration(TimeSpan.FromSeconds(0.3)));
                 this.spBorder.BeginAnimation(DockPanel.WidthProperty, wAnimation, HandoffBehavior.Compose);
             }
         }
         else
         {
             if (b.Width == k1)
             {
                 DoubleAnimation wAnimation = new DoubleAnimation(k1, k2, new Duration(TimeSpan.FromSeconds(0.3)));
                 b.BeginAnimation(DockPanel.WidthProperty, wAnimation, HandoffBehavior.Compose);
             }
             else if (this.spBorder.Width == k2)
             {
                 DoubleAnimation wAnimation = new DoubleAnimation(k2, k1, new Duration(TimeSpan.FromSeconds(0.3)));
                 this.spBorder.BeginAnimation(DockPanel.WidthProperty, wAnimation, HandoffBehavior.Compose);
             }
         }
     }
 }
Ejemplo n.º 3
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;
     }
 }