Exemplo n.º 1
0
        public ResetPwd()
        {
            InitializeComponent();

            if (service.IsFirst())
            {
                lblMessage.Content = "初次使用,请设置密码";
                // 原密码部分不显示
                lblOldPwd.Visibility = Visibility.Hidden;
                txtOldPwd.Visibility = Visibility.Hidden;
            }
            else
            {
                lblMessage.Content = service.GetLabelContent();
            }
            this.Title = lblMessage.Content.ToString();

            // 获取程序运行根目录
            string appPath = AppDomain.CurrentDomain.BaseDirectory;

            // 背景初始化
            ImageBrush imageBrush = new ImageBrush();

            imageBrush.Stretch          = Stretch.UniformToFill;
            imageBrush.ImageSource      = ReadPicture(appPath + @"Resource\BackgroudImage\login.jpg");
            this.grdResetPwd.Background = imageBrush;
        }
Exemplo n.º 2
0
        /// <summary>
        /// 构造函数
        /// </summary>
        public Login()
        {
            InitializeComponent();
            // 获取标签显示内容
            lblMessage.Content = service.GetLabelContent();

            // 设置窗口标题
            this.Title = lblMessage.Content.ToString();

            // 获取程序运行根目录
            string appPath = AppDomain.CurrentDomain.BaseDirectory;

            // 头像初始化
            imgPortrait.Source              = ReadPicture(appPath + @"Resource\Portrait\2121.jpg");
            imgPortrait.Stretch             = Stretch.UniformToFill;
            imgPortrait.HorizontalAlignment = HorizontalAlignment.Center;
            imgPortrait.VerticalAlignment   = VerticalAlignment.Center;

            // 背景初始化
            ImageBrush imageBrush = new ImageBrush();

            imageBrush.Stretch       = Stretch.UniformToFill;
            imageBrush.ImageSource   = ReadPicture(appPath + @"Resource\BackgroudImage\login.jpg");
            this.grdLogin.Background = imageBrush;
        }
Exemplo n.º 3
0
        public Main()
        {
            InitializeComponent();
            // 缩放,最大化修复
            WindowBehaviorHelper wh = new WindowBehaviorHelper(this);

            wh.RepairBehavior();

            // 背景初始化
            this.Display();

            // 欢迎标签显示内容
            lblWelcome.Content = service.GetLabelContent();

            // 设置窗口标题
            this.Title = lblWelcome.Content.ToString();

            // 显示今日合计
            this.GetDayTotal(DateTime.Now);

            // 显示本月合计
            this.GetMonthTotal(DateTime.Now);

            // 初始化日期显示
            // 显示最近一个月
            DateTime today    = DateTime.Parse(DateTime.Now.ToString("yyyy/MM/dd"));
            DateTime dateFrom = today.AddMonths(-1);
            DateTime dateTo   = today.AddDays(1).AddSeconds(-1);

            this.dateFrom.SelectedDate = dateFrom;
            this.dateTo.SelectedDate   = dateTo;

            this.dateEdit.SelectedDate = DateTime.Now;

            // 获取一览信息
            this.GetListByDay(dateFrom, dateTo, this.txtFilter.Text);
            this.GetListDetail(DateTime.Now);
        }