Example #1
0
        public string Login(string name, string password)
        {
            DataTable dt;
            string    codeName;

            using (CommandVirtualization command = new CommandVirtualization(SqlDepot.LoginUser()))
            {
                command.Parameters.Add("CodeName", name, null);
                command.Parameters.Add("Password", password, null);

                try
                {
                    dBVirtualizationOleDB.Execute(command, "User");
                    dt       = dBVirtualizationOleDB.Import("User");
                    codeName = dt.Rows[0]["CodeName"].ToString();
                    if ((null != codeName) && (0 < codeName.Trim().Length))
                    {
                        return(ConnectionsManager.addConnection(password));
                    }
                    return(null);
                }
                catch (Exception ex)
                {
                    Console.WriteLine($"Exception thrown{ex.Message}");
                }
                finally
                {
                    dBVirtualizationOleDB.ClearTableFromDataSet("User");
                }
            }
            return(null);
        }