Пример #1
0
        public AdminDashboard GetAdminDashboardInfo(string filterDate = "")
        {
            var objAdminResult = new AdminDashboard();

            if (string.IsNullOrEmpty(filterDate))
            {
                filterDate = DateTime.Now.ToString("MM-dd-yyyy");
            }

            try
            {
                objAdminResult.ExpiryDrugs       = _objLabManagementEntities.usp_GetExpiryDrugsByDays(1).ToList();
                objAdminResult.DrugStocks        = _objLabManagementEntities.usp_GetDrugStocks().ToList();
                objAdminResult.IpRegistration    = _objLabManagementEntities.usp_GetInPatientDetails(filterDate).ToList();
                objAdminResult.OpRegistration    = _objLabManagementEntities.usp_GetOutPatients(filterDate).ToList();
                objAdminResult.ProfitLoss        = _objLabManagementEntities.usp_GetMedicalProfitLoss(filterDate).ToList();
                objAdminResult.MedicalBillByDate = _objLabManagementEntities.usp_GetMedicalBillsByDate(filterDate).ToList();
                if (objAdminResult.DrugStocks.Any())
                {
                    objAdminResult.AvailableDrugsCount = objAdminResult.DrugStocks.Sum(x => x.AvailableStock.HasValue ? x.AvailableStock.Value : 0);
                }
                objAdminResult.TotalTodayIpRegistration = objAdminResult.IpRegistration.Count();
                objAdminResult.TotalTodayOpRegistration = objAdminResult.OpRegistration.Count();
                if (objAdminResult.ProfitLoss.Any())
                {
                    objAdminResult.NetPharmachyProfitLLoss = objAdminResult.ProfitLoss.Sum(x => x.NETPROFITPERDRUG.HasValue ? x.NETPROFITPERDRUG.Value : 0);
                }
            }
            catch (Exception ex)
            {
                _objIAppLogger.LogError(ex);
            }
            return(objAdminResult);
        }
Пример #2
0
        public static void AdminLogout()
        {
            AdminDashboard admin = new AdminDashboard();

            admin.AdminName.Click();
            admin.AdminLogout.Click();
        }
        public void Login(Form _form)
        {
            loginProxy = new LoginProxy();
            var user = loginProxy.Login(UserName, Password);

            if (user != null)
            {
                if (user.AccountLevel == "admin")
                {
                    _form.Hide();
                    Form admin = new AdminDashboard();
                    admin.Show();
                }
                else if (user.AccountLevel == "student")
                {
                    _form.Hide();
                    Form student = new StudentDashboard(user.RegistrationID.ToString());
                    student.Show();
                }
                else if (user.AccountLevel == "teacher")
                {
                    _form.Hide();
                    Form teacher = new TeacherDashboard(user.RegistrationID.ToString());
                    teacher.Show();
                }
            }
            else
            {
                MessageBox.Show("Incorrect Username or Password!");
            }
        }
Пример #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            lb.username = username.Text.Trim();
            lb.password = password.Text.Trim();
            lb.usertype = userType.Text.Trim();

            bool success = ld.loginCheck(lb);

            if (success == true)
            {
                try
                {
                    AdminDashboard adm = new AdminDashboard();
                    adm.Show();
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Error");
                    clear();
                }
            }
            else
            {
                MessageBox.Show("Please enter valid login details");
                clear();
            }
        }
Пример #5
0
        public async Task <IActionResult> Index()
        {
            AdminDashboard db;
            long           measurementCount;

            var measurementStats = this.GetMeasurementStats();
            var sensors          = this._sensors.CountAsync();

            db = new AdminDashboard {
                Registrations  = await this.GetRegistrations().AwaitBackground(),
                NumberOfUsers  = await this._users.CountAsync().AwaitBackground(),
                NumberOfGhosts = await this._users.CountGhostUsersAsync().AwaitBackground()
            };

            var measurements = await this._stats.GetAfterAsync(DateTime.UtcNow.ThisHour()).AwaitBackground();

            measurementCount = measurements.Aggregate(0L, (current, entry) => current + entry.Count);

            db.MeasurementStatsLastHour = measurementCount;
            db.MeasurementStats         = await measurementStats.AwaitBackground();

            db.NumberOfSensors = await sensors.AwaitBackground();

            return(this.Ok(db.ToJson()));
        }
