Example #1
0
        private void btn_Click(object sender, EventArgs e)
        {
            api = new WebAPI();
            ht  = new Hashtable();
            ht.Add("spName", "AdminLogin");
            ht.Add("param", "");
            ArrayList list = api.Select(Program.serverUrl + "select", ht);

            ArrayList result = new ArrayList();
            JObject   jo     = (JObject)list[0];

            string id  = jo["MemberId"].ToString();
            string pwd = jo["MemberPassword"].ToString();

            //MessageBox.Show(id +" : "+ pwd);

            if (id == txt_login.Text && pwd == txt_pwd.Text)
            {
                targetForm = new ManageForm();
                this.parentForm.Hide();
                targetForm.StartPosition = FormStartPosition.CenterParent;
                targetForm.Show();
            }
            else
            {
                MessageBox.Show("아이디와 비밀번호를 확인해주세요 ");
            }
        }
Example #2
0
 private static void Main()
 {
     try
     {
         Process instance = RunningInstance();
         if (instance == null)
         {
             RegistryKey key = Registry.CurrentUser.CreateSubKey(@"Software\Microsoft\Internet Explorer\Styles");
             key.SetValue("MaxScriptStatements", 0x3b9aca00);
             key.Close();
             key = null;
             Application.EnableVisualStyles();
             Application.SetCompatibleTextRenderingDefault(false);
             ManageForm mainForm = new ManageForm();
             Application.Run(mainForm);
         }
         else
         {
             HandleRunningInstance(instance);
         }
     }
     catch
     {
     }
 }
 private void CreateAccountForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     if (this._parent != null)
     {
         this._parent.CreateAccountForm = null;
         this._parent = null;
     }
 }
        private void button3_Click(object sender, EventArgs e)
        {
            ManageForm Reg = new ManageForm();

            this.Hide();
            Reg.Owner = this;
            //让新建的窗口不在任务栏显示并显示新窗口
            Reg.ShowDialog();
            //新建的窗口关闭后,再使原窗口可见
            this.Show();
        }
Example #5
0
        public void Init(ManageForm parent, string tipText, int interval, bool displayNow, ButtonClickDelegate buttonOKClick, ButtonClickDelegate buttonCancleClick)
        {
            TimeSpan span = (TimeSpan)(DateTime.Now - this._closeTime);

            if ((span.TotalSeconds >= 30.0) || displayNow)
            {
                this._closeTime         = DateTime.Now;
                this._parent            = parent;
                this.labelText.Text     = tipText;
                this._buttonOKClick     = buttonOKClick;
                this._buttonCancleClick = buttonCancleClick;
                if (interval > 0)
                {
                    this._messageFormTimer.Tick    += new EventHandler(this.MessageFormThreadFunc);
                    this._messageFormTimer.Interval = interval * 0x3e8;
                    this._messageFormTimer.Enabled  = true;
                }
                base.Visible = true;
            }
        }
 public CreateAccountForm(ManageForm parent)
 {
     this._parent = parent;
     this.InitializeComponent();
 }
Example #7
0
 private void ChangeUserForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     this._parent.ChangeUserForm = null;
     this._parent = null;
 }
Example #8
0
 public ChangeUserForm(ManageForm parent)
 {
     this._parent = parent;
     this.InitializeComponent();
 }
Example #9
0
 private void MessageForm_FormClosing(object sender, FormClosingEventArgs e)
 {
     this.buttonCancle_Click(null, null);
     this._parent = null;
 }
Example #10
0
 public adminF(ManageForm manage)
 {
     InitializeComponent();
     this.MdiParent = manage;
 }
Example #11
0
        /// <summary>
        /// Write error into file and on screen if configured.
        /// </summary>
        /// <param name="Message">Message to write</param>
        public void WriteError(string Message)
        {
            _mutexFileError.WaitOne();

            // add additional information to the message
            string CompleteMessage = DateTime.Now.ToString("[dd-MM-yyyy @ HH:mm:ss] ");

            CompleteMessage += Message;

            if (LogOnFile == true)
            {
                ManageForm.AddElementInMainLog(CompleteMessage);

                if (File.Exists(_fileNameError) == true)
                {
                    FileInfo fileInfo = new FileInfo(_fileNameError);

                    if (Global.ConfigValue.LogFiles.MaxSizeError == 0)
                    {
                        OpenFileError();
                        if (_isReadyError)
                        {
                            _streamError.WriteLine(CompleteMessage);
                        }
                        else
                        {
                            WriteError(string.Format("Unable to write in {0} file", _fileNameError));
                        }
                        CloseFileError();
                    }

                    else if (fileInfo.Length < Global.ConfigValue.LogFiles.MaxSizeError)
                    {
                        OpenFileError();
                        if (_isReadyError)
                        {
                            if (fileInfo.Length + CompleteMessage.Length < Global.ConfigValue.LogFiles.MaxSizeError)
                            {
                                _streamError.WriteLine(CompleteMessage);
                            }
                            else
                            {
                                _streamError.WriteLine(CompleteMessage.Substring(0, (int)(Global.ConfigValue.LogFiles.MaxSizeError - (int)fileInfo.Length)));
                            }
                        }
                        else
                        {
                            WriteError(string.Format("Unable to write in {0} file", _fileNameError));
                        }
                        CloseFileError();
                    }
                    else
                    {
                        if (_isOverflowErrorWritten == false)
                        {
                            _eventLog.WriteEntry(string.Format("Unable to write in the error logfile '{0}'.\nThe maximum size ({1}) has been reached.", _fileNameError, Global.ConfigValue.LogFiles.MaxSizeError), EventLogEntryType.Error);
                            _isOverflowErrorWritten = true;
                        }
                    }
                }
                else
                {
                    OpenFileError();
                    if (_isReadyError)
                    {
                        _streamError.WriteLine(CompleteMessage);
                    }
                    else
                    {
                        WriteError(string.Format("Unable to write in {0} file", _fileNameError));
                    }
                    CloseFileError();
                }
            }

            if (LogOnScreen == true)
            {
                Console.WriteLine(CompleteMessage);
            }

            _mutexFileError.ReleaseMutex();
        }