protected void linkPhanhoi_Click(object sender, EventArgs e) { string macongty = (string)Session["congty"]; string manhanvien = (string)Session["user"]; if (manhanvien == null && macongty == null) { Response.Redirect("http://" + linkWebPortal + "/"); } Busers2 nhanvien = UserBUS.TimNhanVienTheoMa(manhanvien, macongty); if (nhanvien != null) { if (nhanvien.isSep == true) { Session["user"] = manhanvien; Session["UserID"] = manhanvien; Response.Redirect("DanhSachPhieuChuaDuyetBiTraVeCB.aspx"); } else { Session["user"] = manhanvien; Session["UserID"] = manhanvien; Response.Redirect("DanhSachPhieuChuaDuyetBiTraVe.aspx"); } } }
protected void LinkDaGui_Click(object sender, EventArgs e) { string macongty = (string)Session["congty"]; string manhanvien = (string)Session["user"]; if (manhanvien == null && macongty == null) { Response.Redirect("http://" + linkWebPortal + "/"); } Busers2 nhanvien = UserBUS.TimNhanVienTheoMa(manhanvien, macongty); if (nhanvien != null) { if (nhanvien.isSep == true) { Session["user"] = manhanvien; Session["UserID"] = manhanvien; Response.Redirect("Danhsachvanbandagui.aspx"); } else { Session["user"] = manhanvien; Session["UserID"] = manhanvien; Response.Redirect("DanhsachvanbandaguiNV.aspx"); } } }
protected void btnTaoPhieu_Click(object sender, EventArgs e) { string macongty = (string)Session["congty"]; string manhanvien = (string)Session["user"]; if (manhanvien == null && macongty == null) { Response.Redirect("http://" + linkWebPortal + "/"); } Session.Remove("maphieu"); Session.Remove("ktmaphieu"); Busers2 nhanvien = UserBUS.TimNhanVienTheoMa(manhanvien, macongty); if (nhanvien != null) { if (nhanvien.isSep == true) { Session["user"] = manhanvien; Session["UserID"] = manhanvien; Response.Redirect("MyCreatePDN1.aspx"); } else { Session["user"] = manhanvien; Session["UserID"] = manhanvien; Response.Redirect("frmTaoMoi.aspx"); } } }
private void HienThiThongTin() { if (RadioSendTranslator.Checked == true) { string ngonngu = Session["languege"].ToString(); DropDownNguoiDich.DataSource = NguoiDichDAO.QryNguoiDich(); DropDownNguoiDich.DataValueField = "USERID"; if (ngonngu == "lbl_VN") { DropDownNguoiDich.DataTextField = "TenNguoiDich"; } else if (ngonngu == "lbl_TW") { DropDownNguoiDich.DataTextField = "TenNguoiDichTiengHoa"; } else if (ngonngu == "lbl_EN") { DropDownNguoiDich.DataTextField = "TenNguoiDich"; } DropDownNguoiDich.DataBind(); } else { string manguoitao = Session["manguoitao"].ToString(); string congty = Session["congty"].ToString(); Busers2 nhanvientao = UserBUS.TimMaNhanVienTaoPhieu(manguoitao, congty); if (nhanvientao != null) { txtEmail.Text = nhanvientao.EMAIL; txtUser.Text = nhanvientao.USERNAME; } } }
protected void Page_Load(object sender, EventArgs e) { if (Session["user"] != null) { string ngonngu = Session["languege"].ToString(); string congty = Session["congty"].ToString(); string manguoidung = Session["user"].ToString(); Busers2 nguoidung = UserDAO.TimNhanVienTheoMa(manguoidung, congty); lblTen.Text = nguoidung.USERNAME; if (ngonngu == "lbl_VN") { lblXinChao.Text = "Xin chào: "; } else if (ngonngu == "lbl_TW") { lblXinChao.Text = "你好: "; } else if (ngonngu == "lbl_EN") { lblXinChao.Text = "Hello: "; } } else { Response.Redirect("~/presentationLayer/DangNhap.aspx"); } LayngonNgu(19); GanNgonNguVaoConTrol(); }
public static Busers2 KiemTraDangNhap2(string congty, string tenDangNhap, string matKhau, bool kiemTraBiXoa = true) { Busers2 nNhanVien = new Busers2(); try { if (kiemTraBiXoa) { nNhanVien = db.Busers2s.Where(nv => nv.GSBH == congty && nv.USERID == tenDangNhap && nv.PWD == matKhau).FirstOrDefault(); // var login = from p in db.Busers.Where(p => p.USERID.Equals(tenDangNhap) && p.PWD.Equals(matKhau)) select p; //return login.FirstOrDefault(); } else { nNhanVien = db.Busers2s.Where(nv => nv.GSBH == congty && nv.USERID == tenDangNhap && nv.PWD == matKhau).FirstOrDefault(); } return(nNhanVien); } catch (Exception) { } finally { if (db != null) { db.ToString(); } } return(null); }
protected void btnSua_Click(object sender, EventArgs e) { Binary binaryObj; if (FileUpload1.HasFile && FileUpload1.PostedFile.ContentLength > 0) { string fileName = FileUpload1.FileName; byte[] fileByte = FileUpload1.FileBytes; binaryObj = new Binary(fileByte); } string manv = txtMaNV.Text; string tennv = txtTenNV.Text; // string chuky = txtChuKy.Text; string cty = DropCty.SelectedValue.ToString(); string bophan = DropBoPhan.SelectedValue.ToString(); Busers2 user = db.Busers2s.Where(p => p.USERID == manv).FirstOrDefault(); user.USERID = manv; user.USERNAME = tennv; user.GSBH = cty; user.BADEPID = bophan; // user.signatue = binaryObj; db.SubmitChanges(); GridView1.EditIndex = -1; HienThiDanhSach(); }
public static bool UpdateUser(Busers2 user) { try { Busers2 u = new Busers2(); u = db.Busers2s.Where(p => p.USERID == user.USERID && p.GSBH == user.GSBH).FirstOrDefault(); { u.USERID = user.USERID; u.USERNAME = user.USERNAME; u.Password2 = user.Password2; u.LASTDATETIME = user.LASTDATETIME; u.isSep = user.isSep; u.EMAIL = user.EMAIL; u.IDChucVu = user.IDChucVu; u.BADEPID = user.BADEPID; u.GSBH = user.GSBH; u.EMAIL = user.EMAIL; u.IDCapDuyet = user.IDCapDuyet; u.signatue = user.signatue; u.YN = user.YN; u.IdUserQuanLyTT = user.IdUserQuanLyTT; } db.SubmitChanges(); return(true); } catch (Exception) { return(false); } }
protected void btnSendMail_Click(object sender, EventArgs e) { string congty = Session["congty"].ToString(); string user = Session["user"].ToString(); string manguoitao = Session["manguoitao"].ToString(); string maphieu = Session["maphieu"].ToString(); String noidung2 = "Chào anh/chị. Có thông tin mới"; noidung2 += "- Mã văn bản: " + maphieu + "\n"; noidung2 += "- Tiêu đề: " + txtTile.Text + "\n"; noidung2 += "- Nội dung: " + txtComment.Text + "\n"; Busers2 nhanvientao = UserBUS.TimMaNhanVienTaoPhieu(manguoitao, congty); Busers2 nhanviendich = UserBUS.TimMaNhanVienDich(user, congty); Until.SendMailNguoiTao(nhanviendich.EMAIL, nhanvientao.EMAIL, "[Ty Hung-eOffice] Thông báo ", noidung2); string ngonngu = Session["languege"].ToString(); if (ngonngu == "lbl_VN") { LbThongBao.Text = "Sent successfully"; } else if (ngonngu == "lbl_TW") { LbThongBao.Text = "Sent successfully"; } else if (ngonngu == "lbl_EN") { LbThongBao.Text = "Sent successfully"; } btnSendMail.Enabled = false; btnSendMail.Attributes.CssStyle.Add("opacity", "0.5"); }
protected void Button1_Click(object sender, EventArgs e) { string macongty = DropCty.SelectedValue.ToString(); string madonvi = DropDownLDonVi.SelectedValue.ToString(); string manguoiduyet = txtNguoiDuyet.Text; int buocduyet = int.Parse(txtBucoDuyet.Text); BDepartment donvi = BDepartmentDAO.TimMaDonVi(madonvi, macongty); AbDepartmentType loaidonvi = LoaiDonViDAO.TimMaLoaiDonVi(int.Parse(donvi.DepartmentTypeID.ToString()), macongty); QuyTrinhXetDuyetCuaCanBo quytrinh = new QuyTrinhXetDuyetCuaCanBo(); //quytrinh.IDQuyTrinh = maquytrinh + (QuyTrinhXetDuyetDAO.DemQuyTrinhXetDuyet() + 1).ToString(); quytrinh.BADEPID = madonvi; quytrinh.tendonviTW = donvi.DepName; quytrinh.GSBH = macongty; quytrinh.BuocDuyet = buocduyet; quytrinh.IDLoaiDonVi = loaidonvi.DepartmentTypeID; quytrinh.DepartmentTypeNameTW = loaidonvi.DepartmentTypeNameTW; if (cbLoaiPhieu.Checked == true) { quytrinh.abtype = DropDownLoaiPhieu.SelectedValue.ToString(); abill timloai = abillBUS.SearchAbillByID(DropDownLoaiPhieu.SelectedValue.ToString()); quytrinh.abtypenameTW = timloai.abnameTW; } else { quytrinh.abtype = "PDN1"; } if (CheckThongQuaDonVi.Checked == true) { quytrinh.DonViThongQua = DropDownDonViThongQua.SelectedValue.ToString(); BDepartment donvithongqua = BDepartmentDAO.TimMaDonVi(DropDownDonViThongQua.SelectedValue.ToString(), macongty); quytrinh.tendonvithongqua = donvithongqua.DepName; } else { quytrinh.DonViThongQua = null; } if (txtNguoiDuyet.Text.Trim() == "") { quytrinh.NguoiDuyet = "MD"; } else { quytrinh.NguoiDuyet = manguoiduyet; Busers2 nguoi = UserDAO.TimNhanVienTheoMa(manguoiduyet, macongty); quytrinh.USERNAME = nguoi.USERNAME; ChucVu chuc = ChucVuDAO.TimMaChucVu(nguoi.IDChucVu, macongty); quytrinh.IDChucVu = chuc.IDChucVu; quytrinh.TenChucVuTiengHoa = chuc.TenChucVuTiengHoa; quytrinh.IDCapDuyet = nguoi.IDCapDuyet; } QuyTrinhXetDuyetCuaCanBoDAO.SuaQuyTrinhXetDuyetTheoCanBo(quytrinh); Response.Redirect("FQuyTrinhXetDuyetDanhChoCanBo.aspx"); }
public static bool ThayDoiMatKhauCap2(string tenDangNhap, string matKhauCu, string matKhauMoi, bool kiemTraBiXoa = true) { Busers2 nNhanVien = new Busers2(); try { if (kiemTraBiXoa) { nNhanVien = db.Busers2s.Where(nv => nv.USERID == tenDangNhap && nv.Password2 == matKhauCu).FirstOrDefault(); if (nNhanVien == null) { if (db != null) { db.ToString(); } return(false); } else { nNhanVien.Password2 = matKhauMoi; //NhanVien_MaBaoMat nvbm = new NhanVien_MaBaoMat(); //nvbm.IdNhanVien = nNhanVien.IdNhanVien; //nvbm.MyKey = matKhauMoi; //nvbm.Ngay = DateTime.Now; //db.NhanVien_MaBaoMats.InsertOnSubmit(nvbm); db.SubmitChanges(); if (db != null) { db.ToString(); } return(true); } } else { return(false); } } catch (Exception ex) { Until.WriteFileLogServer("ThayDoiMatKhauCap2\t\t" + "\tMessage Error:\t\t" + ex.Message); return(false); } finally { if (db != null) { db.ToString(); } } }
protected void Button1_Click(object sender, EventArgs e) { string id = Session["id"].ToString(); string macongty = DropCty.SelectedValue.ToString(); DateTime tungay = DateTime.Parse(txtTuNgay.Text.ToString()); DateTime denngay = DateTime.Parse(txtDenNgay.Text.ToString()); string ngonngu = Session["languege"].ToString(); string manguoiduyet = txtNguoiDuyet.Text; string manguoiduocuyquyen = txtNguoiDuocUyQuyen.Text; int khivang = int.Parse(DropDownVangMat.SelectedValue.ToString()); ABJobAgent nghiphep = new ABJobAgent(); nghiphep.GSBH = macongty; nghiphep.ID = int.Parse(id); nghiphep.TuNgay = tungay; nghiphep.DenNgay = denngay; if (txtNguoiDuyet.Text.Trim() == "" && txtNguoiDuocUyQuyen.Text.Trim() == "") { return; } else { Busers2 nguoiuyquyen = UserDAO.TimNhanVienTheoMa(manguoiduyet, macongty); Busers2 nguoithaythe = UserDAO.TimNhanVienTheoMa(manguoiduocuyquyen, macongty); if (nguoiuyquyen == null && nguoithaythe == null) { if (ngonngu == "lbl_VN") { lblThongBao.Text = "Mã người Ủy Quyền hoặc Mã Người Thay Thế không có trong hệ thống"; } else if (ngonngu == "lbl_TW") { lblThongBao.Text = "系统没有这个委托人编号或者代理人编号"; } else if (ngonngu == "lbl_EN") { lblThongBao.Text = "Mã người Ủy Quyền hoặc Mã Người Thay Thế không có trong hệ thống"; } } else { nghiphep.IDNguoiDuyet = manguoiduyet; nghiphep.IDNguoiDuocUyQuyen = manguoiduocuyquyen; nghiphep.tennguoiuyquyen = nguoiuyquyen.USERNAME; nghiphep.tennguoithaythe = nguoithaythe.USERNAME; } } nghiphep.ThongQua = khivang; StatusCode thong = KhiVangMatDAO.TimMaThongQua(khivang); nghiphep.TenThongQua = thong.NameTaiwan; NghiPhepDAO.SuaDuLieu(nghiphep); Response.Redirect("frmNghiPhep.aspx"); }
private void HienThi() { string idphieu = Session["maphieu"].ToString(); //string bophan = Session["bophan"].ToString(); //string noidung = Session["noidung"].ToString(); //string ngaytao = Session["ngaythang"].ToString(); string user = Session["user"].ToString(); string congty = Session["congty"].ToString(); DataTable dt = dalP.TimPhieuTheoMaNguoiTao(idphieu, congty, user); if (dt.Rows.Count > 0) { string madonvi = dt.Rows[0]["pddepid"].ToString(); string maloaiphieu = dt.Rows[0]["Abtype"].ToString(); int Abc = int.Parse(dt.Rows[0]["ABC"].ToString()); BDepartment bophan = BDepartmentBUS.TimMaDonVi(madonvi, congty); abill loaiphieu = abillBUS.SearchAbillByID(maloaiphieu); aABC douutien = ABCDAO.TimDoUuTien(Abc); string tenloaiphieuVN = loaiphieu.abname; string tenloaiphieuTW = loaiphieu.abnameTW; if (douutien != null) { lblDoUutien.Text = douutien.NameABC + "-" + douutien.NameABCTW; } lbLoaiPhieu.Text = tenloaiphieuVN + " " + tenloaiphieuTW; lblTieuDe.Text = dt.Rows[0]["mytitle"].ToString() + " " + dt.Rows[0]["pdnsubject"].ToString(); lbBoPhan.Text = bophan.DepName; lbSoPhieu.Text = idphieu; lbNoiDung.Text = dt.Rows[0]["pdmemovn"].ToString(); LbNoiDungDich.Text = dt.Rows[0]["NoiDungDich"].ToString(); //lbNgay.Text = phieu.CFMDate0.ToString(); string dinhdang = dt.Rows[0]["CFMDate0"].ToString(); string thang = dinhdang.Substring(3, 2); string ngay = dinhdang.Substring(0, 2); string nam = dinhdang.Substring(6, 4); lbNgay.Text = "Ngày 日 " + ngay + " Tháng 月 " + thang + " Năm 年 " + nam + ""; } Busers2 user0 = AbconBUS.LayMaNguoiTaoTheoIDVanBan(idphieu, congty); if (user0 != null) { TextBox1.Text = user0.USERID; //ImageLevel0.ImageUrl = users.signatue; ImageLevel0.Width = 100; ImageLevel0.Height = 100; ImageLevel0.ImageUrl = "~/MyPhoto.ashx?USERID=" + TextBox1.Text; } }
public static bool InsertUser(Busers2 user) { try { db.Busers2s.InsertOnSubmit(user); db.SubmitChanges(); return(true); } catch (Exception) { return(false); } }
public static Busers2 SearchUserByID(string id, bool checkdel = true) { Busers2 user = new Busers2(); if (checkdel) { user = db.Busers2s.Where(p => p.USERID.Equals(id)).FirstOrDefault(); } else { user = db.Busers2s.Where(p => p.USERID.Equals(id)).SingleOrDefault(); } return(user); }
public static bool ChangeSercuritySendUser(string account, string email, bool kiemTraBiXoa = true) { string MaBaoMat = CreateRandomPassword(); Busers2 nNV = new Busers2(); try { if (kiemTraBiXoa) { nNV = db.Busers2s.Where(nv => nv.USERID == account && nv.EMAIL == email && nv.bixoa == false).SingleOrDefault(); if (nNV == null) { if (db != null) { db.ToString(); } return(false); } else { nNV.Password2 = libraly.EncryptionPassword(MaBaoMat); db.SubmitChanges(); if (db != null) { db.ToString(); } return(true); } } else { return(false); } } catch (Exception) { //Util.WriteFileLogServer("ChangeSercuritySendUser\t\t" + "\tMessage Error:\t\t" + ex.Message); return(false); } finally { if (db != null) { db.ToString(); } } }
public static bool ThayDoiMatKhau(string tenDangNhap, string matKhauCu, string matKhauMoi, string macongty, bool kiemTraBiXoa = true) { Busers2 nNhanVien = new Busers2(); try { if (kiemTraBiXoa) { nNhanVien = db.Busers2s.Where(nv => nv.USERID == tenDangNhap && nv.PWD == matKhauCu && nv.GSBH == macongty).FirstOrDefault(); if (nNhanVien == null) { if (db != null) { db.ToString(); } return(false); } else { nNhanVien.PWD = matKhauMoi; db.SubmitChanges(); if (db != null) { db.ToString(); } return(true); } } else { return(false); } } catch (Exception) { return(false); } finally { if (db != null) { db.ToString(); } } }
protected void Page_Load(object sender, EventArgs e) { if (Session["user"] == null) { Response.Redirect("http://portal.footgear.com.vn"); } if (!IsPostBack) { HienThiDropDownList(); HienThiChucVu(); //string str = Request.QueryString.Get("USERID"); //string idcongty = Request.QueryString.Get("GSBH"); string str = Session["manhanvien"].ToString(); string idcongty = Session["idcongty"].ToString(); string bophan = DropBoPhan.SelectedValue.ToString(); Busers2 user = db.Busers2s.Where(p => p.USERID == str && p.GSBH == idcongty).FirstOrDefault(); txtMaNV.Text = str; DropCty.SelectedValue = user.GSBH; txtTenNV.Text = user.USERNAME; txtNguoiQuanLyTT.Text = user.IdUserQuanLyTT; txtEmail.Text = user.EMAIL; //txtmatkhau2.Text = libraly.Decryption(user.Password2); if (user.isSep == true) { checkCanBo.Checked = true; } else { checkCanBo.Checked = false; } DropBoPhan.SelectedValue = user.BADEPID; DropDownChucVu.SelectedValue = user.IDChucVu; DropBoPhan.Enabled = false; } string strNgonngu = (string)Session["languege"]; if (strNgonngu != null) { LayngonNgu(20, strNgonngu); } else { Response.Redirect("http://portal.footgear.com.vn"); } GanNgonNguVaoConTrol(); }
private void HienThi() { string idphieu = Session["maphieu"].ToString(); //string bophan = Session["bophan"].ToString(); //string noidung = Session["noidung"].ToString(); //string ngaytao = Session["ngaythang"].ToString(); string user = Session["user"].ToString(); string bp = Session["bp"].ToString(); string congty = Session["congty"].ToString(); BDepartment bophan = BDepartmentBUS.TimMaDonVi(bp, congty); //string loaiphieu = Session["loaiphieu"].ToString(); pdna phieu = pdnaBUS.TimVanBanTheoMa(idphieu, congty, true); abill loaiphieu = abillBUS.SearchAbillByID(phieu.Abtype); string tenloaiphieuVN = loaiphieu.abname; string tenloaiphieuTW = loaiphieu.abnameTW; lbLoaiPhieu.Text = tenloaiphieuVN + " " + tenloaiphieuTW; // lbBoPhan.Text = bophan; // lbNoiDung.Text = phieu.pdmemovn.ToString(); // lbNgay.Text =Convert.ToString(phieu.CFMDate0); // Buser users = UserBUS.TimMaNhanVienTheoBoPhan(user, bp); lblTieuDe.Text = phieu.mytitle + phieu.pdnsubject; lbldonvidenghi.Text = bophan.DepName; lbSoPhieu.Text = idphieu; lblMucDichSuDung.Text = phieu.UseIntent; //lbNgay.Text = phieu.CFMDate0.ToString(); string dinhdang = phieu.CFMDate0.ToString(); string thang = dinhdang.Substring(3, 2); string ngay = dinhdang.Substring(0, 2); string nam = dinhdang.Substring(6, 4); lblNgaytao.Text = "Ngày 日 " + ngay + " Tháng 月 " + thang + " Năm 年 " + nam + ""; Busers2 user0 = AbconBUS.LayMaNguoiTaoTheoIDVanBan(idphieu, congty); if (user0 != null) { TextBox1.Text = user0.USERID; //ImageLevel0.ImageUrl = users.signatue; ImageLevel0.Width = 100; ImageLevel0.Height = 100; ImageLevel0.ImageUrl = "~/MyPhoto.ashx?USERID=" + TextBox1.Text; } }
private void HienThi() { string idphieu = Session["maphieu"].ToString(); string user = Session["user"].ToString(); //string bp = Session["bp"].ToString(); string congty = Session["congty"].ToString(); //pdna phieu = pdnaBUS.TimVanBanTheoMa(idphieu, congty, true); DataTable dt = dalPDN.TimPhieuTheoMaPhieu(idphieu, congty); if (dt.Rows.Count > 0) { string madonvi = dt.Rows[0]["pddepid"].ToString(); string maloaip = dt.Rows[0]["Abtype"].ToString(); int dout = int.Parse(dt.Rows[0]["ABC"].ToString()); BDepartment bophan = BDepartmentBUS.TimMaDonVi(madonvi, congty); abill loaiphieu = abillBUS.SearchAbillByID(maloaip); string tenloaiphieuVN = loaiphieu.abname; string tenloaiphieuTW = loaiphieu.abnameTW; lbLoaiPhieu.Text = tenloaiphieuVN + " " + tenloaiphieuTW; lbldonvidenghi.Text = bophan.DepName; lbSoPhieu.Text = idphieu; lblMucDichSuDung.Text = dt.Rows[0]["UseIntent"].ToString(); lblTieuDe.Text = dt.Rows[0]["mytitle"].ToString() + "-" + dt.Rows[0]["pdnsubject"].ToString(); //lbNgay.Text = phieu.CFMDate0.ToString(); string dinhdang = dt.Rows[0]["CFMDate0"].ToString(); string thang = dinhdang.Substring(3, 2); string ngay = dinhdang.Substring(0, 2); string nam = dinhdang.Substring(6, 4); lblNgaytao.Text = "Ngày 日 " + ngay + " Tháng 月 " + thang + " Năm 年 " + nam + ""; } Busers2 user0 = AbconBUS.LayMaNguoiTaoTheoIDVanBan(idphieu, congty); if (user0 != null) { TextBox1.Text = user0.USERID; //ImageLevel0.ImageUrl = users.signatue; ImageLevel0.Width = 100; ImageLevel0.Height = 100; ImageLevel0.ImageUrl = "~/MyPhoto.ashx?USERID=" + TextBox1.Text; } }
protected void Page_Load(object sender, EventArgs e) { string IDUser = (string)Request["UserID"]; string cty = (string)Request["congty"]; string lang = (string)Request["languege"]; if (IDUser != null && cty != null && lang != null) { Session["UserID"] = IDUser; Session["user"] = IDUser; Session["congty"] = cty; Session["languege"] = lang; } string UserID = (string)Session["UserID"]; string user = (string)Session["UserID"]; if (user == null || UserID == null) { Response.Redirect("http://portal.footgear.com.vn/"); } string macongty = Session["congty"].ToString(); string manguoidung = Session["user"].ToString(); txtUserID.Text = manguoidung; DropCongTy.SelectedValue = macongty; Busers2 nguoidung = UserDAO.TimNhanVienTheoMa(manguoidung, macongty); if (nguoidung != null) { txtEmail.Text = nguoidung.EMAIL; } else { return; } string strNgonngu = (string)Session["languege"]; if (strNgonngu != null) { LayngonNgu(28, strNgonngu); } else { Response.Redirect("http://portal.footgear.com.vn"); } GanNgonNguVaoConTrol(); }
public static Busers2 NVQuenMatKhau(string account, string email, string macongty, bool kiemTraBiXoa = true) { Busers2 nNV = new Busers2(); try { if (kiemTraBiXoa) { nNV = db.Busers2s.Where(nv => nv.USERID == account && nv.EMAIL == email && nv.GSBH == macongty).FirstOrDefault(); // var nNV=(from p in db.Busers.where(p=>p.USERID==account && p.EMAIL== email && p.bixoa==false ) select p.USERID); //var nNV = from q in db.Busers where (q.USERID == account && q.EMAIL == email && q.bixoa == false) select q; //return nNV.FirstOrDefault(); } else { nNV = db.Busers2s.Where(nv => nv.USERID == account && nv.EMAIL == email).FirstOrDefault(); //var nNV = from q in db.Busers where (q.USERID == account && q.EMAIL == email ) select q; //return nNV.FirstOrDefault(); } return(nNV); //int kiemtra = db.Busers.Where(p => p.EMAIL == email).Count(); //if (kiemtra > 0) //{ // Buser j = db.Busers.Where(p => p.EMAIL == email && p.USERID==account).First(); // GuiMail mail = new GuiMail(); // string bodymail = mail.BodyMail_LayLaiMatKhau(Email, j.MatKhau); // string ThongBao = mail.Send("Lấy lại mật khẩu", bodymail, Email, true, true); // ViewBag.ThongBao = ThongBao; //} //else //{ // ViewBag.ThongBao = "Email không đúng! Vui lòng nhập lại!"; //} } catch (Exception) { return(null); } finally { if (db != null) { db.ToString(); } } }
private void hienthi() { string macongty = Session["congty"].ToString(); string manguoidung = Session["user"].ToString(); List <Abcon> Captruoc = AbconBUS.LayCapDuyetTruocCuaNhanVienTheoChiTiet(manguoidung); Abcon capdangduyet = AbconBUS.LayCapDuyetCuaNhanVien(manguoidung); int buoctruoc = capdangduyet.Abstep - 1; string nguoiduyet = Session["user"].ToString(); Busers2 suer = UserBUS.TimNhanVienTheoMa(nguoiduyet, macongty); GridView2.DataSource = db.QryVanBanDenChuaDuyetTheoNguoiDuyet(manguoidung, buoctruoc); GridView2.DataBind(); //string maphieu = row.Cells[1].Text; //Session["maphieu"] = maphieu; }
public static bool ChangePasswordSendUser(string account, string email, bool kiemTraBiXoa = true) { //string MatKhauMoi = ""; Busers2 nNV = new Busers2(); try { if (kiemTraBiXoa) { nNV = db.Busers2s.Where(nv => nv.USERID == account && nv.EMAIL == email).FirstOrDefault(); if (nNV == null) { if (db != null) { db.ToString(); } return(false); } else { //nNV.PWD = pass; //db.SubmitChanges(); if (db != null) { db.ToString(); } return(true); } } else { return(false); } } catch (Exception) { return(false); } finally { if (db != null) { db.ToString(); } } }
public static bool CapNhatNguoiDung(Busers2 user) { try { Busers2 u = new Busers2(); u = db.Busers2s.Where(p => p.USERID == user.USERID && p.GSBH == user.GSBH).FirstOrDefault(); { u.USERID = user.USERID; u.GSBH = user.GSBH; u.signatue = user.signatue; } db.SubmitChanges(); return(true); } catch (Exception) { return(false); } }
public static bool DeleteUser(string id, bool checkdel) { try { if (checkdel) { Busers2 user = new Busers2(); user = db.Busers2s.Where(p => p.USERID.Equals(id)).FirstOrDefault(); user.bixoa = true; } return(true); } catch (Exception) { return(false); } }
public List <string> CapNhatChiTietDuyet(Abcon chMax, bool duyet, string ghichu, bool barCode = false) { try { List <string> kqua = new List <string>(); DateTime date = DateTime.Now; Busers2 nv_mbm = UserDAO.TimKiemNhanVien_MaBaoMatTheoIDNhanVien(chMax.Auditor); string chuoimahoa = null; string st = null; string ngaythang = null; string gio = null; if (nv_mbm != null) { st = nv_mbm.Password2; ngaythang = DateTime.Parse(date.ToShortDateString()).ToString("dd/MM/yyyy"); gio = DateTime.Parse(date.ToLongTimeString()).ToString("HH:mm:ss"); chuoimahoa = ngaythang + "*" + gio + "*" + chMax.pdno + "*" + chMax.Auditor; kqua.Add(st); kqua.Add(chuoimahoa); kqua.Add(ngaythang); kqua.Add(gio); } else { return(null); } chMax.abrult = duyet; if (duyet) { chMax.abmomo += String.Format("{0} {1}: {2} - [DUYỆT] {3} ", Environment.NewLine, DateTime.Now.ToString("HH:mm dd/MM/yyyy"), Environment.NewLine, ghichu); //InsertChuKy(chMax.VanBan_CapDuyet.VanBan.DuongDanGoc, duyet, "LEANERPCK" + (chMax.VanBan_CapDuyet.IdCapDuyet < 9 ? "0" : "") + chMax.VanBan_CapDuyet.IdCapDuyet, chMax.VanBan_CapDuyet.VanBan.LoaiFile, chMax.VanBan_CapDuyet.VanBan.DuongDanXuLy, chMax.NhanVien.ChuKy, EncryptionChuoi(chuoimahoa, st), barCode); } else { chMax.abmomo += String.Format("{0} {1}: {2} - [KHÔNG DUYỆT] {3} ", Environment.NewLine, DateTime.Now.ToString("HH:mm dd/MM/yyyy"), Environment.NewLine, ghichu); } return(kqua); } catch (Exception ex) { Until.WriteFileLogServer("Excep\t CapNhatChiTietDuyet: " + ex); return(null); } }
protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e) { DropDownList DropCty = GridView1.Rows[e.RowIndex].Cells[1].Controls[0] as DropDownList; DropDownList DropBoPhan = GridView1.Rows[e.RowIndex].Cells[2].Controls[0] as DropDownList; //TextBox txtMaNV = GridView1.Rows[e.RowIndex].Cells[3].Controls[0] as TextBox; TextBox txtTenNV = GridView1.Rows[e.RowIndex].Cells[4].Controls[0] as TextBox; TextBox txtChuKy = GridView1.Rows[e.RowIndex].Cells[5].Controls[0] as TextBox; string MaNV = (string)GridView1.DataKeys[e.RowIndex].Value; Busers2 user = db.Busers2s.Where(p => p.USERID == MaNV).FirstOrDefault(); user.USERID = MaNV; user.USERNAME = txtTenNV.Text; user.GSBH = DropCty.Text; user.BADEPID = DropBoPhan.Text; // user.signatue = txtChuKy.Text; db.SubmitChanges(); GridView1.EditIndex = -1; HienThiDanhSach(); }
protected void LinkNoOk_Click(object sender, EventArgs e) { string macongty = (string)Session["congty"]; string manhanvien = (string)Session["user"]; if (macongty == null && manhanvien == null) { Response.Redirect("http://" + linkWebPortal + "/"); } else { Busers2 nhanvien = UserBUS.TimNhanVienTheoMa(manhanvien, macongty); if (nhanvien.isSep == true) { Response.Redirect("danhsachphieubanguikhongduocduyet.aspx"); } else { Response.Redirect("danhsachvanbankhongduockyNV.aspx"); } } }
protected void btnHuy_Click(object sender, EventArgs e) { string user = (string)Session["user"]; string cty = (string)Session["congty"]; if (user == null) { Response.Redirect("http://portal.footgear.com.vn/"); } else { Busers2 nguoidung = UserDAO.TimNhanVienTheoMa(user, cty); if (nguoidung != null && nguoidung.Admin == true) { Response.Redirect("~/presentationLayer/Admin/frmAddUsers.aspx"); } else { if (nguoidung != null && nguoidung.isSep == true) { Response.Redirect("~/presentationLayer/ApproveUser/DanhSachVanBanDen.aspx"); } else { if (nguoidung.BADEPID == "VTY0501D") { Response.Redirect("~/presentationLayer/NguoiDich/danhsachphieuchuadich.aspx"); } else { Response.Redirect("~/presentationLayer/Users/Home.aspx"); } } } } }