Пример #6
0
            public void ValidateAdminDashboard()
            {
                // starting test
                test = extent.StartTest("Validate Admin Dashboard test case starts");
                AdminDashboard objAdmindashboard = new AdminDashboard();

                objAdmindashboard.ValidateAdmin();
            }
Пример #7
0
        public AdminDashboard GetDashboard()
        {
            EstadisticaAnual anual = GetEstadisticaAnual();

            AdminDashboard dashboard = new AdminDashboard(anual);

            return(dashboard);
        }
        public void ValidAdminLogin()
        {
            Actions.LoginAsAdmin();

            AdminDashboard admin = new AdminDashboard();

            Assert.AreEqual(Config.Credentials.Valid.admindashboardName, admin.AdminDashboardText.Text);
            Actions.AdminLogout();
        }
Пример #9
0
        /// <summary>
        /// Process clear button click
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Clear_Button_Click(object sender, EventArgs e)
        {
            this.ClearForm();

            AdminDashboard dashboard = this.ParentForm as AdminDashboard;

            dashboard.SelectedNurseID = 0;
            dashboard.RefreshTabs(sender, e);
        }
Пример #10
0
 public AdminDashboardController(AdminDashboard model, AdminDashboardView view, Form curForm)
 {
     this.model   = model;
     this.view    = view;
     this.curForm = curForm;
     view.BtnViewAddEmployee.Click    += (sender, e) => ButtonClick(sender, e);
     view.BtnViewEditEmployee.Click   += (sender, e) => ButtonClick(sender, e);
     view.BtnViewDeleteEmployee.Click += (sender, e) => ButtonClick(sender, e);
 }
        public void TablesTest()
        {
            adminDashboard = new AdminDashboard();

            if (adminDashboard.StudentEmailTableName.Enabled && adminDashboard.InstructorEmailTableName.Enabled)
            {
                Console.WriteLine("TAbles Exisit for Student and Instructor");
            }
        }
Пример #12
0
        private void MbtnLogin_Click(object sender, EventArgs e)
        {
            if (this.txtLoginPassword.Text != "" && this.txtLoginId.Text != "")
            {
                UserLoginEntity user = new UserLoginEntity();
                user.UserId       = txtLoginId.Text.Trim();
                user.UserPassword = txtLoginPassword.Text;


                UserLoginRepository emp = new UserLoginRepository();

                if (emp.UserLoginValidation(user))
                {
                    if (user.UserId.Substring(0, 1) == "A")
                    {
                        MessageBox.Show("Admin");
                        AdminDashboard admin = new AdminDashboard(this, user.UserId);
                        this.Hide();
                        admin.Show();
                        Clear();
                    }
                    else if (user.UserId.Substring(0, 1) == "W")
                    {
                        MessageBox.Show("Waiter");
                        Waiter_Dashboard wd = new Waiter_Dashboard(this, user.UserId);
                        this.Hide();
                        wd.Show();
                        Clear();
                    }

                    else if (user.UserId.Substring(0, 1) == "M")
                    {
                        MessageBox.Show("Manager");
                        Manager_Dashboard md = new Manager_Dashboard(this, user.UserId);
                        this.Hide();
                        md.Show();
                        Clear();
                    }

                    else
                    {
                        MessageBox.Show("Invalid Form Of Id!");
                        Clear();
                    }
                }
                else
                {
                    MessageBox.Show("Invalid Id or Password", "Login Failed");
                    Clear();
                }
            }
            else
            {
                MessageBox.Show("Insert ID or Password", "Login Failed");
                Clear();
            }
        }
        public void AllButtonsTest()
        {
            adminDashboard = new AdminDashboard();

            if (adminDashboard.RemoveEmails.Enabled && adminDashboard.ConfigureModules.Enabled && adminDashboard.ManageMedia.Enabled && adminDashboard.AddStudentEmail.Enabled && adminDashboard.AddInstructorEmail.Enabled)
            {
                Console.WriteLine("All Buttons on Admin Dashboard are enabled");
            }
        }
Пример #14
0
        private void goBackBtn_Click(object sender, EventArgs e)
        {
            MVCForm.DisposeView(view);
            AdminDashboard           adminDashboard           = new AdminDashboard();
            AdminDashboardView       adminDashboardView       = new AdminDashboardView();
            AdminDashboardController adminDashboardController = new AdminDashboardController(adminDashboard, adminDashboardView, this.curForm);

            adminDashboardController.DisplayView();
            adminDashboardController.DisplayNavigation();
        }
