コード例 #1
0
        public PilotsCheck(AdminWindow AdW)
        {
            this.AdW = AdW;
            InitializeComponent();
            Check = new CustomButton()
            {
                Text = "تصفية الحساب :   2.00    ", /* TextAlignment = TextAlignment.Left,*/ Width = 290, Height = 60, Margin = new Thickness(ss7_2.Margin.Left - 233, 0, 0, 0), Background = (Brush) new BrushConverter().ConvertFrom("#FF008D2D"), Foreground = Brushes.White, TextShiftUp = -5,
            };
            Check.Hide();
            selected         = null;
            BtnNum           = 0;
            TotalDeliveryPay = 0;
            Check.MouseDown += Check_MouseDown;
            Gr.Children.Add(Check);

            CustomButton btn = new CustomButton()
            {
                Text = "أحمد محسن", TextAlignment = TextAlignment.Right, Width = Gr2.Width, Height = dash, Background = Brushes.White, Foreground = (Brush) new BrushConverter().ConvertFrom("#FF0367BB"), HighlightedBackground = (Brush) new BrushConverter().ConvertFrom("#FF0367BB"), HighlightedForeground = Brushes.White,
            };

            Gr2.Children.Add(btn);
            BtnNum++;
            btn.MouseDown += btn_MouseDown;
            btn            = new CustomButton()
            {
                Text = "حسن عزام", TextAlignment = TextAlignment.Right, Width = Gr2.Width, Height = dash, Background = Brushes.White, Foreground = (Brush) new BrushConverter().ConvertFrom("#FF0367BB"), HighlightedBackground = (Brush) new BrushConverter().ConvertFrom("#FF0367BB"), HighlightedForeground = Brushes.White,
            };
            Gr2.Children.Add(btn);
            btn.MouseDown += btn_MouseDown;
            BtnNum++;
        }
コード例 #2
0
        private void AdminLogin_Click(object sender, RoutedEventArgs e)
        {
            var db       = new res_for_sheratonEntities();
            var username = UsernameText.Text;
            var password = PasswordText.Password;
            var user     = db.SecUsers.Where(u => u.UserName == username && u.UserPasswd == password).FirstOrDefault();

            if (user == null)
            {
                MessageBox.Show("خطأ في كلمة المرور أو اسم المستخدم");
                UsernameText.Text     = "";
                PasswordText.Password = "";
            }
            else
            {
                var mainform = new AdminWindow();
                this.Hide();
                mainform.Show();
            }
        }