private void Button_Click(object sender, RoutedEventArgs e) { try { if (LBStatus.Text == "Invalid") { //send to repair button string repairCondition = ("Servicing, Reason: " + TBCondition.Text); TBikeDAL MyDAL = new TBikeDAL(); ConfirmWindow confirm = new ConfirmWindow(ImageType.Question, "Confirmation", "Are you sure to send this to Service? ", "Yes", "No"); confirm.ShowDialog(); if (confirm.Confirmed) { MyDAL.UpdateBikeStatus(CBBicycle.SelectedValue.ToString().Trim(), "", "M", repairCondition.Trim(), PickStart.SelectedDate, PickEnd.SelectedDate, TLUsername.Text); PopWindow pop = new PopWindow(ImageType.Information, "Done", "Bicycle Send for Service", "OK"); pop.ShowDialog(); } BindComboBoxBicycle(CBBicycle); } } catch (Exception ex) { PopWindow pop = new PopWindow(ImageType.Error, "Error", ex.Message, "OK"); pop.ShowDialog(); } }
private void BTNUpdate_Click(object sender, RoutedEventArgs e) { try { TBikeDAL MyDAL = new TBikeDAL(); username = LBUsername.Text; ConfirmWindow com = new ConfirmWindow(ImageType.Error, "Update", "Are you sure to modify these changes?", "Yes", "No"); com.ShowDialog(); if (com.Confirmed) { MyDAL.UpdateEmployee(LBEmployeeID.Text, LBEmployeeName.Text, Convert.ToDateTime(LBDob.Text), LBUsername.Text, LBEmployeeRankDesc.Text, LBEmail.Text, LBPhoneNo.Text, LBCity.Text, TLUsername.Text); DataTable ResultTable = MyDAL.SelectEmployeeByEmployeeID(LBEmployeeID.Text); LBEmployeeName.Text = Convert.ToString(ResultTable.Rows[0]["EmployeeName"]).Trim(); LBEmployeeRankDesc.Text = Convert.ToString(ResultTable.Rows[0]["EmployeeRankDesc"]).Trim(); LBUsername.Text = Convert.ToString(ResultTable.Rows[0]["Username"]).Trim(); LBEmail.Text = Convert.ToString(ResultTable.Rows[0]["Email"]).Trim(); LBDob.Text = Convert.ToString(ResultTable.Rows[0]["DateOfBirth"]).Trim(); LBPhoneNo.Text = Convert.ToString(ResultTable.Rows[0]["PhoneNo"]).Trim(); LBCity.Text = Convert.ToString(ResultTable.Rows[0]["Address"]).Trim(); LBLastLogin.Text = Convert.ToString(ResultTable.Rows[0]["LastLoginTime"]).Trim(); PopulateDataFromLogin(username); } } catch (Exception ex) { PopWindow pop = new PopWindow(ImageType.Error, "Error", ex.Message, "OK"); pop.ShowDialog(); } }
//----------------------------------------------------------------------------------------------------- private void thumbPanel_OnItemDoubleClick(object sender, EventArgs e) { PictureListItem item = (PictureListItem)sender; string file = item.Tag.ToString(); if (!File.Exists(file)) { return; } string dir = Path.GetDirectoryName(file); string category = dir.Substring(dir.LastIndexOf("\\") + 1); frmPassword frm = new frmPassword(category, file); if (frm.ShowDialog() == DialogResult.OK) { if (frm.IsPasswordValid) { PlayVideo(category, Path.GetFileName(file), frm.Password); } else { PopWindow.Warnning("密码不正确,请重新输入!"); } } }
public void PopWindow(PopWindow wd) { try { Console.WriteLine(wd.ToYDSdkJsonString()); var cipherText = m_crypto.Encrypt(AESCrypto.ToBytes(wd.ToYDSdkJsonString())); var param = new Dictionary <string, object>() { { "app_id", m_appId }, { "msg_encrypt", cipherText } }; var client = new HttpClient(); var rsp = client.Post(this.apiPopWindow(), param, HttpContentTypes.ApplicationJson); Helper.CheckHttpStatus(rsp); var body = rsp.StaticBody <Dictionary <string, object> >(overrideContentType: HttpContentTypes.ApplicationJson); Helper.CheckApiStatus(body); } catch (WebException e) { throw new HttpRequestException(0, e.Message, e); } catch (Exception e) { if (e is GeneralEntAppException) { throw e; } else { throw new UnexpectedException(e.Message, e); } } }
//----------------------------------------------------------------------------------------------------- private void mDecrypt_Click(object sender, EventArgs e) { if (selectPic == null) { return; } string file = selectPic.Tag.ToString(); if (!File.Exists(file)) { return; } string dir = Path.GetDirectoryName(file); string category = dir.Substring(dir.LastIndexOf("\\") + 1); frmPassword frm = new frmPassword(category, file); if (frm.ShowDialog() == DialogResult.OK) { if (frm.IsPasswordValid) { // 视频解密 } else { PopWindow.Warnning("密码不正确,请重新输入!"); } } }
private void Button_Click(object sender, RoutedEventArgs e) { //the next button if (TBCustomer.Text != null && CBBicycle.SelectedValue != null) { stack1.Visibility = Visibility.Visible; LBCustomer.Text = TBCustomer.Text; LBBike.Text = CBBicycle.Text; LBBookingDate.Text = Convert.ToString(DateTime.Now); LBCustomer.Visibility = Visibility.Visible; LBBike.Visibility = Visibility.Visible; LBBookingDate.Visibility = Visibility.Visible; rect.Visibility = Visibility.Visible; TBRemarks.Visibility = Visibility.Visible; LB1.Visibility = Visibility.Visible; LB2.Visibility = Visibility.Visible; LB3.Visibility = Visibility.Visible; } else { PopWindow pop = new PopWindow(ImageType.Error, "Error", "Please Fill in all blanks", "OK"); pop.ShowDialog(); } }
private void frmEncrypt_OnFinished() { Logger.Info("--加密完成--"); Invoke(new Action(() => { btnEncrypt.Enabled = true; btnCancle.Enabled = false; panel1.Enabled = true; PopWindow.Information("视频加密完成!", "系统提示", this); if (chkDelete.Checked) { string msg = string.Format("是否要删除【{0}】?", Path.GetFileName(txtFileName.Text)); if (PopWindow.Question(msg, "系统提示", this) == DialogResult.Yes) { try { File.Delete(txtFileName.Text); } catch { } } } if (OnNewVideo != null) { OnNewVideo(txtFileName.Text, TargetFile); } })); }
private void BTNPromote_Click(object sender, RoutedEventArgs e) { TBikeDAL MyDAL = new TBikeDAL(); DataTable ResultTable = MyDAL.SelectEmployeeByEmployeeID(LBEmployeeID.Text); Rank = Convert.ToInt32(ResultTable.Rows[0]["EmployeeRank"]); try { if (RankID > Rank) { ConfirmWindow com = new ConfirmWindow(ImageType.Question, "Confirm?", "Are you sure to Promote " + LBEmployeeName.Text + " ?", "Yes", "No"); com.ShowDialog(); if (com.Confirmed) { MyDAL.UpdateEmployeePromotion(LBEmployeeID.Text, Rank + 1, TLUsername.Text); ResultTable = MyDAL.SelectEmployeeByEmployeeID(LBEmployeeID.Text); LBEmployeeRankDesc.Text = Convert.ToString(ResultTable.Rows[0]["EmployeeRankDesc"]); } } else { ConfirmWindow com = new ConfirmWindow(ImageType.Error, "Error", "Cant Promote Rank Higher than self", "Ok", "Cancel"); com.ShowDialog(); } } catch (Exception ex) { PopWindow pop = new PopWindow(ImageType.Error, "Error", Convert.ToString(ex).Trim(), "OK"); pop.ShowDialog(); } }
private void MyStartupBackgroundWorker_DoWork(object sender, DoWorkEventArgs e) { MyStartupBackgroundWorker.ReportProgress(5, "Checking SQL server ...."); System.Threading.Thread.Sleep(50); MyStartupBackgroundWorker.ReportProgress(15, "Checking Table Mode ...."); System.Threading.Thread.Sleep(50); MyStartupBackgroundWorker.ReportProgress(20, "Checking SQL for table ...."); try { System.Threading.Thread.Sleep(50); MyStartupBackgroundWorker.ReportProgress(30, "Service started ...."); System.Threading.Thread.Sleep(50); MyStartupBackgroundWorker.ReportProgress(40, "Service Running ...."); System.Threading.Thread.Sleep(150); MyStartupBackgroundWorker.ReportProgress(50, "Service Done"); System.Threading.Thread.Sleep(50); MyStartupBackgroundWorker.ReportProgress(60, "Found Data !!!!"); System.Threading.Thread.Sleep(50); MyStartupBackgroundWorker.ReportProgress(70, "Input Data to Grid ...."); System.Threading.Thread.Sleep(50); MyStartupBackgroundWorker.ReportProgress(80, "DataGrid Sorting ...."); System.Threading.Thread.Sleep(50); MyStartupBackgroundWorker.ReportProgress(90, "Showing DataGrid ...."); System.Threading.Thread.Sleep(50); MyStartupBackgroundWorker.ReportProgress(100, "Completed !!!!"); } catch (Exception ex) { System.Threading.Thread.Sleep(50); MyStartupBackgroundWorker.ReportProgress(100, "Unhandled Exception Occured: " + ex.Message); PopWindow pop = new PopWindow(ImageType.Error, "Error SQL", ex.Message, "OK"); pop.ShowDialog(); } }
public void ShowPop() { showpop = true; PopWindow.activeSelf = true; PopWindow.SetSiblingIndex(10000); Refresh(0, Point); }
protected T ShowPopWindow <T>(object obj = null, ModelElement parent = null) where T : PopWindow, new() { if (mask != null) { mask.gameObject.SetActive(true); } if (currentPop != null) { currentPop.Hide(); currentPop = null; } for (int i = 0; i < pops.Count; i++) { if (pops[i] is T) { currentPop = pops[i]; pops[i].Show(obj); return(pops[i] as T); } } var t = new T(); pops.Add(t); currentPop = t; if (parent == null) { t.Initial(Parent, this, obj); } else { t.Initial(parent, this, obj); } t.ReSize(); return(t); }
private void BTNsearch_Click(object sender, RoutedEventArgs e) { if (CBMode.SelectedValue.ToString().Trim() == "Employee") { if (RankID >= 3) { initializeWorker(); } else { PopWindow pop = new PopWindow(ImageType.Warning, "Rank too low", "Sorry You do not have access to this feature", "Ok"); pop.ShowDialog(); } } if (CBMode.SelectedValue.ToString().Trim() == "Snacks" || CBMode.SelectedValue.ToString().Trim() == "Bicycle" && CBMode.SelectedValue.ToString().Trim() != "Empoyee") { if (RankID >= 2) { initializeWorker(); } else { PopWindow pop = new PopWindow(ImageType.Warning, "Rank too low", "Sorry You do not have access to this feature", "Ok"); pop.ShowDialog(); } } else if (CBMode.SelectedValue.ToString().Trim() != "Employee") { initializeWorker(); } }
private void BTNAddon_Click(object sender, RoutedEventArgs e) { try { if (ListBooking.SelectedIndex >= 0) { TBikeDAL MyDAl = new TBikeDAL(); DataTable ResultTable = MyDAl.SelectSnackSalesByBookIDCustomer(TBBookID.Text.Trim(), TBCustomer.Text.Trim()); if (ResultTable.Rows.Count > 0) { PopWindow pop = new PopWindow(ImageType.Information, "Addon Details", "Item :" + Convert.ToString(ResultTable.Rows[0]["SnackName"]).Trim() + " , Quantity :" + Convert.ToInt32(ResultTable.Rows[0]["Quantity"]) + " , Total Price :" + Convert.ToDouble(ResultTable.Rows[0]["TotalPrice"]), "OK"); pop.ShowDialog(); } else { PopWindow pop = new PopWindow(ImageType.Warning, "No Detail", "No Data Found for this booking", "OK"); pop.ShowDialog(); } } else { PopWindow pop = new PopWindow(ImageType.Warning, "No Data..", "Please Select a List", "OK"); pop.ShowDialog(); } } catch (Exception ex) { PopWindow pop = new PopWindow(ImageType.Error, "Error", "Error: " + ex.Message, "OK"); pop.ShowDialog(); } }
public void LinkToEmployee() { TBikeDAL MyDAL = new TBikeDAL(); int index = dataGrid1.Items.IndexOf(dataGrid1.CurrentItem); DataTable ResultTable = MyDAL.ShowAllEmployeeDetails(); if (index == -1) { index = 0; } else { string id = Convert.ToString(ResultTable.Rows[index]["EmployeeID"]); string self = Convert.ToString(ResultTable.Rows[index]["Username"]); if (id != null) { if (RankID >= 4 || self == username) { EmployeeModify emp = new EmployeeModify(); emp.PopulateDataFromLogin(username); emp.populateEmployee(id); emp.ShowDialog(); } else { PopWindow pop = new PopWindow(ImageType.Warning, "Error", "Rank too low to access this service", "Alright"); pop.ShowDialog(); } } } }
protected T ShowPopWindow <T>(object obj = null, Transform parent = null) where T : PopWindow, new() { if (currentPop != null) { currentPop.Hide(); currentPop = null; } for (int i = 0; i < pops.Count; i++) { if (pops[i] is T) { currentPop = pops[i]; pops[i].Show(obj); return(pops[i] as T); } } var t = new T(); pops.Add(t); currentPop = t; if (parent == null) { t.Initial(Parent, this, obj); } else { t.Initial(parent, this, obj); } t.ReSize(); return(t); }
private void BtnDelete_Click(object sender, RoutedEventArgs e) { if (LBTitle.Text == "Bicycle") { TBikeDAL MyDAL = new TBikeDAL(); ConfirmWindow confirm = new ConfirmWindow(ImageType.Question, "Delete?", "Are you sure to delete this bicycle?", "Yes", "No! Turn Back!"); if (confirm.Confirmed) { MyDAL.DeleteBicycleByID(LBID.Text); PopulateBikeDataTable(); PopWindow pop = new PopWindow(ImageType.Information, "Bicycle Deleted", "Bicycle: " + LBName.Text + " Has been Deleted By " + TLUsername.Text, "Okay"); pop.ShowDialog(); } } else if (LBTitle.Text == "Snacks") { TBikeDAL MyDAL = new TBikeDAL(); ConfirmWindow confirm = new ConfirmWindow(ImageType.Question, "Delete?", "Are you sure to delete this Snack?", "Yes", "No! Turn Back!"); if (confirm.Confirmed) { MyDAL.DeleteSnackByID(LBID.Text); PopulateBikeDataTable(); PopWindow pop = new PopWindow(ImageType.Information, "Snack Deleted", "Snack: " + LBName.Text + " Has been Deleted By " + TLUsername.Text, "Okay"); pop.ShowDialog(); } } }
private void Button_Click(object sender, RoutedEventArgs e) { try { //button for creating new employee string Address; TBikeDAL MyDal = new TBikeDAL(); //String Builder StringBuilder striBuild = new StringBuilder(); striBuild.AppendLine(TBAddress1.Text); striBuild.AppendLine(TBAddress2.Text); striBuild.AppendLine(TBAddress3.Text); striBuild.Append(TBCity.Text); striBuild.Append(" , " + TBZipCode.Text); Address = striBuild.ToString().Trim(); MyDal.AddNewEmployeeDetails(TBEmpName.Text, DOBText.SelectedDate.Value.Date, TBEmail.Text, TBPhoneNo.Text, Address, "Tommy"); CreateNewUser emp = new CreateNewUser(); this.Close(); emp.PopulateDataFromLogin(username); emp.Show(); PopWindow pop = new PopWindow(ImageType.Information, "Congratulations", "Create New User Success!!!", "OK"); } catch (Exception ex) { PopWindow pop = new PopWindow(ImageType.Error, "Error", ex.Message, "OK"); pop.ShowDialog(); } }
public void ShowPop() { showpop = true; PopWindow.SetActive(true); PopWindow.transform.SetAsLastSibling(); Refresh(0, Point); }
protected object ShowPopWindow(Type type, object obj = null, ModelElement parent = null) { if (mask != null) { mask.gameObject.SetActive(true); } if (currentPop != null) { currentPop.Hide(); currentPop = null; } for (int i = 0; i < pops.Count; i++) { if (pops[i].GetType() == type) { currentPop = pops[i]; pops[i].Show(obj); return(pops[i]); } } var t = Activator.CreateInstance(type) as PopWindow; pops.Add(t); currentPop = t; if (parent == null) { t.Initial(Parent, this, obj); } else { t.Initial(parent, this, obj); } t.ReSize(); return(t); }
private void btnCancle_Click(object sender, EventArgs e) { if (PopWindow.Question("你确定要取消加密吗?") == DialogResult.Yes) { btnCancle.Enabled = false; IsStopped = true; } }
public void HidePopWindow() { if (currentPop != null) { currentPop.Hide(); } currentPop = null; }
private void frmConvert_FormClosing(object sender, FormClosingEventArgs e) { if (IsRunning) { e.Cancel = true; PopWindow.Warnning("正在转码,请稍后 。。。"); } }
private void btnCancle_Click(object sender, EventArgs e) { if (PopWindow.Question("你确定要取消转码吗?") == DialogResult.Yes) { btnCancle.Enabled = false; convert.Stop(); } }
private void MyStartupBackgroundWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { BTNsearch.IsEnabled = true; CBMode.IsEnabled = true; ProgressPanel.Visibility = Visibility.Hidden; if (CBMode.SelectedIndex != -1) { if (CBMode.SelectedValue.ToString().Trim() == "Employee") { StackService.Visibility = Visibility.Hidden; StackSnack.Visibility = Visibility.Hidden; StackBook.Visibility = Visibility.Hidden; StackEmp.Visibility = Visibility.Visible; EmployeeMode(); } else if (CBMode.SelectedValue.ToString().Trim() == "Booking") { StackBike.Visibility = Visibility.Hidden; StackService.Visibility = Visibility.Hidden; StackSnack.Visibility = Visibility.Hidden; StackEmp.Visibility = Visibility.Hidden; StackBook.Visibility = Visibility.Visible; BookingMode(); } else if (CBMode.SelectedValue.ToString().Trim() == "Bicycle") { StackService.Visibility = Visibility.Hidden; StackSnack.Visibility = Visibility.Hidden; StackBook.Visibility = Visibility.Hidden; StackEmp.Visibility = Visibility.Hidden; StackBike.Visibility = Visibility.Visible; BicycleMode(); } else if (CBMode.SelectedValue.ToString().Trim() == "Snacks") { StackService.Visibility = Visibility.Hidden; StackBook.Visibility = Visibility.Hidden; StackEmp.Visibility = Visibility.Hidden; StackBike.Visibility = Visibility.Hidden; StackSnack.Visibility = Visibility.Visible; SnackMode(); } else if (CBMode.SelectedValue.ToString().Trim() == "Service") { StackSnack.Visibility = Visibility.Hidden; StackBike.Visibility = Visibility.Hidden; StackEmp.Visibility = Visibility.Hidden; StackBook.Visibility = Visibility.Hidden; StackService.Visibility = Visibility.Visible; ServiceMode(); } } else { PopWindow pop = new PopWindow(ImageType.Error, "Error", "Please Choose a mode", "OK"); pop.ShowDialog(); } }
public void ReleasePopWindow(PopWindow window) { pops.Remove(window); if (currentPop == window) { currentPop = null; } window.Dispose(); }
public void LoadPopWindow <T>() where T : PopWindow, new() { if (window != null) { window.Dispose(); } var t = new T(); t.Initial(Content.transform, null); t.ReSize(); window = t; }
public void HidePopWindow() { if (mask != null) { mask.SetActive(false); } if (currentPop != null) { currentPop.Hide(); } currentPop = null; }
private static void Go2UI() { //Transform canvas=GameObject.Find("Canvas").transform; //GameObject UI = new GameObject("UI"); //UI.AddComponent<RawImage>(); //UI.transform.SetParent(canvas, false); PopWindow pw = GetWindow(typeof(PopWindow), true, "UI自动布局") as PopWindow; pw.minSize = PopWindow.minResolution; pw.maxSize = PopWindow.minResolution; pw.Init(); pw.Show(); }
private void convert_OnFinished(object sender, Ruihit.Ffmpeg.ConvertEventArgs e) { Logger.Info("转码完成"); Invoke(new Action(() => { btnConvert.Enabled = true; panel1.Enabled = true; btnCancle.Enabled = false; PopWindow.Information("视频转码完成!", "系统提示", this); IsRunning = false; })); }
public void ReleasePopWindow(PopWindow window) { pops.Remove(window); if (currentPop == window) { currentPop = null; if (mask != null) { mask.SetActive(false); } } window.Dispose(); }