Пример #15
0
        public ActionResult AdminDashboard()
        {
            var roleList = AdapterDb.Database.GetAll <AdapterDb.Roles, Role>(
                (dbRoles) => Mapper.Map <IEnumerable <AdapterDb.Roles>, IEnumerable <Role> >(dbRoles)).OrderBy(r => r.Name).ToList();

            var businessList = AdapterDb.Database.GetAll <AdapterDb.Business, Business>(
                (dbBusinessList) => Mapper.Map <IEnumerable <AdapterDb.Business>, IEnumerable <Business> >(dbBusinessList)).OrderBy(b => b.Name).ToList();

            var userList = AdapterDb.Database.GetAll <AdapterDb.User, User>(
                (dbUsers) =>
            {
                var users = new List <User>();

                foreach (var dbUser in dbUsers.Where(u => u.IsActive).OrderBy(u => u.UserName))
                {
                    var user = Mapper.Map <AdapterDb.User, User>(dbUser);

                    user.Roles        = GetRoleActivity(roleList, dbUser.Roles.Select(r => r.Id).ToArray());
                    user.BusinessList = GetBusinessActivity(businessList, dbUser.BusinessMember.Select(bm => bm.BusinessId).ToArray());

                    users.Add(user);
                }
                return(users);
            });

            var businessLineList = AdapterDb.Database.GetBusinessLineList(User);

            /* BEGIN ADJUST TIMES */
            DateTime clientCurrentTime = TimeZoneHelper.ClientCurrentTime(ViewBag.TimeZoneOffset);
            DateTime clientToday       = clientCurrentTime.Date;

            //var utcTimeFrom = TimeZoneHelper.ClientToUtc(clientToday, ViewBag.TimeZoneOffset);
            //var utcTimeTo = TimeZoneHelper.ClientToUtc(clientCurrentTime, ViewBag.TimeZoneOffset);
            /* END ADJUST TIMES */

            var aggregatedModel = GetAggregatedModel(clientToday, clientCurrentTime, businessLineList);

            aggregatedModel.ClientTimeFrom = clientToday;
            aggregatedModel.ClientTimeTo   = clientCurrentTime;

            var employeeList  = AdapterDb.Database.GetCalledEmployees(User, null, clientToday, clientCurrentTime);
            var employeeIds   = employeeList.Select(e => e.Id).ToArray();
            var employeeTimes = AdapterDb.Database.GetEmployeeTimes(employeeIds, clientToday, clientCurrentTime);
            var employeeData  = Mapper.Map <List <AdapterDb.EmployeeTimes>, List <EmployeeTimes> >(employeeTimes).ToList();

            var model = new AdminDashboard
            {
                BusinessData = aggregatedModel,
                UserList     = userList,
                EmployeeData = employeeData
            };

            return(View(model));
        }
Пример #16
0
        /// <summary>
        /// Nurse view select index change process
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void NurseListView_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.nurseListView.SelectedItems.Count == 0)
            {
                return;
            }
            AdminDashboard dashboard = this.ParentForm as AdminDashboard;

            dashboard.SelectedNurseID = int.Parse(this.nurseListView.SelectedItems[0].SubItems[0].Text);
            dashboard.RefreshTabs(sender, e);
        }
Пример #17
0
        private void Login()
        {
            if (string.IsNullOrWhiteSpace(txtUserName.Text))
            {
                MessageBox.Show("Username is required");
                return;
            }
            if (string.IsNullOrWhiteSpace(txtPassword.Text))
            {
                MessageBox.Show("password is required");
                return;
            }

            var loginrequest = new LoginRequestViewModel()
            {
                UserName = txtUserName.Text,
                Password = txtPassword.Text
            };
            var result = Services.UserService.Login(loginrequest);

            if (result.Status)
            {
                switch (result.Type)
                {
                case Common.UserType.Student:
                    StudentDashboard student = new StudentDashboard(result);
                    student.Show();
                    break;

                case Common.UserType.Teacher:
                    TeacherDashboard teacher = new TeacherDashboard(result);
                    teacher.Show();
                    break;

                case Common.UserType.Parent:
                    break;

                case Common.UserType.Admin:

                    AdminDashboard admin = new AdminDashboard(result);
                    admin.Show();
                    break;

                default:
                    break;
                }
                this.Hide();
            }
            else
            {
                MessageBox.Show(result.Message);
            }
        }
 public void NavbarTest()
 {
     adminDashboard = new AdminDashboard();
     if (adminDashboard.Logo.Enabled && adminDashboard.AdminName.Enabled)
     {
         adminDashboard.AdminName.Click();
         if (adminDashboard.EditProfile.Enabled && adminDashboard.AdminLogout.Enabled)
         {
             Console.WriteLine("Navigation bar is enabled in Admin's Dashboard");
         }
     }
 }
