Ejemplo n.º 1
0
 public void SaveBBSConfig(BBSConfig bbsConfig)
 {
     if (bbsConfig.Id == 0)
     {
         _bbsDataContext.BBSConfigs.Add(bbsConfig);
     }
     _bbsDataContext.SaveChanges();
 }
Ejemplo n.º 2
0
 public MainForm()
 {
     InitializeComponent();
     _dbConfigStr   = File.ReadAllText("BBSConfig.txt").Split('|')[1];
     _dataInterface = new DataInterface(_dbConfigStr);
     _formUtils     = new FormUtils(_dataInterface);
     _bbsConfig     = _dataInterface.GetBBSConfig();
     bbs_instances  = new List <BBS>();
 }
Ejemplo n.º 3
0
 public void ReturnValues(ref BBSConfig bbsConfig)
 {
     bbsConfig.BBS_Name      = ltbBBSName.EditText;
     bbsConfig.BBS_Port      = int.Parse(ltbBBSPort.EditText);
     bbsConfig.BBS_URL       = ltbBBSUrl.EditText;
     bbsConfig.SysOp_Email   = ltbSysOpEmail.EditText;
     bbsConfig.SysOp_Handle  = ltbSysOpHandle.EditText;
     bbsConfig.SysopMenuPass = ltbSysOpMenuPassword.EditText;
 }
Ejemplo n.º 4
0
 public void SetValues(BBSConfig bbsConfig)
 {
     ltbBBSName.EditText           = bbsConfig.BBS_Name;
     ltbBBSPort.EditText           = bbsConfig.BBS_Port.ToString();
     ltbBBSUrl.EditText            = bbsConfig.BBS_URL;
     ltbSysOpEmail.EditText        = bbsConfig.SysOp_Email;
     ltbSysOpHandle.EditText       = bbsConfig.SysOp_Handle;
     ltbSysOpMenuPassword.EditText = bbsConfig.SysopMenuPass;
 }
Ejemplo n.º 5
0
        private static void SetupBBS()
        {
            var  bbsConfig = _core.GetBBSConfig();
            User sysOpUser = null;

            if (bbsConfig == null)
            {
                bbsConfig = new BBSConfig();
                sysOpUser = new User();
            }
            else
            {
                sysOpUser = _core.GetUserById(bbsConfig.SysOpUserId);
                if (sysOpUser == null)
                {
                    sysOpUser = new User();
                }
            }

            sysOpUser.Username          = Input("Enter the SysOp's username", sysOpUser.Username);
            sysOpUser.HashedPassword    = Input("Enter the SysOp's password", sysOpUser.HashedPassword);
            sysOpUser.LastConnection    = DateTime.Now;
            sysOpUser.LastConnectionIP  = "localhost";
            sysOpUser.LastDisconnection = DateTime.Now.AddSeconds(1);
            sysOpUser.RealName          = Input("Enter the SysOp's real name", sysOpUser.RealName);
            sysOpUser.ComputerType      = Input("Enter the SysOp's main computer type", sysOpUser.ComputerType);
            sysOpUser.Email             = Input("Enter the SysOp's private email address", sysOpUser.Email);
            sysOpUser.WebPage           = Input("Enter the SYsOp's webpage address", sysOpUser.WebPage);

            sysOpUser = _core.SaveUser(sysOpUser);
            if (sysOpUser != null)
            {
                bbsConfig.SysOpUserId = sysOpUser.Id;


                bbsConfig.BBSName = Input("Enter the BBS name", bbsConfig.BBSName);
                bbsConfig.BBSUrl  = Input("Enter the BBS URL (no port)", bbsConfig.BBSUrl);

                var  Port         = "";
                bool portComplete = false;
                while (!portComplete)
                {
                    Port = Input("Enter the BBS port", bbsConfig.BBSPort.ToString());
                    if (int.TryParse(Port, out int intPort))
                    {
                        bbsConfig.BBSPort = intPort;
                        portComplete      = true;
                    }
                }
                bbsConfig.SysOpPublicHandle = Input("Enter the SysOp's public handle", bbsConfig.SysOpPublicHandle);
                bbsConfig.SysOpEmail        = Input("Enter the SysOp's public email address", bbsConfig.SysOpEmail);
                bbsConfig.SysOpMenuPassword = Input("Enter the password for the SysOp menu", bbsConfig.SysOpMenuPassword);
                _core.SaveBBSConfig(bbsConfig);
            }
        }
Ejemplo n.º 6
0
        public void SaveBBSConfig(BBSConfig bbsConfig)
        {
            var dataContext = GetDataContext();
            var bc          = dataContext.BBSConfigs.First(p => true);

            bc.BBS_Name      = bbsConfig.BBS_Name;
            bc.BBS_Port      = bbsConfig.BBS_Port;
            bc.BBS_URL       = bbsConfig.BBS_URL;
            bc.SysopMenuPass = bbsConfig.SysopMenuPass;
            bc.SysOp_Email   = bbsConfig.SysOp_Email;
            bc.SysOp_Handle  = bbsConfig.SysOp_Handle;
            dataContext.SubmitChanges();
        }
Ejemplo n.º 7
0
        public BBSConfig GetBBSConfig()
        {
            BBSConfig result = null;

            try
            {
                result = _bbsDataContext.BBSConfigs.FirstOrDefault(p => true);
            }
            catch (Exception ex)
            {
                LoggingAPI.Error("Exception: ", ex);
                result = null;
            }
            return(result);
        }
Ejemplo n.º 8
0
 public Main(BBS bbs, BBSDataCore bbsDataCore)
 {
     _bbs         = bbs;
     _bbsDataCore = bbsDataCore;
     _bbsConfig   = bbsDataCore.GetBBSConfig();
 }
Ejemplo n.º 9
0
 public Main(BBS bbs, DataInterface dataInterface)
 {
     _bbs           = bbs;
     _dataInterface = dataInterface;
     _bbsConfig     = _dataInterface.GetBBSConfig();
 }