Пример #1
0
 private void button_IDDataSave_Click(object sender, EventArgs e)
 {
     TableToCommandData();
     FC.SaveData(commanddatas);
 }
Пример #2
0
        public void ThreadNewSequence(int nIndex, Boolean bSingle = false)
        {
            lock (lockObject)
            {
                string strID = GetDataGridSelectID(nIndex);
                Thread_Refresh.Suspend();
                logs.Format(strID + " 로그인 시작");

                int  nID  = -1;
                bool bRet = true;
                try
                {
                    eSeq_Login eSL      = eSeq_Login.LoginExecute;
                    string     strError = "Error!! : ";
                    while (eSL != eSeq_Login.LoginComplete)
                    {
                        switch (eSL)
                        {
                        case eSeq_Login.LoginExecute:
                            bRet = ExecuteProgram(ref nID);
                            break;

                        case eSeq_Login.LoginConnect:
                            bRet = ConnectProgram(nID);
                            break;

                        case eSeq_Login.LoginSelectServer:
                            bRet = SelectSeverProgram(nID);
                            break;

                        case eSeq_Login.LoginAgree:
                            bRet = AgreeProgram(nID);
                            break;

                        case eSeq_Login.LoginInputInfo:
                            bRet = InputInfoProgram(nIndex, nID);
                            break;

                        case eSeq_Login.LoginError:
                            throw new Exception(strError);
                        }
                        if (bRet == false)
                        {
                            strError += eSL.ToString();
                            eSL       = eSeq_Login.LoginError;
                            ProcessControl.KillProcess(nID);
                        }
                        else
                        {
                            eSL++;
                        }
                    }

                    if (eSL == eSeq_Login.LoginComplete)
                    {
                        IDDatas.getDataTable()[strID].nPID = nID;
                        DataTableToDicData();
                        FC.SaveData(IDDatas);

                        ProcessControl.MiniMizedProcess(nID);
                    }
                }
                catch (Exception e)
                {
                    ProcessControl.KillProcess(nID);
                    logs.Format(e.ToString());
                }
                finally
                {
                    logs.Format(strID + ": 로그인 " + ((bRet) ? "성공" : "실패"));
                }

                Thread_Refresh.Resume();
            }
        }