Пример #19
0
 public void ButtonClick(object sender, EventArgs e)
 {
     if (this.model.LoginValidation(this.view.UsernameBox.Text, this.view.PasswordBox.Text))
     {
         MVCForm.DisposeView(this.view);
         AdminDashboard           adminDashboard           = new AdminDashboard();
         AdminDashboardView       adminDashboardView       = new AdminDashboardView();
         AdminDashboardController adminDashboardController = new AdminDashboardController(adminDashboard, adminDashboardView, this.curForm);
         adminDashboardController.DisplayView();
         adminDashboardController.DisplayNavigation();
     }
 }
        public ActionResult Login(AdminDashboard admin)
        {
            AdminDashboard loginned = db.AdminDashboards.FirstOrDefault(u => u.Email == admin.Email);

            if (loginned != null)
            {
                if (Crypto.VerifyHashedPassword(loginned.Password, admin.Password))
                {
                    Session["loginned"] = true;
                    Session["usrid"]    = loginned.Id;
                    return(RedirectToAction("index", "users"));
                }
            }
            Session["LoginInvalid"] = true;
            return(RedirectToAction("index"));
        }
        private void btnLogin_Click(object sender, EventArgs e)
        {
            l.username  = txtUsername.Text.Trim();
            l.password  = txtPassword.Text.Trim();
            l.user_type = cmbUserType.Text.Trim();

            //Checking the login credentials
            bool success = dal.loginCheck(l);

            if (success == true)
            {
                MessageBox.Show("Login Successfull");
                loggedIn = l.username;

                //Need to open forms based on usertype
                switch (l.user_type)
                {
                case "Admin":
                {
                    AdminDashboard admin = new AdminDashboard();
                    admin.Show();
                    this.Hide();
                }
                break;

                case "User":
                {
                    UserDashboard user = new UserDashboard();
                    user.Show();
                    this.Hide();
                }
                break;

                default:
                {
                    MessageBox.Show("Invalid User Type");
                }
                break;
                }
            }
            else
            {
                MessageBox.Show("Login Failed.Try again");
            }
        }
Пример #22
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            l.username  = txtUsername.Text.Trim();
            l.password  = txtPassword.Text.Trim();
            l.user_type = cmbUserType.Text.Trim();

            bool success = dal.loginCheck(l);

            if (success == true)
            {
                MessageBox.Show("Login Successfull.");
                loggedIn = l.username;

                switch (l.user_type)
                {
                case "Admin":
                {
                    AdminDashboard admin = new AdminDashboard();
                    admin.Show();
                    this.Hide();
                }
                break;

                case "User":
                {
                    UserDashboard user = new UserDashboard();
                    user.Show();
                    this.Hide();
                }
                break;

                default:
                {
                    MessageBox.Show("Invalid user type!");
                }
                break;
                }
            }
            else
            {
                MessageBox.Show("Login failed. Try again!!");
            }
        }
Пример #23
0
        private void button1_Click(object sender, EventArgs e)
        {
            string user  = empusername.Text;
            string pass  = emppassword.Text;
            Regex  regex = new Regex(@"^([\w\.\-]+)@([\w\-]+)((\.(\w){2,3})+)$");

            using (SqlConnection con = new SqlConnection(connectionString))
            {
                con.Open();
                string query = "INSERT INTO EmployeeTable VALUES " +
                               "('" + userId + "', '" + department + "', '" + user + "', '" + pass + "');";
                SqlCommand cmd = new SqlCommand(query, con);
                cmd.ExecuteReader();
                addLoginDetails(userId, department, user, pass);
                this.Hide();
                AdminDashboard dashboard = new AdminDashboard();
                dashboard.Show();
            }
        }
