private void btnDangNhap_Click(object sender, EventArgs e) { string sql = string.Format("select TaiKhoan from Account where TaiKhoan='{0}' and MatKhau='{1}'", txtUseName.Text, txtPassWord.Text); DataTable dt = sqlHelper.Query(sql); if (dt.Rows.Count == 1) { SingletonData.Getlates().nguoidung = new Account() { TaiKhoan = txtUseName.Text }; MessageBox.Show("Đăng nhập thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); /////////////////////// if (ckLuu.Checked) { file.ghifileLG(padFile, txtUseName.Text.Trim(), txtPassWord.Text.Trim()); lblsuccess.Text = "✓ success"; ckLuu.Enabled = false; btnDangNhap.Enabled = true; } else { lblsuccess.Text = "X error"; } this.Close(); } else { SingletonData.Getlates().nguoidung = null; MessageBox.Show("Đăng nhập thất bại. Xem lại tài khoản hoặc mật khẩu!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public void MouseDown(Pen p, MouseEventArgs e, AFigure figure, IFigureFabric fabric) { _singletone = SingletonData.GetData(); _movingFigure = null; foreach (AFigure checkFigure in _singletone.FigureList) { //if (checkFigure.IsPeak(e.Location)) //{ // _figure = checkFigure; // movingFigure = checkFigure; // figuresList.Remove(_figure); // pictureBox1.Image = canvas.Clear(); // DrawAll(); // startPoint = checkFigure.touchPoint; // mode = "PEAK"; // break; //} if (checkFigure.IsEdge(e.Location) || (checkFigure.IsArea(e.Location) && checkFigure.IsFilled)) { _movingFigure = checkFigure; _singletone.FigureList.Remove(checkFigure); _singletone.PictureBox1.Image = _singletone.Canvas.Clear(); foreach (AFigure figureINList in _singletone.FigureList) { _singletone.PictureBox1.Image = _singletone.Canvas.DrawIt(figureINList, new Pen(figureINList.Color, figureINList.Width)); _singletone.Canvas.Save(); } _startPoint = checkFigure.TouchPoint; break; } } }
public FirstRunPage() { InitializeComponent(); _data = SingletonData.Initialize(); _data.PropertyChanged += _data_PropertyChanged; _invalidFormat = new SolidColorBrush(Colors.Red); }
public void MouseDown(Pen p, MouseEventArgs e, AFigure figure, IFigureFabric fabric) { _singletone = SingletonData.GetData(); if (fabric is LineNDIFabric || fabric is FigureNDIFabric || fabric is Triangle3DIFabric) { //если фигура начинается то записать первую стартПоинт if (_figure == null) { _figure = fabric.CreateFigure(p); _startPoint = e.Location; _figure.TmpPoint = e.Location; _figure.Started = true; } else { _figure.TmpPoint = e.Location; _startPoint = _figure.SecondPoint; } } else { _startPoint = e.Location; _figure = fabric.CreateFigure(p); } }
private void Form1_Load(object sender, EventArgs e) { _data = SingletonData.GetData(); _data.PictureBox1 = pictureBox1; _data.Canvas = new Canvas(pictureBox1.Width, pictureBox1.Height); fabric = new BrushFabric(); _figure = fabric.CreateFigure(_pen); _mouseMode = new PaintIMode(); }
public void Do() { if (_figure.AnglesNumber == 3) { _figure.PointsList.Add(new PointF(_figure.PointsList[0].X, _figure.PointsList[0].Y)); _singletone = SingletonData.GetData(); _singletone.PictureBox1.Image = _singletone.Canvas.DrawIt(_figure, new Pen(_figure.Color, _figure.Width)); } }
private void btnLogin_ItemClick(object sender, ItemClickEventArgs e) { nd = new TaiKhoan(); frmLogin login = new frmLogin(); login.ShowDialog(); nd = SingletonData.Getlates().nguoidung; if (nd != null) { btnLogin.Enabled = false; menuQuanLy.Visible = true; } }
private void mnHT_Login_Click(object sender, EventArgs e) { frmLogin login = new frmLogin(); login.ShowDialog(); nd = SingletonData.Getlates().nguoidung; if (nd != null) { mnHT_Login.Enabled = false; mnuKB.Enabled = true; lblNguoidung.Text = nd.TaiKhoan; } }
private void barButtonItem2_ItemClick(object sender, ItemClickEventArgs e) { nd = new Account(); frmLogin login = new frmLogin(); login.ShowDialog(); nd = SingletonData.Getlates().nguoidung; if (nd != null) { btnLogin.Enabled = false; lblNguoiDung.Caption = nd.TaiKhoan; btnQuanLyGiaoVien.Enabled = true; btnQuanLyHoc.Enabled = true; btnQuanLyHS.Enabled = true; btnQuanLyLopHoc.Enabled = true; btnQuanLyMonHoc.Enabled = true; } }
private void btnDangNhap_Click(object sender, EventArgs e) { string sql = string.Format("select TaiKhoan from Account where TaiKhoan='{0}' and MatKhau='{1}'", txtUseName.Text, txtPassWord.Text); DataTable dt = sqlHelper.Query(sql); if (dt.Rows.Count == 1) { SingletonData.Getlates().nguoidung = new Account() { TaiKhoan = txtUseName.Text }; MessageBox.Show("Đăng nhập thành công!"); this.Close(); } else { SingletonData.Getlates().nguoidung = null; MessageBox.Show("Đăng nhập thất bại. Xem lại tài khoản hoặc mật khẩu!"); } }
public void MouseDown(Pen p, MouseEventArgs e, AFigure figure, IFigureFabric fabric) { _singletone = SingletonData.GetData(); _rotateFigure = null; foreach (AFigure checkFigure in _singletone.FigureList) { if (checkFigure.IsEdge(e.Location) || (checkFigure.IsArea(e.Location) && checkFigure.IsFilled)) { _rotateFigure = checkFigure; _singletone.FigureList.Remove(checkFigure); _singletone.PictureBox1.Image = _singletone.Canvas.Clear(); foreach (AFigure figureINList in _singletone.FigureList) { _singletone.PictureBox1.Image = _singletone.Canvas.DrawIt(figureINList, new Pen(figureINList.Color, figureINList.Width)); _singletone.Canvas.Save(); } _startPoint = checkFigure.TouchPoint; break; } } }
// Use this for initialization void Start() { print("Story.cs start method"); mTextControllerGO = GameObject.Find("TextController"); mBeerFullGO = GameObject.Find("BierflascheVoll"); mBeerEmptyGO = GameObject.Find("BierflascheLeer"); mBeerFullGO.SetActive(false); mBeerFullGO.GetComponent <SpriteRenderer> ().enabled = false; mBeerEmptyGO.SetActive(false); mBeerEmptyGO.GetComponent <SpriteRenderer> ().enabled = false; //mSpRendererBeerBootleFull = gameObject.GetComponent<SpriteRenderer> ().GetComponent<BierflascheVoll>(); // prepare sprite renderer SingletonData.Instance.globalClickWalkingIsDisabled = true; SingletonData.Instance.globalMouseHasBeenClicked = false; SingletonData.Instance.globalStoryInDalogue = true; mSingleton = new SingletonData(); mGuiBox = mTextControllerGO.GetComponent <GuiBox> (); mGuiBox.mStoryActionArrayList.Add("Willkommen im Spiel. Das ist das Tutorial"); mGuiBox.mStoryActionArrayList.Add("Suche den Kiosk um die mit der Bewegung vertraut zu machen!"); mGuiBox.mStoryActionArrayList.Add("_Action:moveCinemaBars"); mGuiBox.mStoryActionArrayList.Add("War doch falsch. Rechts gehts weiter."); mGuiBox.mStoryActionArrayList.Add("Duncan: Oh eine Flasch Bier. Die ist auch noch fast haltbar."); mGuiBox.mStoryActionArrayList.Add("_Action:activateWalking"); mGuiBox.mStoryActionArrayList.Add("Duncan:\nDas ist der lezte Text 1"); mGuiBox.mStoryActionArrayList.Add("Duncan:\nDas ist der lezte Text 2"); mGuiBox.mStoryActionArrayList.Add("Duncan:\nDas ist der lezte Text 3"); mGuiBox.mStoryActionArrayList.Add("Duncan:\nDas ist der lezte Text 4"); mGuiBox.mStoryActionArrayList.Add("_Action:changeToScene0"); mGuiBox.showBox(true); }
private void btnDangNhap_Click(object sender, EventArgs e) { lstTK = TaiKhoanController.getAllDataTaiKhoan(); try { foreach (TaiKhoan tk in lstTK) { if (tk.TenTaiKhoan == txtUserName.Text.Trim() && tk.MatKhau == txtPassWord.Text.Trim()) { SingletonData.Getlates().nguoidung = new TaiKhoan() { TenTaiKhoan = txtUserName.Text }; MessageBox.Show("Đăng nhập thành công!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Information); if (ckLuu.Checked) { file.ghifileLG(pathFile, txtUserName.Text.Trim(), txtPassWord.Text.Trim()); lblLuu.Text = "✓ success"; ckLuu.Enabled = false; btnDangNhap.Enabled = true; } else { lblLuu.Text = "X error"; } this.Close(); return; } } } catch (Exception ex) { MessageBox.Show(ex.Message, "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } SingletonData.Getlates().nguoidung = null; MessageBox.Show("Đăng nhập thất bại. Xem lại tài khoản hoặc mật khẩu!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); }
public void MouseDown(Pen p, MouseEventArgs e, AFigure figure, IFigureFabric fabric) { _singletone = SingletonData.GetData(); foreach (AFigure checkFigure in _singletone.FigureList) { if (checkFigure.IsEdge(e.Location)) { _figure = checkFigure; _movingFigure = checkFigure; _singletone.FigureList.Remove(_figure);//это удаление первой по значению? _figure.AddPeak(); fabric = new FigureNDIFabric(); _figure = fabric.CreateFigure(p); _singletone.PictureBox1.Image = _singletone.Canvas.Clear(); foreach (AFigure figureINList in _singletone.FigureList) { _singletone.PictureBox1.Image = _singletone.Canvas.DrawIt(figureINList, new Pen(figureINList.Color, figureINList.Width)); _singletone.Canvas.Save(); } _startPoint = checkFigure.TouchPoint; } } }
public void MouseUp(Pen pen, MouseEventArgs e, IFigureFabric fabric) { _mouseMove = false; if (_figure != null && _figure.Reaction is NoReactionIReaction) { _figure.Reaction.Do(); SingletonData _fL = SingletonData.GetData(); _fL.FigureList.Add(_figure); _figure = null; } else if (_figure != null && _figure.Reaction is Triangle3DIRightClickReaction && _figure.AnglesNumber == 3) { //ничего не происходит для фигур с FreeLineIRightClickReaction и FreeFigureIRightClickReaction _figure.Reaction.Do(); SingletonData _fL = SingletonData.GetData(); _fL.FigureList.Add(_figure); _figure = null; } if (e.Button == MouseButtons.Right && _figure != null) { if (_figure.Reaction is FreeLineIRightClickReaction || _figure.Reaction is FreeFigureIRightClickReaction) { _figure.Reaction.Do(); SingletonData _fL = SingletonData.GetData(); _fL.FigureList.Add(_figure); _figure = null; } else { _figure.Reaction.Do(); } } }
public TimetablePage() { InitializeComponent(); _data = SingletonData.Initialize(); }
public FindPage() { InitializeComponent(); _data = SingletonData.Initialize(); _invalidFormat = new SolidColorBrush(Windows.UI.Colors.Red); }
public ProductsController() { _data = SingletonData.Instance; }
public TextFileRepositoryBase() { _singletonData = SingletonData <TEntity> .Instance; _path = @"C:\Users\omer\source\repos\Week1Homework1\week1-homework1-omerbeden\Week1Homework1\Data\Products.txt"; }
private void buttonDiagram_Click(object sender, EventArgs e) { SaveFileDialog sfd = new SaveFileDialog { Filter = "doc|*.doc|docx|*.docx" }; if (sfd.ShowDialog() == DialogResult.OK) { try { Dictionary <int?, int> mp = new Dictionary <int?, int>(); foreach (var elem in service.GetList()) { if (elem.Sum == null) { if (mp.ContainsKey(0)) { mp[0]++; } else { mp[0] = 1; } continue; } if (mp.ContainsKey(elem.Sum)) { mp[elem.Sum]++; } else { mp[elem.Sum] = 1; } } controlWordDiagram1.CreateDiagram(ControlWordDiagram.Diagrams.BarChart, SingletonData.getInstance(mp).Data, "Количество покупателей с суммами", "sum", "cnt", sfd.FileName); MessageBox.Show("Выполнено", "Успех", MessageBoxButtons.OK, MessageBoxIcon.Information); } catch (Exception ex) { MessageBox.Show(ex.Message, "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }