protected override void Loading() { if (UserStatics.OptrType == "Test") { ctModeNo.Enabled = false; ctProductType.Enabled = false; } ctProductType.DataSource = CommonStatics.GetDict(UserStatics.OptrType, "适应产品"); ctProductType.DisplayMember = "Name"; ctWhoUninstalled.DataSource = BllTechnologicalEquipment.GetWhoRepairByWorkShop(UserStatics.OptrType, UserStatics.WorkShop); ctWhoUninstalled.DisplayMember = "Name"; ctTeHandle.DataSource = CommonStatics.GetDict(UserStatics.OptrType, "工装处理"); ctTeHandle.DisplayMember = "Name"; ctSupplier.DataSource = CommonStatics.GetDict(UserStatics.OptrType, "供应商"); ctSupplier.DisplayMember = "Name"; var obj = TechnologicalEquipment.FindById(long.Parse(ItemID)); FrmAddEditBindComboBoxText.BindObjectToControls(obj, tabPage1); ctUninstallDate.Value = UserStatics.GetSqlServerDateTime(); OwnTE = ctTeNo.Text; OwnWhoInstalled = ctWhoInstalled.Text; }
/// <summary> /// Adds the user to the gamescene and this handlers list. /// Adjusts the PressurePlates according to number of players in session. /// </summary> /// <param name="user_ref">User reference in session (a, b, c or d).</param> /// <param name="user_id">User identifier in database.</param> /// <param name="user_name">User name.</param> public void AddUser(string user_ref, int user_id, string user_name) { if (users.Count < 4) { GameObject usr = GameObject.Instantiate( userPrefab, new Vector3(0, 0, 0), Quaternion.Euler(0, 0, 0), gameObject.transform); usr.GetComponent <Rigidbody>().MovePosition(SoftwareModel.GetComponent <LevelBehaviour> ().GetStartPosition(users.Count)); usr.transform.localRotation = Quaternion.Euler(SoftwareModel.GetComponent <LevelBehaviour> ().GetStartRotation(users.Count)); // Alter name of GameObject for clarification between GameObjects. usr.name = "USER: "******" : " + user_name; pauseMenuController.GetComponent <PauseMenu> ().AddAnimator(usr.GetComponent <Animator> ()); } // Set the timeOut of PressurePlate according to number of players in game. PressurePlate.TimeOut = SoftwareModel.GetComponent <LevelBehaviour> ().GetPlateTimeOut(users.Count); }
protected override void InitData() { ActionTable = UserStatics.GetUserActions(ModuleId); string s = "Select * from v_EquipmentDee_Test_Daily where 日期 between '" + ctBegin.Value.ToString() + "' and '" + ctEnd.Value.ToString() + "' order by 日期 desc"; TableForLoad = DbEntry.Context.ExecuteDataset(s).Tables[0]; }
protected override void Loading() { ctAccepter2.DataSource = BllEquipmentRepairSecond.GetWhoRepairByWorkShop(UserStatics.OptrType, UserStatics.WorkShop); ctAccepter2.DisplayMember = "Name"; ctAssist2.DataSource = BllEquipmentRepairSecond.GetWhoRepairByWorkShop(UserStatics.OptrType, UserStatics.WorkShop); ctAssist2.DisplayMember = "Name"; ctResultConfirm.DataSource = CommonStatics.GetDict(UserStatics.OptrType, "效果确认"); ctResultConfirm.DisplayMember = "Name"; ctFailureType.DataSource = CommonStatics.GetDict(UserStatics.OptrType, "故障分类"); ctFailureType.DisplayMember = "Name"; ctProductHandle.DataSource = CommonStatics.GetDict(UserStatics.OptrType, "产品处理"); ctProductHandle.DisplayMember = "Name"; ctMonitor2.DataSource = BllEquipmentRepairSecond.GetRepairMonitorByWorkShop(UserStatics.OptrType, UserStatics.WorkShop); ctMonitor2.DisplayMember = "Name"; ctRestoreDate2.Value = UserStatics.GetSqlServerDateTime(); var obj = EquipmentMaintenance.FindById(long.Parse(ItemID)); FrmAddEditBindComboBoxText.BindObjectToControls(obj, tabPage1); }
protected override void Loading() { if (UserStatics.OptrType == "Test") { ctIsIsolated.Checked = false; ctIsIsolated.Enabled = false; ctRetestEquipment.DataSource = BllEquipmentProductHandle.GetEquipmentNo(UserStatics.OptrType); ctRetestEquipment.DisplayMember = "EquipmentNo"; } else { ctRetestEquipment.Enabled = false; } ctProductHandledConfirm.DataSource = CommonStatics.GetDict(UserStatics.OptrType, "处理确认"); ctProductHandledConfirm.DisplayMember = "Name"; ctWhoHandled.DataSource = BllEquipmentProductHandle.GetWhoHandledByWorkShop(UserStatics.OptrType, UserStatics.WorkShop); ctWhoHandled.DisplayMember = "Name"; var obj = EquipmentMaintenance.FindById(long.Parse(ItemID)); FrmAddEditBindComboBoxText.BindObjectToControls(obj, tabPage1); ctHandleDate.Value = UserStatics.GetSqlServerDateTime(); }
/// <summary> /// Navigates to LogInMenu and clears static user information. /// /// CALLBACK FUNCTION FOR TCP-Request. /// </summary> /// <param name="response">Response.</param> private void HandleLogout(string[][] response) { logInCanvas.SetActive(true); mainMenuCanvas.SetActive(false); UserStatics.SetUserInfo(0, -1, "", ""); }
protected override void Loading() { var obj = TechnologicalEquipment.FindById(long.Parse(ItemID)); FrmAddEditBindComboBoxText.BindObjectToControls(obj, tabPage1); ctUseCount.Value = BllTechnologicalEquipment.GetUseAmount(long.Parse(ItemID)); ctUninstallDate.Value = UserStatics.GetSqlServerDateTime(); }
public void MakeRequest() { string userId = UserStatics.GetUserId(0).ToString(); GameObject.Find(Constants.softwareModel).GetComponent <SoftwareModel>().netwRout.TCPRequest( SetSessionIdAndGoToLobby, new string[] { "req", "sessId", "userId" }, new string[] { "joinSession", sessionIDText.text, userId }); }
protected override void InitData() { lbFind.Text = "可以按机台号和工装编号模糊查找"; ActionTable = UserStatics.GetUserActions(ModuleId); if (UserStatics.OptrType == "Test") { TableForLoad = BllTechnologicalEquipment.GetTableTestSharpening(); } }
/// <summary> /// Updates the user. /// </summary> /// <param name="user_update">User update.</param> public void UpdateUser(UpdateData user_update) { for (int i = 0; i < users.Count; i++) { if (UserStatics.GetUserId(i) == user_update.Id) { users [i].UpdateData = user_update; } } }
protected override void Loading() { ctAcceptDate.Value = UserStatics.GetSqlServerDateTime(); var obj = EquipmentMaintenance.FindById(long.Parse(ItemID)); FrmAddEditBindComboBoxText.BindObjectToControls(obj, tabPage1); ctAccepter1.DataSource = BllEquipmentAccept.GetWhoRepairByWorkShop(UserStatics.OptrType, UserStatics.WorkShop); ctAccepter1.DisplayMember = "Name"; }
/// <summary> /// Handles the session start. Assigns the other users in the game-session to the respective GameObjects. /// /// Adds the plates to server and Starts socket, if none of the other users in the session has done so. /// /// CALLBACK FUNCTION FOR TCP-Request. /// </summary> /// <param name="response">Response.</param> private void HandleSessionStart(string[][] response) { string user_ref = ""; int user_id = 0; string user_name = ""; string sessionId = UserStatics.SessionId.ToString(); bool startedSocket = false; foreach (string[] pair in response) { // Check, if session is already in running state, otherwise start it. if (pair [0].Equals("state") && !(pair [1].Equals(Constants.sfRunning) || pair [1].Equals(Constants.sfStarting))) { startedSocket = true; string plateIds = ""; for (int i = 0; i < SoftwareModel.PlateContr.GetPlateCount(); i++) { plateIds += i + (i < SoftwareModel.PlateContr.GetPlateCount() - 1 ? "//" : ""); } SoftwareModel.netwRout.TCPRequest( CollectPlateIds, new string[] { "req", "sessionId", "plateIds" }, new string[] { "addPlatesToSession", sessionId, plateIds }); string userId = UserStatics.GetUserId(0).ToString(); SoftwareModel.netwRout.UDPRequest( NetworkRoutines.EmptyCallback, new string[] { "userId", "timer", "sessionId" }, new string[] { userId, levelTimer.ToString(), sessionId }); } else if (pair[0].Equals("ur")) { user_ref = pair[1]; } else if (pair[0].Equals("ui")) { int.TryParse(pair[1], out user_id); } else if (pair[0].Equals("un")) { user_name = pair[1]; SoftwareModel.userController.AddUser(user_ref, user_id, user_name); } } // Collect the plateIds, if the session was started by somebody else: if (!startedSocket) { CollectPlateIds(); } pauseMenu = GameObject.Find("PauseMenuController").GetComponent <PauseMenu> (); timerScript = GameObject.Find("TimerText").GetComponent <TimerScript> (); WorkOnSocket(); }
private void ctOptrType_Click(object sender, EventArgs e) { //除了All类型用户,其他用户直接显示它的类型 if (UserStatics.OptrType == "All") { ctOptrType.DataSource = UserStatics.GetUserTypes(UserStatics.OptrId); ctOptrType.DisplayMember = "Name"; } else { ctOptrType.Text = UserStatics.OptrType; } }
protected override void InitData() { lbFind.Text = "输入机台号任意尾数筛选"; ActionTable = UserStatics.GetUserActions(ModuleId); if (IsSelect == true) { TableForLoad = BllEquipmentInformation.GetPartTable(UserStatics.OptrType); } else { TableForLoad = BllEquipmentInformation.GetTable(UserStatics.OptrType); } }
protected override void Loading() { ctEquipmentNo.DataSource = BllEquipmentOffline.GetEquipmentNo(UserStatics.OptrType); ctEquipmentNo.DisplayMember = "EquipmentNo"; ctEquipmentType.DataSource = CommonStatics.GetDict(UserStatics.OptrType, "设备分类"); ctEquipmentType.DisplayMember = "Name"; ctWhoApplied.DataSource = BllEquipmentOffline.GetWhoNotice(UserStatics.OptrType); ctWhoApplied.DisplayMember = "Name"; ctOfflineDate.Value = UserStatics.GetSqlServerDateTime(); }
/// <summary> /// Sets up the socket. Takes the timer, that determines the lifetime of the socket /// and thus the time to complete the level. /// </summary> /// <param name="timer">Timer.</param> public void SetSocket(int timer) { levelTimer = timer; // Create the socket, that communicates with server. socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); string userId = UserStatics.GetUserId(0).ToString(); string sessionId = UserStatics.SessionId.ToString(); SoftwareModel.netwRout.TCPRequest( HandleSessionStart, new string[] { "req", "sessionId", "userId" }, new string[] { "startSession", sessionId, userId }); }
/// <summary> /// Updates the overview of the lobby and receives the signal to start the level per remote. /// /// CALLBACK FUNCTION FOR TCP-Request. /// </summary> /// <param name="response">Response.</param> private void UpdateView(string[][] response) { headline.text = "Wait for Players in Session " + UserStatics.SessionId.ToString(); string ret = ""; foreach (string[] pair in response) { if (pair [0].Equals("playerInSession")) { ret += pair [1]; } string pattern = @"//"; string[] usernames = Regex.Split(ret, pattern); for (int i = 0; i < usernames.Length; i++) { users [i].text = usernames [i]; users [i].fontStyle = FontStyle.Bold; if (UserStatics.GetUserName(UserStatics.IdSelf).Equals(usernames [i])) { users [i].color = Constants.userColor; } else if (usernames[i].Equals(Constants.noUser)) { users [i].text = Constants.freeUser; users [i].fontStyle = FontStyle.Normal; users [i].color = Constants.textColor; } else { users [i].color = Constants.textColor; } } if (pair [0].Equals(Constants.sfLevelindex)) { int levelindex = 0; int.TryParse(pair [1], out levelindex); currentLevelIndex = levelindex; AssignLevel(LevelConstants.GetLevel(levelindex)); } // Check if the session is ment to be started. if (pair [0].Equals(Constants.sfState) && pair [1].Equals(Constants.sfStarting)) { // Start the session. gameObject.GetComponent <StartSession> ().StartTheSession(); } } }
private void HandleLogin(string[][] response) { foreach (string[] pair in response) { if (pair[0].Equals("userId")) { int IdTmp = -1; int.TryParse(pair[1], out IdTmp); HideMenu(); UserStatics.SetUserLoggedIn(IdTmp, inputName.GetComponent <InputField> ().text); return; } } }
protected override void Loading() { if (!IsAdd) { ctOfflineResultConfirm.DataSource = CommonStatics.GetDict(UserStatics.OptrType, "离线效果确认"); ctOfflineResultConfirm.DisplayMember = "Name"; ctOfflineWhoRepaired.DataSource = BllEquipmentOffline.GetWhoNotice(UserStatics.OptrType); ctOfflineWhoRepaired.DisplayMember = "Name"; var obj = EquipmentOffline.FindById(long.Parse(ItemID)); FrmAddEditBindComboBoxText.BindObjectToControls(obj, tabPage1); ctOfflineRepairDate.Value = UserStatics.GetSqlServerDateTime(); } }
protected override void InitData() { ActionTable = UserStatics.GetUserActions(ModuleId); //BaseInfoCard bic = BaseInfoCard.New; //bic.JoinedDate = Convert.ToDateTime("2014-5-1 00:00:00"); //bic.CardNumber = "111"; //bic.ChildName = "test"; //bic.CardType = BaseInfoCardType.十次卡.ToString(); //bic.CountLeft = 0; //bic.ExpirationDate = Convert.ToDateTime("2015-5-1 00:00:00"); //bic.CardStatus = (int)BaseInfoCardStatus.使用; //bic.OptrType = UserStatics.OptrType; //bic.Save(); //if (IsSelect == true) // TableForLoad = BllBaseInfoCard.GetPartTable(UserStatics.OptrType); //else TableForLoad = BllBaseInfoCard.GetTable(UserStatics.OptrType); }
/*/// <summary> * /// Gets the identifier of the user in database. * /// </summary> * /// <returns>The identifier.</returns> * /// <param name="usr">Usr.</param> * public int GetIndex(User usr) { * * return users.IndexOf (usr); * }*/ /// <summary> /// Adds the user to the gamescene and this handlers list. /// </summary> /// <param name="user_ref">User reference in session (a, b, c or d).</param> /// <param name="user_id">User identifier in database.</param> /// <param name="user_name">User name.</param> public void AddUser(string user_ref, int user_id, string user_name) { if (users.Count < 4) { GameObject usr = GameObject.Instantiate( userPrefab, StartLevel_1.GetStartPosition(users.Count), Quaternion.Euler(0, 0, 0), gameObject.transform); users.Add(usr.GetComponent <User> ()); UserStatics.SetUserInfo(users.IndexOf(usr.GetComponent <User> ()), user_id, user_name, user_ref); if (UserStatics.IsMySelf(users.IndexOf(usr.GetComponent <User> ()))) { usr.GetComponent <User> ().IsPlayed = true; } usr.GetComponent <User>().userInfo.GetComponent <TextMesh>().text = user_ref + " : " + user_name; } }
protected override void Loading() { if (UserStatics.OptrType == "Test") { ctProcess.Enabled = false; ctModeNo.Enabled = false; ctTestSystem.DataSource = BllEquipmentNotice.GetEquipmentType(UserStatics.OptrType, "测试系统"); ctTestSystem.DisplayMember = "EquipmentNo"; ctTester.DataSource = BllEquipmentNotice.GetEquipmentType(UserStatics.OptrType, "测试仪"); ctTester.DisplayMember = "EquipmentNo"; //机台号每个工序都会不同 ctEquipmentNo.DataSource = BllEquipmentNotice.GetEquipmentNoByProcess(UserStatics.OptrType, "测试"); ctEquipmentNo.DisplayMember = "EquipmentNo"; ctWhoNotice.DataSource = BllEquipmentNotice.GetWhoNoticeByProcess(UserStatics.OptrType, UserStatics.WorkShop); ctWhoNotice.DisplayMember = "Name"; } if (UserStatics.OptrType == "Package" || UserStatics.OptrType == "Assembly") { ctTestSystem.Enabled = false; ctTester.Enabled = false; ctWhoNotice.DataSource = BllEquipmentNotice.GetWhoNoticeByProcess(UserStatics.OptrType, UserStatics.WorkShop); ctWhoNotice.DisplayMember = "Name"; } ctProcess.DataSource = CommonStatics.GetDict(UserStatics.OptrType, "工序"); ctProcess.DisplayMember = "Name"; ctManagementType.DataSource = CommonStatics.GetDict(UserStatics.OptrType, "管理分类"); ctManagementType.DisplayMember = "Name"; ctFailurePhenomenon.DataSource = CommonStatics.GetDict(UserStatics.OptrType, "故障现象"); ctFailurePhenomenon.DisplayMember = "Name"; ctNoticeDate.Value = UserStatics.GetSqlServerDateTime(); }
protected override void Loading() { ctDistrict.DataSource = CommonStatics.GetDict(UserStatics.OptrType, "区域"); ctDistrict.DisplayMember = "Name"; ctGroupMonitor.DataSource = BllAttendanceRate.GetGroupMonitorByWorkShop(UserStatics.OptrType, UserStatics.WorkShop); ctGroupMonitor.DisplayMember = "Name"; if (!IsAdd) { var obj = AttendanceRate.FindById(long.Parse(ItemID)); BindControlsDecimal.BindObjectToControls(obj, tabPage1); ReSetNumbericUpDownStatus(); } else { ctInputDate.Value = UserStatics.GetSqlServerDateTime(); } }
/// <summary> /// Updates the overview of the lobby and receives the signal to start the level per remote. /// </summary> /// <param name="response">Response.</param> private void UpdateView(string[][] response) { headline.text = "Wait for Players in Session " + UserStatics.SessionId.ToString(); //headline.text ="Wait for Players in Session " + GameObject.Find(Constants.softwareModel).GetComponent<SoftwareModel>().UserHandler.ThisUser.SsId.ToString(); string ret = ""; foreach (string[] pair in response) { if (pair [0].Equals("playerInSession")) { ret += pair [1]; } string pattern = @"//"; string[] usernames = Regex.Split(ret, pattern); for (int i = 0; i < usernames.Length; i++) { users [i].text = usernames [i]; users [i].fontStyle = FontStyle.Bold; if (UserStatics.GetUserName(UserStatics.IdSelf).Equals(usernames [i])) { users [i].color = Constants.userColor; } else if (usernames[i].Equals(Constants.noUser)) { users [i].text = Constants.freeUser; users [i].fontStyle = FontStyle.Normal; } else { users [i].color = Constants.defaultColor; } } // Check if the session is ment to be started. if (pair [0].Equals(Constants.sfState) && pair [1].Equals(Constants.sfStarting)) { // Start the session. gameObject.GetComponent <StartSession> ().LoadNewScene(); } } }
protected override void Saving() { if (IsAdd) { ctNoticeDate.Value = UserStatics.GetSqlServerDateTime(); var obj = EquipmentMaintenance.New; FrmAddEditBindComboBoxText.BindControlsToObject(obj, tabPage1); obj.OptrType = UserStatics.OptrType; obj.Status = EquipmentResult.已报修.ToString(); obj.WaitingTakes = 0; obj.RepairingTakes1 = 0; obj.RepairingTakes2 = 0; obj.IsIsolated = false; if (UserStatics.OptrType == "Test") { obj.Process = "测试"; } obj.Save(); } }
protected override void Loading() { if (UserStatics.OptrType == "Test") { ctModeNo.Enabled = false; ctProductType.Enabled = false; } ctProductType.DataSource = CommonStatics.GetDict(UserStatics.OptrType, "适应产品"); ctProductType.DisplayMember = "Name"; ctTechnologicalEquipmentType.DataSource = CommonStatics.GetDict(UserStatics.OptrType, "工装类型"); ctTechnologicalEquipmentType.DisplayMember = "Name"; ctWhoInstalled.DataSource = BllTechnologicalEquipment.GetWhoRepairByWorkShop(UserStatics.OptrType, UserStatics.WorkShop); ctWhoInstalled.DisplayMember = "Name"; ctWhoUninstalled.DataSource = BllTechnologicalEquipment.GetWhoRepairByWorkShop(UserStatics.OptrType, UserStatics.WorkShop); ctWhoUninstalled.DisplayMember = "Name"; ctInstallDate.Value = UserStatics.GetSqlServerDateTime(); ctTeHandle.Text = "在用"; }
protected override void AfterSave() { string message = "保存后是否继续新增?"; string caption = "提醒"; MessageBoxButtons buttons = MessageBoxButtons.YesNo; DialogResult result; result = MessageBox.Show(message, caption, buttons); if (result == System.Windows.Forms.DialogResult.Yes) { //遍历数值控件赋值和置0 ResetNumbericUpdown(); ReSetNumbericUpDownStatus(); ctDistrict.Focus(); //重置时间 ctInputDate.Value = UserStatics.GetSqlServerDateTime(); } else { this.Close(); } }
protected override void InitData() { ActionTable = UserStatics.GetUserActions(ModuleId); TableForLoad = BllEquipmentOffline.GetAllTable(UserStatics.OptrType); }
protected override void InitData() { ActionTable = UserStatics.GetUserActions(ModuleId); TableForLoad = BllEquipmentProductHandle.GetTable(UserStatics.OptrType); }
protected override void InitData() { ActionTable = UserStatics.GetUserActions(ModuleId); TableForLoad = BllBaseInfoMember.GetTable(UserStatics.OptrType); }