private void btnOK_Click(object sender, RoutedEventArgs e) { if (this.txtWorkerName.Text.Trim() == "") { MyMessageBox.ShowInfo("请填写服务工程师"); return; } if (this.myTimeServiceTime.ValueTime == null || this.myTimeServiceTime.ValueTime.IsNull) { MyMessageBox.ShowInfo("请填写服务时间"); return; } if (this.txtServiceContent.Text == "") { MyMessageBox.ShowInfo("请填写服务内容"); return; } UserRemoteHandleServiceRecord record = new UserRemoteHandleServiceRecord() { UserName = this.txtPlayerUserName.Text, WorkerName = this.txtWorkerName.Text.Trim(), ServiceTime = this.myTimeServiceTime.ValueTime, ServiceContent = this.txtServiceContent.Text }; InputActionPasswordWindow winInputActionPassword = new InputActionPasswordWindow(); if (winInputActionPassword.ShowDialog() == true) { AsyncHandlePlayerRemoteService(winInputActionPassword.ActionPassword, record.UserName, record.ServiceContent, record.ServiceTime, record.WorkerName); } }
public bool AddUserRemoteHandleServiceRecord(UserRemoteHandleServiceRecord record, CustomerMySqlTransaction myTrans) { MySqlCommand mycmd = null; try { mycmd = myTrans.CreateCommand(); string sqlText = "insert into userremotehandleservicerecord " + "(`UserID`, `ServiceTime`,`WorkerName`,`ServiceContent`,`AdminUserName`) " + " values (@UserID, @ServiceTime, @WorkerName,@ServiceContent,@AdminUserName)"; mycmd.CommandText = sqlText; mycmd.Parameters.AddWithValue("@UserID", record.UserID); mycmd.Parameters.AddWithValue("@ServiceTime", record.ServiceTime); mycmd.Parameters.AddWithValue("@WorkerName", DESEncrypt.EncryptDES(record.WorkerName)); mycmd.Parameters.AddWithValue("@ServiceContent", DESEncrypt.EncryptDES(record.ServiceContent)); mycmd.Parameters.AddWithValue("@AdminUserName", DESEncrypt.EncryptDES(record.AdminUserName)); mycmd.ExecuteNonQuery(); return(true); } finally { if (mycmd != null) { mycmd.Dispose(); } } }
public void UpdateRecord(UserRemoteHandleServiceRecord oldRecord) { this.Title = "修改远程协助服务记录"; this.txtPlayerUserName.Text = oldRecord.UserName; this.txtWorkerName.Text = oldRecord.WorkerName; this.myTimeServiceTime.ValueTime = oldRecord.ServiceTime; this.txtServiceContent.Text = oldRecord.ServiceContent; }
public int HandlePlayerRemoteService(string adminUserName, string playerUserName, string serviceContent, MyDateTime serviceTime, string engineerName) { var player = PlayerController.Instance.GetRunnable(playerUserName); if (player == null) { return(OperResult.RESULTCODE_USER_NOT_EXIST); } UserRemoteHandleServiceRecord record = new UserRemoteHandleServiceRecord() { AdminUserName = adminUserName, ServiceContent = serviceContent, ServiceTime = serviceTime, UserName = playerUserName, UserID = player.BasePlayer.SimpleInfo.UserID, WorkerName = engineerName }; int result = MyDBHelper.Instance.TransactionDataBaseOper(myTrans => { int innerResult = player.HandlePlayerRemoteService(serviceTime, myTrans); if (innerResult != OperResult.RESULTCODE_TRUE) { return(innerResult); } DBProvider.UserRemoteServerDBProvider.AddUserRemoteHandleServiceRecord(record, myTrans); return(OperResult.RESULTCODE_TRUE); }, exc => { if (exc != null) { LogHelper.Instance.AddErrorLog("HandlePlayerRemoteService Exception. adminUserName:"******";playerUserName:"******";serviceContent:" + serviceContent + ";serviceTime:" + serviceTime.ToString() + ";engineerName:" + engineerName, exc); } }); return(result); }
public UserRemoteHandleServiceRecordUIModel(UserRemoteHandleServiceRecord parent) { this.ParentObject = parent; }