Пример #24
0
        private void button1_Click(object sender, EventArgs e)
        {
            string connectionString = @"Data Source=(LocalDB)\MSSQLLocalDB;AttachDbFilename=C:\Users\14383\Downloads\BookBizz\BookBizz\Database1.mdf;Integrated Security=True";
            string fName            = firstname.Text;
            string lName            = lastname.Text;
            string number           = phone.Text;
            string mail             = email.Text;
            Regex  regex            = new Regex(@"^([\w\.\-]+)@([\w\-]+)((\.(\w){2,3})+)$");
            Match  match            = regex.Match(mail);

            if (number.Length < 10)
            {
                error.Visible     = true;
                errorCont.Visible = true;
                error.Text        = "Phone number is not valid";
            }
            else if (!match.Success)
            {
                error.Visible     = true;
                errorCont.Visible = true;
                error.Text        = "Email is not valid";
            }
            else
            {
                error.Visible     = false;
                errorCont.Visible = false;
                using (SqlConnection con = new SqlConnection(connectionString))
                {
                    con.Open();
                    string query = "INSERT INTO UserTable VALUES " +
                                   "('" + fName + "', '" + lName + "', " + number + ", '" + mail + "', 0)";
                    SqlCommand cmd = new SqlCommand(query, con);
                    cmd.ExecuteReader();
                    this.Hide();
                    AdminDashboard dashboard = new AdminDashboard();
                    dashboard.Show();
                }
            }
        }
