public void LoginOut() { GetIniConfig(); InitialStatusBar(dataSet); InitailSqlConnection(dataSet); global = new Global(mainConnection); curFlowConfig = global.m_flowConfig; LoginForm loginForm = new LoginForm(mainConnection); if (loginForm.ShowDialog(this) == DialogResult.OK) { loginUserInfo.userBarCode = loginForm.strUserName; loginUserInfo.userID = global.GetUserIDInUserInfo(loginUserInfo.userBarCode); loginUserInfo.roleID = global.GetRoleID(loginUserInfo.userBarCode); if (global.IsFlowUser(loginUserInfo.userBarCode, curFlowConfig.flowName)) { global.InsertUserOperateRecord(loginUserInfo.userID, "登录", DateTime.Now.ToString(), toolStripStatusLabel8.Text, "成功"); toolStripStatusLabel4.Text = loginUserInfo.userBarCode; toolStripStatusLabel6.Text = DateTime.Now.ToString(); } else { global.InsertUserOperateRecord(loginUserInfo.userID, "登录", DateTime.Now.ToString(), curFlowConfig.flowName, "失败"); } loginForm.Dispose(); } else { global = new Global(mainConnection); LogoutForm logoutForm = new LogoutForm(); if (loginForm.ShowDialog(this) ==DialogResult.OK) { global.InsertUserOperateRecord(loginUserInfo.userID, "注销", DateTime.Now.ToString(), curFlowConfig.flowName, "成功"); CloseMdiForm(); mainConnection.Close(); } loginForm.Dispose(); } }
/// <summary> /// 初始化当前工序 /// </summary> public void InitFlowConfig(ref CurFlowConfig flowConfig) { DataSet ds = new DataSet(); ds.ReadXml("Config.xml"); flowConfig.flowName = ds.Tables["FlowConfig"].Rows[0]["CurrentFlow"].ToString(); flowConfig.flowProject_P = ds.Tables["FlowConfig"].Rows[0]["CurrentProject_P"].ToString(); flowConfig.flowProject_L = ds.Tables["FlowConfig"].Rows[0]["CurrentProject_L"].ToString(); flowConfig.flowProject_C = ds.Tables["FlowConfig"].Rows[0]["CurrentProject_C"].ToString(); flowConfig.flowProject_G = ds.Tables["FlowConfig"].Rows[0]["CurrentProject_G"].ToString(); flowConfig.flowProject_T = ds.Tables["FlowConfig"].Rows[0]["CurrentProject_T"].ToString(); flowConfig.flowProject_E = ds.Tables["FlowConfig"].Rows[0]["CurrentProject_E"].ToString(); flowConfig.flowProject_M = ds.Tables["FlowConfig"].Rows[0]["CurrentProject_M"].ToString(); flowConfig.debugItem_P = ds.Tables["DebugItemConfig"].Rows[0]["P_DebugItemConfig"].ToString(); flowConfig.debugItem_L = ds.Tables["DebugItemConfig"].Rows[0]["L_DebugItemConfig"].ToString(); flowConfig.debugItem_C = ds.Tables["DebugItemConfig"].Rows[0]["C_DebugItemConfig"].ToString(); flowConfig.debugItem_G = ds.Tables["DebugItemConfig"].Rows[0]["G_DebugItemConfig"].ToString(); flowConfig.debugItem_T = ds.Tables["DebugItemConfig"].Rows[0]["T_DebugItemConfig"].ToString(); flowConfig.debugItem_F = ds.Tables["DebugItemConfig"].Rows[0]["F_DebugItemConfig"].ToString(); flowConfig.flowID = GetFlowID(flowConfig.flowName); flowConfig.flowProjectID_P = GetFlowProjectID(flowConfig.flowProject_P); flowConfig.flowProjectID_L = GetFlowProjectID(flowConfig.flowProject_L); flowConfig.flowProjectID_C = GetFlowProjectID(flowConfig.flowProject_C); flowConfig.flowProjectID_G = GetFlowProjectID(flowConfig.flowProject_G); flowConfig.flowProjectID_T = GetFlowProjectID(flowConfig.flowProject_T); flowConfig.debugItemID_P = GetDebugItemProjectID(flowConfig.debugItem_P); flowConfig.debugItemID_L = GetDebugItemProjectID(flowConfig.debugItem_L); flowConfig.debugItemID_C = GetDebugItemProjectID(flowConfig.debugItem_C); flowConfig.debugItemID_G = GetDebugItemProjectID(flowConfig.debugItem_G); flowConfig.debugItemID_T = GetDebugItemProjectID(flowConfig.debugItem_T); flowConfig.debugItemID_F = GetDebugItemProjectID(flowConfig.debugItem_F); }