Ejemplo n.º 1
0
        public void PopulateDataFromLogin(string Values)
        {
            TBikeDAL  MyDAL       = new TBikeDAL();
            DataTable ResultTable = MyDAL.SelectEmployeeID("", Values);


            if (ResultTable.Rows.Count > 0)
            {
                TLUsername.Text = Convert.ToString(ResultTable.Rows[0]["EmployeeName"]).Trim();
                TLRankDesc.Text = Convert.ToString(ResultTable.Rows[0]["EmployeeRankDesc"]).Trim();
                username        = Convert.ToString(ResultTable.Rows[0]["Username"]).Trim();
                RankID          = Convert.ToInt32(ResultTable.Rows[0]["EmployeeRank"]);
                if (RankID < 2)
                {
                    ExpanderEmployee.AllowDrop = false;
                    ExpanderEmployee.IsEnabled = false;

                    ExpanderReports.IsEnabled = false;
                    ExpanderStore.IsEnabled   = false;
                }
                Framework.Visibility = Visibility.Visible;
                FinalizeReports search = new FinalizeReports();
                search.RankID     = RankID;
                search.username   = username;
                Framework.Content = search.Content;
            }
        }
Ejemplo n.º 2
0
        public void PopulateDataFromLogin(string Values)
        {
            TBikeDAL  MyDAL       = new TBikeDAL();
            DataTable ResultTable = MyDAL.SelectEmployeeID("", Values);


            if (ResultTable.Rows.Count > 0)
            {
                TLUsername.Text = Convert.ToString(ResultTable.Rows[0]["EmployeeName"]).Trim();
                TLRankDesc.Text = Convert.ToString(ResultTable.Rows[0]["EmployeeRankDesc"]).Trim();
                username        = Convert.ToString(ResultTable.Rows[0]["Username"]).Trim();
                RankID          = Convert.ToInt32(ResultTable.Rows[0]["EmployeeRank"]);
            }
        }
Ejemplo n.º 3
0
        public async void VerifyRequirements()
        {
            TBikeDAL  MyDal               = new TBikeDAL();
            DataTable ResultTable         = MyDal.SelectEmployeeID("", TBUsername.Text);
            DataTable ResultTableEmployee = MyDal.ShowAllEmployeeDetails();
            int       i = 0;
            int       a = 0;
            string    Email;

            foreach (DataRow row in ResultTableEmployee.Rows)
            {
                Email = Convert.ToString(ResultTableEmployee.Rows[i]["Email"]);
                if (Email == TBEmail.Text)
                {
                    a = a + 1;
                }


                i++;
            }


            if (ResultTable.Rows.Count > 0)
            {
                if (TBUsername.Text == Convert.ToString(ResultTable.Rows[0]["Username"]).Trim())
                {
                    PopWindow pop = new PopWindow(ImageType.Information, "Error", "Username has been used", "ok, i will check again");
                    pop.ShowDialog();
                }



                else if (TBConfirmPassword != TBPassword)
                {
                    var res = await this.ShowMessageAsync("Password Not Match", "Password not match with confirm pasword");
                }

                //TLRankDesc.Text = Convert.ToString(ResultTable.Rows[0]["EmployeeRankDesc"]).Trim();
                //username = Convert.ToString(ResultTable.Rows[0]["Username"]).Trim();
                //RankID = Convert.ToInt32(ResultTable.Rows[0]["EmployeeRank"]);
            }
            else
            {
                if ((TBConfirmPassword.Password.ToString().Trim()) != (TBPassword.Password.ToString().Trim()))
                {
                    var res = await this.ShowMessageAsync("Password Not Match", "Password not match with confirm pasword");
                }
                else if (a == 0)
                {
                    var res = await this.ShowMessageAsync("Sorry", "This Email has no record");
                }
                else
                {
                    //var res = await this.ShowMessageAsync("No Record", "No Email address record found ");
                    MyDal.AddNewEmployeeLoginInfo(TBEmail.Text, TBUsername.Text, TBPassword.Password.ToString().Trim());
                    var res = await this.ShowMessageAsync("Registration Completed", " Please go back and Login");

                    this.Close();
                }
            }
        }