Пример #25
0
        /// <summary>
        /// Load the control
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void ViewNurseUserControl_Load(object sender, EventArgs e)
        {
            try
            {
                AdminDashboard dashboard = this.ParentForm as AdminDashboard;
                this.nurseID = dashboard.SelectedNurseID;
            }
            catch (Exception)
            {
                //MessageBox.Show(ex.Message, ex.GetType().ToString());
            }

            try
            {
                stateList = this.healthController.GetAllStates();

                stateCodeComboBox.DataSource    = stateList;
                stateCodeComboBox.DisplayMember = "stateName";
                stateCodeComboBox.ValueMember   = "stateCode";
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message,
                                "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            if (this.nurseID != 0)
            {
                this.PopulateNurse();
                this.updateButton.Enabled = true;
                this.addButton.Enabled    = false;
            }
            else
            {
                this.updateButton.Enabled = false;
                this.addButton.Enabled    = true;
                this.ClearForm();
            }
        }
Пример #26
0
        private void loginbutton_Click(object sender, EventArgs e)
        {
            if (usernametextbox.Text == "admin" && passwordtextbox.Text == "admin")//ADMIN LOGIN
            {
                this.Hide();
                AdminDashboard con = new AdminDashboard();
                con.ShowDialog();
                this.Close();
            }
            else if (File.Exists(@"C:\Users\peter\Desktop\Final Product\4-9-2019\MySection\DataUsed\" + usernametextbox.Text + ".txt"))
            {
                string   passcheck;
                string[] lines;
                lines     = File.ReadAllLines(@"C:\Users\peter\Desktop\Final Product\4-9-2019\MySection\DataUsed\" + usernametextbox.Text + ".txt");
                passcheck = lines[3].Split(' ')[1];

                if (passcheck == passwordtextbox.Text)
                {
                    string temp     = @"C:\Users\peter\Desktop\Final Product\4-9-2019\MySection\DataUsed\" + usernametextbox.Text + ".txt";
                    String path     = @"C:\Users\peter\Desktop\Final Product\4-9-2019\MySection\DataUsed\" + usernametextbox.Text + @"\" + DateTime.Now.ToString("M.d.yyyy") + @".txt";
                    User   userdata = new User(temp);
                    this.Hide();
                    Dashboard con = new Dashboard(userdata, path);
                    con.ShowDialog();
                    this.Close();
                }
                else
                {
                    falselogin();
                }
            }

            else
            {
                falselogin();
            }
        }
Пример #27
0
        private void btn_login_Click(object sender, EventArgs e)



        {
            Hashtable htmastuser = new Hashtable();
            DataTable dtmstuser  = new DataTable();
            string    empCode    = txt_Emp_Code.Text.ToString().ToUpper();
            string    password   = txt_password.Text.ToString();

            htmastuser.Add("@Trans", "GET_USER_BY_EMP_CODE");
            htmastuser.Add("@DRN_Emp_Code", empCode);
            dtmstuser = Dataaccess.ExecuteSP("Sp_User", htmastuser);
            //empCode = txt_Emp_Code.Text.ToString();
            //password = txt_password.Text.ToString();
            if (dtmstuser.Rows.Count > 0)
            {
                if (string.IsNullOrEmpty(dtmstuser.Rows[0]["DRN_Emp_Code"].ToString()))
                {
                    txt_Emp_Code.Text = "";
                    txt_Emp_Code.Focus();
                    MessageBox.Show("User Does Not Exist");
                    return;
                }
                else
                {
                    Confirmusername = dtmstuser.Rows[0]["DRN_Emp_Code"].ToString().ToUpper();
                }
                ConfirmPassword      = dtmstuser.Rows[0]["Password"].ToString();
                Empname              = dtmstuser.Rows[0]["Employee_Name"].ToString();
                userid               = dtmstuser.Rows[0]["User_id"].ToString();
                USerRoleid           = dtmstuser.Rows[0]["User_RoleId"].ToString();
                Branch_id            = int.Parse(dtmstuser.Rows[0]["Branch_ID"].ToString());
                Application_Login_Id = dtmstuser.Rows[0]["Application_Login_Type"].ToString();
                //   last_login_datetime = dtmstuser.Rows[0]["Last_login"].ToString();
            }
            else
            {
                txt_Emp_Code.Text = "";
                txt_Emp_Code.Focus();
                // ScriptManager.RegisterClientScriptBlock(this, GetType(), "alert", "alert('Username Does Not Exist');", true);
                MessageBox.Show("Username Does Not Exist");
            }

            if (Confirmusername == empCode && ConfirmPassword == password)
            {
                SplashScreenManager.ShowForm(this, typeof(Ordermanagement_01.Masters.WaitForm1), true, true, false);

                try
                {
                    string userID = userid;

                    DataTable dt_Employee_Status = new DataTable();
                    Hashtable ht_Employee_Status = new Hashtable();
                    ht_Employee_Status.Add("@Trans", "Log_In_Present");
                    ht_Employee_Status.Add("@Presents", "True");
                    ht_Employee_Status.Add("@Employee_Id", userid);

                    dt_Employee_Status = Dataaccess.ExecuteSP("Sp_Employee_Status", ht_Employee_Status);
                    if (Application_Login_Id == "1")
                    {
                        AdminDashboard mainmenu = new AdminDashboard(USerRoleid, userid, Empname, password);

                        mainmenu.Show();
                    }
                    else if (Application_Login_Id == "2")
                    {
                        Tax.Tax_New_Dashboard taxdashboard = new Tax.Tax_New_Dashboard(USerRoleid, userid, Empname);
                        taxdashboard.Show();
                    }

                    Ordermanagement_01.Gen_Forms.Login loginfrm = new Ordermanagement_01.Gen_Forms.Login();

                    loginfrm.Close();
                    this.Hide();
                }
                catch (Exception ex)
                {
                    //Close Wait Form
                    SplashScreenManager.CloseForm(false);

                    MessageBox.Show("Error Occured Please Check With Administrator");
                }
                finally
                {
                    //Close Wait Form
                    SplashScreenManager.CloseForm(false);
                }
            }
            else
            {
                // ScriptManager.RegisterClientScriptBlock(this, GetType(), "alert", "alert('Wrong User Name or Password');", true);
                MessageBox.Show("Wrong User Name or Password");
            }


            //  Hashtable htuser = new Hashtable();
            //  DataTable dtuser = new DataTable();
            //  Username = txt_username.Text.ToString();
            //  password = txt_password.Text.ToString();
            //  htuser.Add("@Trans", "SELUSER");
            //  htuser.Add("@User_Name", Username);
            //  dtuser = Dataaccess.ExecuteSP("Sp_User", htuser);
            //  if (dtuser.Rows.Count > 0)
            //  {
            //      Confirmusername = dtuser.Rows[0]["User_Name"].ToString();
            //      userid = dtuser.Rows[0]["User_id"].ToString();
            //  }
            //  else
            //  {
            //      txt_username.Text = "";
            //      txt_username.Focus();
            //   //   ScriptManager.RegisterClientScriptBlock(this, GetType(), "alert", "alert('Username Does Not Exist');", true);
            //      MessageBox.Show("Username Does Not Exist");

            //  }



            //  Hashtable htpassword = new Hashtable();
            //  DataTable dtpassword = new DataTable();
            //  htpassword.Add("@Trans", "SELPASS");
            //  htpassword.Add("@User_Name", Username);
            //  htpassword.Add("@Password", password);
            //  htpassword.Add("@User_id", userid);

            //  dtpassword = Dataaccess.ExecuteSP("Sp_User", htpassword);
            //  if (dtpassword.Rows.Count > 0)
            //  {

            //      ConfirmPassword = dtpassword.Rows[0]["Password"].ToString();
            //      Userid = dtpassword.Rows[0]["User_id"].ToString();

            //  }
            //  else
            //  {


            //      txt_password.Text = "";
            //      txt_password.Focus();
            //   //   ScriptManager.RegisterClientScriptBlock(this, GetType(), "alert", "alert('Invalid Password');", true);
            //      MessageBox.Show("Invalid Password");
            //      return;
            //  }
            //  DataTable dt = new DataTable();
            //  Hashtable ht = new Hashtable();
            //  ht.Add("@Trans", "USERWISE");
            //  ht.Add("@User_id", Userid);
            ////  Session["userid"] = userid.ToString();
            //  dt = Dataaccess.ExecuteSP("Sp_User", ht);
            //  if (dt.Rows.Count > 0)
            //  {
            //      RollName = dt.Rows[0]["Role_Name"].ToString();
            //     // Session["Employee_Id"] = dt.Rows[0]["Employee_Id"].ToString();

            //  }
        }
Пример #28
0
        private void btnLogin_Click(object sender, EventArgs e)
        {
            #region Throw Error Message

            if (txtUsername.Text == "" && txtPassword.Text == "" && cmbUserType.Text == "")
            {
                MessageBox.Show(" Please Fill All The Details..... !! ");
            }

            else if (txtPassword.Text == "" && cmbUserType.Text == "")
            {
                MessageBox.Show(" Please Enter Passsword & Select UserType ... !! ");
            }

            else if (txtUsername.Text == "")
            {
                MessageBox.Show(" Please Enter Username.... !! ");
            }

            else if (txtPassword.Text == "")
            {
                MessageBox.Show(" Please Enter Password ... !! ");
            }

            else if (cmbUserType.Text == "")
            {
                MessageBox.Show(" Please Select Usertype ... !! ");
            }

            #endregion

            else
            {
                l.username  = txtUsername.Text.Trim();
                l.password  = txtPassword.Text.Trim();
                l.user_type = cmbUserType.Text.Trim();

                //Checking the login credentials
                bool success = dal.loginCheck(l);
                if (success == true)
                {
                    MessageBox.Show("Login Successfull");
                    loggedIn = l.username;

                    //Need to open forms based on usertype
                    switch (l.user_type)
                    {
                    case "Admin":
                    {
                        AdminDashboard admin = new AdminDashboard();
                        admin.Show();
                        this.Hide();
                    }
                    break;

                    case "User":
                    {
                        UserDashboard user = new UserDashboard();
                        user.Show();
                        this.Hide();
                    }
                    break;

                    default:
                    {
                        MessageBox.Show("Invalid User Type");
                    }
                    break;
                    }
                }
                else
                {
                    MessageBox.Show("Login Failed.Try again");
                }
            }
        }
Пример #29
0
        public IActionResult Index()
        {
            AdminDashboard model = _estadisticaAdminService.GetDashboard();

            return(View(model));
        }
Пример #30
0
        private void User_Access_Control_Load(object sender, EventArgs e)
        {
            grd_UserAccess.ColumnHeadersDefaultCellStyle.BackColor = System.Drawing.Color.DarkCyan;
            grd_UserAccess.EnableHeadersVisualStyles = false;
            AdminDashboard mainmenu = new AdminDashboard(User_Role_Id, userid.ToString(), username, Password);

            AddParent();
            foreach (ToolStripMenuItem mnu in mainmenu.MenuStrip.Items)
            {
                grd_UserAccess.Rows.Add();
                grd_UserAccess.Rows[i].Cells[1].Value = mnu.Text.ToUpper();

                i = i + 1;
            }
            foreach (ToolStripItem tsitem in mainmenu.ToolStrip1.Items)
            {
                if (tsitem.Text != "")
                {
                    grd_UserAccess.Rows.Add();
                    grd_UserAccess.Rows[i].Cells[1].Value = tsitem.Text.ToUpper();
                    i = i + 1;
                }
            }
            grd_UserAccess.Rows.Add();
            grd_UserAccess.Rows[i].Cells[1].Value = mainmenu.btn_reallocate.Text.ToUpper();
            i = i + 1;
            grd_UserAccess.Rows.Add();
            grd_UserAccess.Rows[i].Cells[1].Value = mainmenu.button2.Text.ToUpper();
            i = i + 1;
            foreach (Control ctrl in mainmenu.Gb_Processing.Controls)
            {
                grd_UserAccess.Rows.Add();
                if (ctrl.Text == "SEARCH")
                {
                    grd_UserAccess.Rows[i].Cells[1].Value = "Search Process";
                }
                else if (ctrl.Text == "SEARCH QC")
                {
                    grd_UserAccess.Rows[i].Cells[1].Value = "Search QC Process";
                }
                else if (ctrl.Text == "TYPING QC")
                {
                    grd_UserAccess.Rows[i].Cells[1].Value = "Typing QC Process";
                }
                else if (ctrl.Text == "TYPING")
                {
                    grd_UserAccess.Rows[i].Cells[1].Value = "Typing Process";
                }
                else if (ctrl.Text == "UPLOAD")
                {
                    grd_UserAccess.Rows[i].Cells[1].Value = "Upload Process";
                }
                else if (ctrl.Text == "ABSTRACTOR")
                {
                    grd_UserAccess.Rows[i].Cells[1].Value = "ABSTRACTOR";
                }

                else if (ctrl.Text == "FINAL QC")
                {
                    grd_UserAccess.Rows[i].Cells[1].Value = "Final Qc Process";
                }

                else if (ctrl.Text == "EXCEPTION")
                {
                    grd_UserAccess.Rows[i].Cells[1].Value = "Exception Process";
                }

                else if (ctrl.Text == "TAX")
                {
                    grd_UserAccess.Rows[i].Cells[1].Value = "Tax Process";
                }

                else if (ctrl.Text == "ERRORS")
                {
                    grd_UserAccess.Rows[i].Cells[1].Value = "Error Process";
                }

                i = i + 1;
            }
            foreach (Control ctrl in mainmenu.groupBox1.Controls)
            {
                grd_UserAccess.Rows.Add();
                if (ctrl.Text == "SEARCH")
                {
                    grd_UserAccess.Rows[i].Cells[1].Value = "Search Allocation";
                }
                else if (ctrl.Text == "SEARCH QC")
                {
                    grd_UserAccess.Rows[i].Cells[1].Value = "Search QC Allocation";
                }
                else if (ctrl.Text == "TYPING QC")
                {
                    grd_UserAccess.Rows[i].Cells[1].Value = "Typing QC Allocation";
                }
                else if (ctrl.Text == "TYPING")
                {
                    grd_UserAccess.Rows[i].Cells[1].Value = "Typing Allocation";
                }
                else if (ctrl.Text == "UPLOAD")
                {
                    grd_UserAccess.Rows[i].Cells[1].Value = "Upload Allocation";
                }
                else if (ctrl.Text == "FINAL QC")
                {
                    grd_UserAccess.Rows[i].Cells[1].Value = "Final Qc Allocation";
                }
                else if (ctrl.Text == "EXCEPTION")
                {
                    grd_UserAccess.Rows[i].Cells[1].Value = "Exception Allocation";
                }
                else if (ctrl.Text == "RE SEARCH")
                {
                    grd_UserAccess.Rows[i].Cells[1].Value = "Research Allocation";
                }
                else if (ctrl.Text == "TAX")
                {
                    grd_UserAccess.Rows[i].Cells[1].Value = "Tax Allocation";
                }
                i = i + 1;
            }
            foreach (Control ctrl in mainmenu.groupBox2.Controls)
            {
                grd_UserAccess.Rows.Add();
                grd_UserAccess.Rows[i].Cells[1].Value = ctrl.Text;
                i = i + 1;
            }
            grd_UserAccess.Rows.Add();
            grd_UserAccess.Rows[i].Cells[1].Value = mainmenu.group_Tax.Text;
            i = i + 1;
            //grd_UserAccess.Rows.Add();
            //grd_UserAccess.Rows[i].Cells[1].Value = mainmenu.dateTimePicker1.Text;
            //i = i + 1;
            grd_UserAccess.Rows.Add();
            grd_UserAccess.Rows[i].Cells[1].Value = mainmenu.btn_Chat.Text;
            i = i + 1;
            grd_UserAccess.Rows.Add();

            i = i + 1;
            grd_UserAccess.Rows.Add();
            grd_UserAccess.Rows[i].Cells[1].Value = mainmenu.btn_reallocate.Text;
            i = i + 1;

            for (int j = 0; j < grd_UserAccess.Rows.Count; j++)
            {
                if (grd_UserAccess.Rows[j].Cells[1].Value == null)
                {
                    grd_UserAccess.Rows.RemoveAt(j);
                }
            }
        }