private void vềChươngTrìnhToolStripMenuItem_Click(object sender, EventArgs e) { ThongTin f = new ThongTin(); f.MdiParent = this; f.Show(); }
public ActionResult DatBan(int MaBan, FormCollection f) { ThongBao.SDT = null; //List<ThongTin> listThongTin = Session["ThongTin"] as List<ThongTin>; //int i = int.Parse(f["txtSoLuong"].ToString()); string HoTen, SDT, GhiChu; HoTen = string.Format(f["HoTen"].ToString()); SDT = f["SDT"].ToString(); GhiChu = f["GhiChu"].ToString(); ThongTin thongtin = new ThongTin(MaBan, HoTen, SDT, GhiChu); Session["ThongTin"] = MaBan; if (HoTen == "") { ThongBao.HoTen = "Xin nhập họ tên"; return(RedirectToAction("Index", "Ban")); } ThongBao.HoTen = null; if (SDT == "") { ThongBao.SDT = "Xin nhập SĐT"; return(RedirectToAction("Index", "Ban")); } return(RedirectToAction("Index", "Menu")); }
//Update Thông tin private void Update_ThongTin(ThongTin thongTin) { txtMaDV.Text = thongTin.MaDV; txtHoten.Text = thongTin.HoTen; txtTenKS.Text = thongTin.TenKhaiSinh; txtBidanh.Text = thongTin.BiDanh; cb_TT_GT.SelectedText = thongTin.GioiTinh; txtNgaysinh.Text = thongTin.NgaySinh.ToShortDateString(); txtQuequan.Text = thongTin.QueQuan; rtxtDiachi.Text = thongTin.DiaChi; txtDantoc.Text = thongTin.DanToc; txtTongiao.Text = thongTin.TonGiao; txtSDT.Text = thongTin.SDT; txtEmail.Text = thongTin.Email; //if (maDV == "" || hoTen == "" || hoTenKS == "" || gioiTinh == "" || ngaySinh.ToString() == "" || queQuan == "" || diaChi == "" || danToc == "" || tonGiao == "" || sdt == "" || email == "" || linkAnh == "") //{ // MessageBox.Show("Vui lòng nhập đầy đủ thông tin!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); // return null; //} //else //{ // _thongTin = new ThongTin(maDV, hoTen, hoTenKS, biDanh, gioiTinh, ngaySinh, queQuan, diaChi, danToc, tonGiao, linkAnh, sdt, email); // return _thongTin; //} pictureBox.Image = Image.FromFile(@"C:\Users\Ngoc Tuan\Documents\Visual Studio 2015\Projects\Visual C#\Desktop\BTL_QuanLyDangVien\BTL_QuanLyDangVien\Resources\Avatar\" + thongTin.LinkAnh); }
//Insert Thông tin private ThongTin Insert_ThongTin() { string maDV = txtMaDV.Text; string hoTen = txtHoten.Text; string hoTenKS = txtTenKS.Text; string biDanh = txtBidanh.Text; string gioiTinh = cb_TT_GT.SelectedItem.ToString(); DateTime ngaySinh = ConvertStringToDate(txtNgaysinh.Text); string queQuan = txtQuequan.Text; string diaChi = rtxtDiachi.Text; string danToc = txtDantoc.Text; string tonGiao = txtTongiao.Text; string sdt = txtSDT.Text; string email = txtEmail.Text; string[] str = txtFileName.Text.Split('\\'); string linkAnh = str[str.Length - 1]; if (maDV == "" || hoTen == "" || hoTenKS == "" || gioiTinh == "" || ngaySinh.ToString() == "" || queQuan == "" || diaChi == "" || danToc == "" || tonGiao == "" || sdt == "" || email == "" || linkAnh == "") { MessageBox.Show("Vui lòng nhập đầy đủ thông tin!", "Thông báo", MessageBoxButtons.OK, MessageBoxIcon.Error); return(null); } else { _thongTin = new ThongTin(maDV, hoTen, hoTenKS, biDanh, gioiTinh, ngaySinh, queQuan, diaChi, danToc, tonGiao, linkAnh, sdt, email); return(_thongTin); } }
private void btThongTin_Click(object sender, RoutedEventArgs e) { if (grid.Children.Count > 0) { grid.Children.RemoveAt(grid.Children.Count - 1); } ThongTin thongTin = new ThongTin(); List <NhanVien> _nhanVien = new List <NhanVien>(); NhanVienBUS _busNhanVien = new NhanVienBUS(); _nhanVien = _busNhanVien.GetList(); foreach (NhanVien i in _nhanVien) { if (i.TaiKhoan == currentUser) { thongTin.SetInformation(currentUser, i.HoTen, i.DiaChi, i.NgaySinh.ToShortDateString(), i.CMND, i.SDT); grid.Children.Add(thongTin); return; } else { grid.Children.Add(thongTin); return; } } }
public bool Update_ThongTin(ThongTin thongTin) { try { string sql = "SP_UPDATE_THONGTIN"; SqlCommand command = new SqlCommand(sql, conn); dataAdapter = new SqlDataAdapter(); command.CommandType = CommandType.StoredProcedure; command.Parameters.Add(new SqlParameter("@MADV", thongTin.MaDV)); command.Parameters.Add(new SqlParameter("@HOTEN", thongTin.HoTen)); command.Parameters.Add(new SqlParameter("@HOTENKHAISINH", thongTin.TenKhaiSinh)); command.Parameters.Add(new SqlParameter("@BIDANH", thongTin.BiDanh)); command.Parameters.Add(new SqlParameter("@GIOITINH", thongTin.GioiTinh)); command.Parameters.Add(new SqlParameter("@NGAYSINH", thongTin.NgaySinh)); command.Parameters.Add(new SqlParameter("@QUEQUAN", thongTin.QueQuan)); command.Parameters.Add(new SqlParameter("@DIACHI", thongTin.DiaChi)); command.Parameters.Add(new SqlParameter("@DANTOC", thongTin.DanToc)); command.Parameters.Add(new SqlParameter("@TONGIAO", thongTin.TonGiao)); command.Parameters.Add(new SqlParameter("@SDT", thongTin.SDT)); command.Parameters.Add(new SqlParameter("@EMAIL", thongTin.Email)); command.Parameters.Add(new SqlParameter("@ANH", thongTin.LinkAnh)); dataAdapter.SelectCommand = command; dataAdapter.Fill(dataTable); return(true); } catch { return(false); } }
public ActionResult DeleteConfirmed(int id) { ThongTin thongtin = db.ThongTins.Find(id); db.ThongTins.Remove(thongtin); db.SaveChanges(); return(RedirectToAction("Index")); }
protected override void Seed(vuong_cms_context context) { CacheServ.ClearAll(); return; context.Confs.Add(new Conf() { Key = "html_taikhoannganhang", Content = "", IsHtmlEditor = true, Description = "Tài khoản ngân hàng" }); context.SaveChanges(); context.Category.AddOrUpdate(Category.seed()); context.SaveChanges(); context.Article.AddOrUpdate(Article.seed()); context.SaveChanges(); context.Product.AddOrUpdate(Product.seed()); context.SaveChanges(); //settings: context.Settings.AddOrUpdate(Setting.seed()); context.SaveChanges(); //role context.Roles.AddOrUpdate(Role.seed()); context.SaveChanges(); //flag context.Langs.AddOrUpdate(Lang.seed()); context.SaveChanges(); //Confs context.Confs.AddOrUpdate(Conf.seed()); context.SaveChanges(); //LogType context.LogType.AddOrUpdate(LogType.seed()); context.SaveChanges(); //UserStatus context.UserStatus.AddOrUpdate(UserStatus.seed()); context.SaveChanges(); //user context.Users.AddOrUpdate(User.seed()); context.SaveChanges(); context.ThongTin.AddOrUpdate(ThongTin.seed()); context.SaveChanges(); // context.ThongBao.AddOrUpdate(ThongBao.seed()); context.SaveChanges(); }
// GET: ChiTiet public ActionResult Index(int id) { MyDB db = new MyDB(); ThongTin tt = db.chitiet(id); IEnumerable <ThongTin> list = db.list(); ViewBag.list = list; return(View(tt)); }
public ActionResult Edit([Bind(Include = "ID,MaSv,HoTen,NamSinh,SoDienThoaiSV,Lop,Khoa,HoTenChuTro,DiaChiNoiCuTru,NgayDangKy,NgayHuy")] ThongTin thongtin) { if (ModelState.IsValid) { db.Entry(thongtin).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(thongtin)); }
public Form1() { InitializeComponent(); panel1.Width = 503; panel1.Height = 503; g = panel1.CreateGraphics(); gameOver = GameOver; congDiem = CongDiem; ketThuc = KetThuc; vc = new VatCan(g); vc.DocFile("level1.lev"); reset(); }
// GET: /SinhVien/Delete/5 public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } ThongTin thongtin = db.ThongTins.Find(id); if (thongtin == null) { return(HttpNotFound()); } return(View(thongtin)); }
private void btn_luu_Click(object sender, EventArgs e) { if (txt_tencuahang.Text.Length == 0) { Form1.Default.ShowMessageWarning($"Bạn vui lòng nhập vào tên cửa hàng."); return; } if (txt_diachi.Text.Length == 0) { Form1.Default.ShowMessageWarning($"Bạn vui lòng nhập vào địa chỉ tên cửa hàng."); return; } if (txt_sodt.Text.Length == 0) { Form1.Default.ShowMessageWarning($"Bạn vui lòng nhập vào số điện thoại của cửa hàng."); return; } if (txt_tinhthanh.Text.Length == 0) { Form1.Default.ShowMessageWarning($"Bạn vui lòng nhập vào tỉnh thành của cửa hàng."); return; } if (txt_quanhuyen.Text.Length == 0) { Form1.Default.ShowMessageWarning($"Bạn vui lòng nhập vào quận huyện của cửa hàng."); return; } var dgr = HelperMessage.Instance.ShowMessageYesNo("Bạn có muốn lưu lại những thông tin này không?", "Xác Nhận", SystemIcons.Question.ToBitmap()); if (dgr != DialogResult.Yes) { return; } //Xóa thông tin trước var dt = ExecSQL.ExecQueryDataFistOrDefault <ThongTin>("SELECT * FROM dbo.tbl_thongtin"); if (dt == null) { return; } ExecSQL.ExecQueryNonData($"DELETE FROM dbo.tbl_thongtin WHERE id='{dt.id}'"); var thongtin = new ThongTin { tencuahang = txt_tencuahang.Text, diachi = txt_diachi.Text, tinhthanh = txt_tinhthanh.Text, quanhuyen = txt_quanhuyen.Text, email = txt_email.Text, sodt = txt_sodt.Text, web = txt_web.Text }; ExecSQL.Insert(thongtin); Form1.Default.ShowMessageSuccess($"Đã cập nhật thành công thông tin của đơn vị."); }
public ActionResult Edit(ThongTin vm) { var model = __db.ThongTin.Find(vm.Id); if (model != null) { model.TieuDe = vm.TieuDe; model.NoiDung = vm.NoiDung; __db.SaveChanges(); return(RedirectToAction("Index")); } else { ModelState.AddModelError(string.Empty, "Không tìm thấy dữ liệu!"); } return(View("Index", model)); }
public ActionResult Addsp(int IDsp, int sl) { Carttt cart = Session["cart"] as Carttt; ThongTin sanpham = new ThongTin(); sanpham = db.ThongTins.FirstOrDefault(q => q.ID == IDsp); if (cart != null) { cart.Add(sanpham, sl); Session["cart"] = cart; } else { cart = new Carttt(); cart.Add(sanpham, sl); Session["cart"] = cart; } return(RedirectToAction("ViewCart")); }
// THÔNG TIN public bool Insert_ThongTin(ThongTin thongTin) { SqlCommand cmd = new SqlCommand(); cmd.CommandType = CommandType.StoredProcedure; cmd.CommandText = "SP_INSERT_THONGTIN"; cmd.Parameters.Add("@MADV", SqlDbType.NVarChar).Value = thongTin.MaDV; cmd.Parameters.Add("@HOTEN", SqlDbType.NVarChar).Value = thongTin.HoTen; cmd.Parameters.Add("@HOTENKHAISINH", SqlDbType.NVarChar).Value = thongTin.TenKhaiSinh; cmd.Parameters.Add("@BIDANH", SqlDbType.NVarChar).Value = thongTin.BiDanh; cmd.Parameters.Add("@GIOITINH", SqlDbType.NVarChar).Value = thongTin.GioiTinh; cmd.Parameters.Add("@NGAYSINH", SqlDbType.Date).Value = thongTin.NgaySinh; cmd.Parameters.Add("@QUEQUAN", SqlDbType.NVarChar).Value = thongTin.QueQuan; cmd.Parameters.Add("@DIACHI", SqlDbType.NVarChar).Value = thongTin.DiaChi; cmd.Parameters.Add("@DANTOC", SqlDbType.NVarChar).Value = thongTin.DanToc; cmd.Parameters.Add("@TONGIAO", SqlDbType.NVarChar).Value = thongTin.TonGiao; cmd.Parameters.Add("@SDT", SqlDbType.VarChar).Value = thongTin.SDT; cmd.Parameters.Add("@EMAIL", SqlDbType.NVarChar).Value = thongTin.Email; cmd.Parameters.Add("@ANH", SqlDbType.NVarChar).Value = thongTin.LinkAnh; cmd.Connection = _conn; try { _conn.Open(); cmd.ExecuteNonQuery(); return(true); } catch { return(false); } finally { _conn.Close(); } }
public frmUpdate(Object obj, int item) { InitializeComponent(); gbThongTin.Visible = false; gbThemThongTin.Visible = false; gbTrinhdo.Visible = false; gbQuatrinhCT.Visible = false; gbDaoTao.Visible = false; gbDiNN.Visible = false; gbKhenThuong.Visible = false; gbKyluat.Visible = false; gbGiadinh.Visible = false; gbTuNhanXet.Visible = false; switch (item) { case 0: this._thongTin = (ThongTin)obj; Update_ThongTin(_thongTin); gbThongTin.Visible = true; break; case 1: this._themThongTin = (ThemThongTin)obj; Update_ThemThongTin(_themThongTin); gbThemThongTin.Visible = true; break; case 2: this._trinhDo = (TrinhDo)obj; Update_TrinhDo(_trinhDo); gbTrinhdo.Visible = true; break; case 3: this._quaTrinhCT = (QuaTrinhCongTac)obj; Update_QTCT(_quaTrinhCT); gbQuatrinhCT.Visible = true; break; case 4: this._daoTaoBD = (DaoTao_BoiDuong)obj; Update_DTBD(_daoTaoBD); gbDaoTao.Visible = true; break; case 5: this._diNuocNgoai = (DiNuocNgoai)obj; Update_DNN(_diNuocNgoai); gbDiNN.Visible = true; break; case 6: this._khenThuong = (KhenThuong)obj; Update_KT(_khenThuong); gbKhenThuong.Visible = true; break; case 7: this._kyLuat = (KyLuat)obj; Update_KL(_kyLuat); gbKyluat.Visible = true; break; case 8: this._giaDinh = (GiaDinh)obj; Update_GD(_giaDinh); gbGiadinh.Visible = true; break; case 9: this._tuNhanXet = (TuNhanXet)obj; Update_TNX(_tuNhanXet); gbTuNhanXet.Visible = true; break; } }
private void thôngTinToolStripMenuItem_Click(object sender, EventArgs e) { ThongTin thongTin = new ThongTin(); thongTin.Show(); }
private void barhtthongtin_ItemClick(object sender, ItemClickEventArgs e) { ThongTin ThongTin = new ThongTin(); ThongTin.ShowDialog(); }
private void btnUpdate_Click(object sender, EventArgs e) { switch (_itemValue) { case 0: { _thongTin = new ThongTin(); _thongTin.MaDV = txtMaDV.Text; _thongTin.HoTen = txtHoten.Text; _thongTin.TenKhaiSinh = txtTenKS.Text; _thongTin.BiDanh = txtBidanh.Text; _thongTin.GioiTinh = txtGioitinh.Text; _thongTin.NgaySinh = convertStringToDate(txtNgaysinh.Text); _thongTin.QueQuan = txtQuequan.Text; _thongTin.DiaChi = rtxtDiachi.Text; _thongTin.SDT = txtSDT.Text; _thongTin.Email = txtEmail.Text; _thongTin.DanToc = txtDantoc.Text; _thongTin.TonGiao = txtTongiao.Text; _thongTin.LinkAnh = _linkAnh; _frmUpdate = new frmUpdate(_thongTin, 0); _frmUpdate.Show(); break; } case 1: { _themThongTin = new ThemThongTin(); _themThongTin.MaDV = txt_TTT_MaDV.Text; _themThongTin.NgayVaoDoan = convertStringToDate(txt_TTT_NgayVD.Text); _themThongTin.NoiVaoDoan = txt_TTT_MaDV.Text; _themThongTin.NgayVaoDangL1 = convertStringToDate(txt_TTT_NgayVDL1.Text); _themThongTin.NoiVaoDangL1 = txt_TTT_MaDV.Text; _themThongTin.NgayChinhThucL1 = convertStringToDate(txt_TTT_NgayCTL1.Text); _themThongTin.NoiCongNhanL1 = txt_TTT_MaDV.Text; _themThongTin.NguoiGioiThieuL1 = txt_TTT_MaDV.Text; _frmUpdate = new frmUpdate(_themThongTin, 1); _frmUpdate.Show(); break; } case 2: { _trinhDo = new TrinhDo(); _trinhDo.MaDV = txt_TD_MaDV.Text; _trinhDo.TrinhDoPT = txt_TD_PT.Text; _trinhDo.ChuyenMon = txt_TD_Chuyenmon.Text; _trinhDo.HocVi = txt_TD_Hocvi.Text; _trinhDo.DTHocVi = convertStringToDate(txt_TD_CTHV.Text); _trinhDo.HocHam = txt_TD_Hocham.Text; _trinhDo.DTHocham = convertStringToDate(txt_TD_CTHH.Text); _trinhDo.LyLuanCT = txt_TD_Lyluan.Text; _trinhDo.NgoaiNgu = rtxt_TD_NN.Text; _frmUpdate = new frmUpdate(_trinhDo, 2); _frmUpdate.Show(); break; } case 3: { _quaTrinhCT = new QuaTrinhCongTac(); _quaTrinhCT.MaDV = txt_QT_MaDV.Text; _quaTrinhCT.MaPB = txt_QT_MaPB.Text; _quaTrinhCT.PhongBan = txt_QT_TenPB.Text; _quaTrinhCT.BatDau = convertStringToDate(txt_QT_Batdau.Text); _quaTrinhCT.KetThuc = convertStringToDate(txt_QT_Ketthuc.Text); _quaTrinhCT.CongViec = txt_QT_Congviec.Text; _quaTrinhCT.DiaDiem = txt_QT_Diadiem.Text; _quaTrinhCT.ChucVu = txt_QT_Chucvu.Text; _frmUpdate = new frmUpdate(_quaTrinhCT, 3); _frmUpdate.Show(); break; } case 4: { _daoTaoBD = new DaoTao_BoiDuong(); _daoTaoBD.MaDV = txt_DT_MaDV.Text; _daoTaoBD.BatDau = convertStringToDate(txt_DT_BD.Text); _daoTaoBD.KetThuc = convertStringToDate(txt_DT_KT.Text); _daoTaoBD.TenLop = txt_DT_Tenlop.Text; _daoTaoBD.HinhThuc = txt_DT_Hinhthuc.Text; _daoTaoBD.ChungChi = txt_DT_Chungchi.Text; _frmUpdate = new frmUpdate(_daoTaoBD, 4); _frmUpdate.Show(); break; } case 5: { _diNuocNgoai = new DiNuocNgoai(); _diNuocNgoai.MaDV = txt_DNN_MaDV.Text; _diNuocNgoai.BatDau = convertStringToDate(txt_DNN_BD.Text); _diNuocNgoai.KetThuc = convertStringToDate(txt_DNN_KT.Text); _diNuocNgoai.NoiDung = rtxt_DNN_ND.Text; _diNuocNgoai.DiaDiem = txt_DNN_DD.Text; _frmUpdate = new frmUpdate(_diNuocNgoai, 5); _frmUpdate.Show(); break; } case 6: { _khenThuong = new KhenThuong(); _khenThuong.MaDV = txt_KT_MaDV.Text; _khenThuong.ThoiGian = convertStringToDate(txt_KT_TG.Text); _khenThuong.HinhThuc = txt_KT_Hinhthuc.Text; _khenThuong.CapQD = txt_KT_CapQD.Text; _khenThuong.LyDo = rtxt_KT_Lydo.Text; _frmUpdate = new frmUpdate(_khenThuong, 6); _frmUpdate.Show(); break; } case 7: { _kyLuat = new KyLuat(); _kyLuat.MaDV = txt_KL_MaDV.Text; _kyLuat.ThoiGian = convertStringToDate(txt_KL_TG.Text); _kyLuat.HinhThuc = txt_KL_Hinhthuc.Text; _kyLuat.CapQD = txt_KL_CapQD.Text; _kyLuat.LyDo = rtxt_KL_Lydo.Text; _frmUpdate = new frmUpdate(_kyLuat, 7); _frmUpdate.Show(); break; } case 8: { _giaDinh = new GiaDinh(); _giaDinh.MaDV = txt_GD_MaDV.Text; _giaDinh.QuanHe = txt_GD_QH.Text; _giaDinh.HoTen = txt_GD_Hoten.Text; _giaDinh.NamSinh = txt_GD_Namsinh.Text; _giaDinh.QueQuan = txt_GD_Quequan.Text; _giaDinh.DiaChi = rtxt_GD_Diachi.Text; _frmUpdate = new frmUpdate(_giaDinh, 8); _frmUpdate.Show(); break; } case 9: { _tuNhanXet = new TuNhanXet(); _tuNhanXet.MaDV = txt_TNX_MaDV.Text; _tuNhanXet.PhamChat = txt_TNX_PC.Text; _tuNhanXet.DaoDuc = txt_TNX_DD.Text; _tuNhanXet.NangLuc = txt_TNX_NL.Text; _tuNhanXet.QuanHeQC = txt_TNX_QHQC.Text; _tuNhanXet.KhuyetDiem = txt_TNX_KD.Text; _frmUpdate = new frmUpdate(_tuNhanXet, 9); _frmUpdate.Show(); break; } } }
// THÔNG TIN public bool Insert_ThongTin(ThongTin thongTin) { return(dal_Insert.Insert_ThongTin(thongTin)); }
public void Delete(ThongTin thongTin) { _informationRepository.Delete(thongTin); }
public void Update(ThongTin thongTin) { _informationRepository.Update(thongTin); }
// THÔNG TIN public bool Update_ThongTin(ThongTin thongTin) { return(dal_Update.Update_ThongTin(thongTin)); }
public ThemCapNhatMenu() { ThongTinMenu = new ThongTin(); DanhSachMenu = new List <ThongTinMenuOngNoi>(); DanhMucChucNang = new List <ThongTinDanhMucChucNang>(); }
public void Create(ThongTin thongTin) { _informationRepository.Create(thongTin); }