//.method hidebysig static void LoadExecutngAssembly(string[] args) cil managed
        static void LoadExecutingAssembly(string[] args)
        {
            Logger.Init();

            //Logger.Trace("TODO: REMAKE ALL CONTAINSKEY [] - TO TRYGETVALUE");

            Settings m_Current = Settings.Default;

            //--------------- Init Commons ----------------------
            LocalCommons.Main.InitializeStruct(args);

            //------------- Controllers -------------------------
            Logger.Section("Controllers");
            GameServerController.LoadAvailableGameServers();

            //--------------- MySQL ---------------------------
            Logger.Section("MySQL");

            // Database
            ArcheageDb.Init(m_Current.DataBase_Host, m_Current.DataBase_User, m_Current.DataBase_Password, m_Current.DataBase_Name, m_Current.SSL, m_Current.PersistSecurityInfo);

            Database = new LoginDb();

            // Check if there are any updates
            CheckDatabaseUpdates();

            AccountHolder.LoadAccountData();

            //----------------Network ---------------------------
            Logger.Section("Network");
            PacketList.Initialize(Program.ServerClientVersion);
            new AsyncListener(m_Current.Main_IP, m_Current.Game_Port, defined: typeof(GameConnection));         //Waiting For GameServer Connections
            new AsyncListener(m_Current.Main_IP, m_Current.ArcheAge_Port, defined: typeof(ArcheAgeConnection)); //Waiting For ArcheAge Connections
        }
Example #2
0
        public Object GetPerson(int id)
        {
            Person p = new Person();

            p.Id = id;
            LoginDb logDb = new LoginDb();

            return(logDb.GetPerson(p));
        }
Example #3
0
        public Object Login(string UserName, string Password)
        {
            Person p = new Person();

            p.UserName = UserName;
            p.Password = Password;
            LoginDb logDb = new LoginDb();

            return(logDb.Login(p));
        }
Example #4
0
        public IActionResult Index([Bind] LoginDb ad)
        {
            int res = dbop.LoginCheck(ad);

            if (res == 1)
            {
                return(RedirectToAction("Varasto", "home"));
            }
            else
            {
                TempData["msg"] = "Username or password is incorrect.";
            }
            return(View());
        }
Example #5
0
 public ActionResult Login(LoginDb login)
 {
     using (HostelManagementSystemEntities7 db = new HostelManagementSystemEntities7())
     {
         var user = db.LoginDbs.SingleOrDefault(x => x.Email == login.Email);
         if (user != null)
         {
             if (user.Status == "Yes")
             {
                 if (user.Password == login.Password)
                 {
                     if (user.Designation == "Student")
                     {
                         return(RedirectToAction("Registration"));
                     }
                     if (user.Designation == "RT")
                     {
                         return(RedirectToAction("EmployeeRegistration"));
                     }
                     if (user.Designation == "Warden")
                     {
                         return(RedirectToAction("EmployeeRegistration"));
                     }
                     if (user.Designation == "SeniorWarden")
                     {
                         return(RedirectToAction("Registration"));
                     }
                     if (user.Designation == "MessEmployee")
                     {
                         return(RedirectToAction("Registration"));
                     }
                 }
                 else
                 {
                     ModelState.AddModelError("", "Email Or Password is InCorrect");
                 }
             }
             else
             {
                 ModelState.AddModelError("", "can,t login before approval of the request");
             }
         }
         else
         {
             ModelState.AddModelError("", "Register yourself First");
         }
     }
     return(View());
 }
Example #6
0
        public int LoginCheck(LoginDb ad)
        {
            SqlCommand com = new SqlCommand("Sp_login", con);

            com.CommandType = CommandType.StoredProcedure;
            com.Parameters.AddWithValue("@admin_id", ad.LoginName);
            com.Parameters.AddWithValue("@Password", ad.LoginPassword);
            SqlParameter oblogin = new SqlParameter();

            oblogin.ParameterName = "@Isvalid";
            oblogin.SqlDbType     = SqlDbType.Bit;
            oblogin.Direction     = ParameterDirection.Output;
            com.Parameters.Add(oblogin);
            con.Open();
            com.ExecuteNonQuery();
            int res = Convert.ToInt32(oblogin.Value);

            con.Close();
            return(res);
        }
Example #7
0
        public bool buscar(LoginDb datosLogin)
        {
            if (datosLogin.Usuario != "" || datosLogin.Contrasena != "")
            {
                var query = context.loginDbs.Where(x => x.Contrasena == datosLogin.Contrasena && x.Usuario ==
                                                   datosLogin.Usuario);
                if (query == null)
                {
                    return(false);
                }
            }

            else
            {
                return(false);
            }



            return(true);
        }
 public CandidateLogin()
 {
     InitializeComponent();
     logindbhelper     = new LoginDb();
     candidatedbhelper = new CandidateDb();
 }
 public static bool CheckUserCredentials(string username, string password)
 {
     return(LoginDb.IsCredentialsCorrect(username, password));
 }
Example #10
0
        public ActionResult Registration(StudentRegistrationViewModel reg)
        {
            try
            {
                bool flag = false;
                HostelManagementSystemEntities7 db = new HostelManagementSystemEntities7();
                foreach (StudentDb p in db.StudentDbs)
                {
                    if (p.Email == reg.Email)
                    {
                        flag = true;
                        ModelState.AddModelError("", "Email already exist");
                    }
                    if (p.CNIC == reg.CNIC)
                    {
                        flag = true;
                        ModelState.AddModelError("", "CNIC already exist");
                    }
                    if (p.RegNo == reg.RegNo)
                    {
                        flag = true;
                        ModelState.AddModelError("", "Invalid Registration Number");
                    }
                    if (flag == true)
                    {
                        break;
                    }
                }
                if (flag == true)
                {
                    return(View());
                }
                StudentDb s = new StudentDb();
                s.Address    = reg.Address;
                s.BloodGroup = reg.BloodGroup;
                s.CNIC       = reg.CNIC;
                s.Contact_   = reg.ContactNo;
                s.FatherName = reg.FatherName;
                s.Name       = reg.Name;
                s.DOB        = reg.DOB;
                s.RegNo      = reg.RegNo;
                s.Password   = reg.password;
                s.Email      = reg.Email;
                LoginDb l = new LoginDb();
                l.Email       = reg.Email;
                l.Password    = reg.password;
                l.Designation = "Student";
                l.Status      = "NO";
                db.LoginDbs.Add(l);
                db.StudentDbs.Add(s);
                db.SaveChanges();
                ModelState.Clear();


                return(RedirectToAction("login"));
            }
            catch (Exception e)
            {
                throw (e);
            }
        }
Example #11
0
        public ActionResult EmployeeRegistration(EmployeeRegistrationViewModel reg)
        {
            try

            {
                bool flag = false;
                HostelManagementSystemEntities7 db = new HostelManagementSystemEntities7();
                EmployeeDb s = new EmployeeDb();

                foreach (EmployeeDb e in db.EmployeeDbs)
                {
                    if (e.Email == reg.email)
                    {
                        flag = true;
                        ModelState.AddModelError("", "Email already exist");
                        if (e.CNIC == reg.CNIC)
                        {
                            flag = true;
                            ModelState.AddModelError("", "CNIC already exist");
                            break;
                        }
                        break;
                    }
                    if (e.CNIC == reg.CNIC)
                    {
                        flag = true;
                        ModelState.AddModelError("", "CNIC already exist");
                        break;
                    }
                }
                if (flag == true)
                {
                    return(View());
                }
                else
                {
                    s.Address    = reg.Address;
                    s.BloodGroup = reg.BloodGroup;
                    s.CNIC       = reg.CNIC;
                    s.ContactNo  = reg.ContactNo;
                    s.FatherName = reg.FatherName;
                    s.Name       = reg.Name;
                    s.DOB        = reg.DOB;
                    s.Password   = reg.password;
                    s.Email      = reg.email;


                    s.Designation = reg.Designation;

                    LoginDb l = new LoginDb();

                    l.Designation = reg.Designation;
                    l.Email       = reg.email;
                    l.Password    = reg.password;
                    l.Status      = "NO";
                    db.LoginDbs.Add(l);
                    db.EmployeeDbs.Add(s);
                    db.SaveChanges();
                    ModelState.Clear();
                    ViewBag.Message = "You are Registered Successfully";

                    return(RedirectToAction("login"));
                }
            }



            catch (Exception e)
            {
                throw (e);
            }
        }
Example #12
0
 public NucesJobAccountController()
 {
     logindbhelper     = new LoginDb();
     candidatedbhelper = new CandidateDb();
     employeedbhelper  = new EmployeeDb();
 }