public void HienThiNguoiQuanLyTrucTiep() { string UserID = (string)Session["UserID"]; string GSBH = (string)Session["congty"]; DataTable dt = dalUSer.TimNhanVienTheoMa(GSBH, UserID); if (dt.Rows.Count > 0) { txtsLeaderid.Text = dt.Rows[0]["USERID"].ToString(); lblFulName.Text = dt.Rows[0]["USERNAME"].ToString(); } }
public Stream ShowEmpImage(string id, string macongty) { //var r = (from a in db.Busers2s where a.USERID == id && a.GSBH==macongty select a).First(); //return new MemoryStream(r.signatue.ToArray()); DataTable dt = dal.TimNhanVienTheoMa(macongty, id); Byte[] image = (Byte[])dt.Rows[0]["signatue"]; return(new MemoryStream(image)); }
public void HienThiListTimTuTextBox() { string MaNV = txtKeySearch.Text; DataTable dt = dalUser.TimNhanVienTheoMa(congty, MaNV); if (dt.Rows.Count > 0) { lsbUserTim.Visible = true; lbsUserXuLy.Visible = true; lsbUserTim.DataSource = dt; lsbUserTim.DataBind(); } }
public void HienThiBaoCaoProject() { try { string UserID = (string)Request["UserID"]; DataTable dt = dalUser.TimNhanVienTheoMa(congty, UserID); string Us = ""; if (dt.Rows.Count > 0) { Us = dt.Rows[0]["USERNAME"].ToString(); } else { Us = UserID; } string homnay = DateTime.Today.ToString("ddMMyyyy"); string chuoi = Us + '_' + homnay; string FromDate = (string)Request["FromDate"]; string ToDate = (string)Request["ToDate"]; DateTime pFromDate = DateTime.Parse(FromDate.ToString()); DateTime pToDate = DateTime.Parse(ToDate.ToString()); List <string> Path = new List <string>(); Path.Add(@"~/Report/crtBaoCaoChuyenAnExcel.rpt"); Hashtable htb = new Hashtable(); DataSet ds = new DataSet(); htb.Add("UserID", UserID); htb.Add("FromDate", pFromDate.ToString("dd/MM/yyyy")); htb.Add("ToDate", pToDate.ToString("dd/MM/yyyy")); ds = dalSystem.XuatBaoCaoTheoNgayThang(UserID, pFromDate, pToDate); if (ds.Tables.Count > 0) { ShowExecl(Path, ds, htb, chuoi); } } catch (Exception) { throw; } }
public void HienThiListTimTuTextBox() { string MaNV = txtUserName.Text; DataTable dt = dalUser.TimNhanVienTheoMa(congty, MaNV); if (dt.Rows.Count > 0) { txtUserName.Text = dt.Rows[0]["USERID"].ToString(); txtFullName.Text = dt.Rows[0]["USERNAME"].ToString(); } else { txtFullName.Text = ""; } }
protected void LayTenNhanVien() { try { string NhanVienMa = Request.Headers["NhanVienMa"].ToString(); DataTable dt = dal.TimNhanVienTheoMa(congty, NhanVienMa); if (dt.Rows.Count > 0) { string TenNhanVien = dt.Rows[0]["UserName"].ToString(); Response.Write(TenNhanVien); } } catch { Response.Write("Error!"); } }
public void HienThiBaoCaoJobTuan() { try { string UserID = (string)Request["UserID"]; DataTable dt = dalUser.TimNhanVienTheoMa(congty, UserID); string Us = ""; if (dt.Rows.Count > 0) { Us = dt.Rows[0]["USERNAME"].ToString(); } else { Us = UserID; } string homnay = DateTime.Today.ToString("ddMMyyyy"); string chuoi = Us + '_' + homnay; string FromDate = (string)Request["FromDate"]; string ToDate = (string)Request["ToDate"]; DateTime pFromDate = DateTime.Parse(FromDate.ToString()); DateTime pToDate = DateTime.Parse(ToDate.ToString()); List <string> Path = new List <string>(); string pathA = ConfigurationManager.AppSettings["attactFile"].ToString(); string pathServer = pathA + @"\crtBaoCaoTuan_Excel.rpt"; // Path.Add("~/presentationLayer/Report/crtBaoCaoTuan_Excel.rpt"); // Path.Add("http://192.168.11.6:8000/presentationLayer/Report/crtBaoCaoTuanExcel1.rpt"); Path.Add("~/Report/crtBaoCaoTuanExcel.rpt"); Hashtable htb = new Hashtable(); DataSet ds = new DataSet(); htb.Add("UserID", UserID); htb.Add("FromDate", pFromDate.ToString("yyyy/MM/dd")); htb.Add("ToDate", pToDate.ToString("yyyy/MM/dd")); ds = dalCalendar.XuatBaoCaoCongViecTheoNgayThang(UserID, pFromDate, pToDate); if (ds.Tables.Count > 0) { ShowExecl(Path, ds, htb, chuoi); } } catch (Exception) { throw; } }
protected void Page_Load(object sender, EventArgs e) { if (!this.IsPostBack) { string UserID = (string)Session["UserID"]; if (UserID == null) { Response.Redirect("Default.aspx"); } else { DataTable dtUs = dalUser.TimNhanVienTheoMa(macongty, UserID); if (dtUs.Rows.Count > 0) { lblNhanVien.Text = dtUs.Rows[0]["USERNAME"].ToString(); } } } }
public void HienThiListTimTuTextBox() { string MaNV = txtUserName.Text; DataTable dt = dalUser.TimNhanVienTheoMa(Congty, MaNV); if (dt.Rows.Count > 0) { ListQuery.Visible = true; listXuLy.Visible = true; ListQuery.DataSource = dt; ListQuery.DataBind(); DivList.Visible = true; } else { ListQuery.DataSource = null; ListQuery.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { string macongty = (string)Session["congty"]; string manhanvien = (string)Session["user"]; if (manhanvien == null && macongty == null) { Response.Redirect("http://" + linkWebPortal + "/"); } DataTable dt = dal.TimNhanVienTheoMa(macongty, manhanvien); if (dt.Rows.Count > 0) { lblNhanVien.Text = dt.Rows[0]["USERNAME"].ToString(); } LayngonNgu(19); GanNgonNguVaoConTrol(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { txtDate.Text = DateTime.Today.ToString("dd-MM-yyyy"); string pTuNgay = (string)Session["TuNgay1"]; string pDenNgay = (string)Session["DenNgay1"]; if (pTuNgay != null && pDenNgay != null) { txtFromDate.Text = DateTime.Parse(pTuNgay).ToString("yyyy/MM/dd"); txtToDate.Text = DateTime.Parse(pDenNgay).ToString("yyyy/MM/dd"); } else { DataTable dt = dal.GetDate(); string date = dt.Rows[0]["NgayThang"].ToString(); DateTime a = DateTime.Parse(date.ToString()); txtFromDate.Text = a.ToString("yyyy/MM/dd"); txtToDate.Text = DateTime.Now.ToString("yyyy/MM/dd"); } string macongty = (string)Session["congty"]; string manhanvien = (string)Session["user"]; if (manhanvien == null && macongty == null) { Response.Redirect("http://" + linkWebPortal + "/"); } else { DataTable dtUs = dalUser.TimNhanVienTheoMa(macongty, manhanvien); if (dtUs.Rows.Count > 0) { lblNhanVien.Text = dtUs.Rows[0]["USERNAME"].ToString(); } LayNgonNgu(18); GanNgonNguVaoConTrol(); } } }
protected void Page_Load(object sender, EventArgs e) { txtDate.Text = DateTime.Today.ToString("yyyy-MM-dd"); string macongty = (string)Session["congty"]; string manhanvien = (string)Session["user"]; if (manhanvien == null && macongty == null) { Response.Redirect("http://portal.footgear.com.vn/"); } LayNgonNgu(18); GanNgonNguVaoControl(); if (!IsPostBack) { string pTuNgay = (string)Session["TuNgay1"]; string pDenNgay = (string)Session["DenNgay1"]; if (pTuNgay != null && pDenNgay != null) { txtFromDate.Text = DateTime.Parse(pTuNgay).ToString("yyyy/MM/dd"); txtToDate.Text = DateTime.Parse(pDenNgay).ToString("yyyy/MM/dd"); } else { DataTable dt = dal.GetDate(); string date = dt.Rows[0]["NgayThang"].ToString(); DateTime a = DateTime.Parse(date.ToString()); txtFromDate.Text = a.ToString("yyyy/MM/dd"); txtToDate.Text = DateTime.Now.ToString("yyyy/MM/dd"); } CheckNoOk.Checked = true; CheckOk.Checked = true; checkWaitMe.Checked = true; DataTable dtUs = dalUser.TimNhanVienTheoMa(macongty, manhanvien); if (dtUs.Rows.Count > 0) { lblNhanVien.Text = dtUs.Rows[0]["USERNAME"].ToString(); } string cbOk = (string)Session["cbok"]; string cbwait = (string)Session["cbwait"]; string cbNoOk = (string)Session["cbnook"]; if (cbNoOk == null && cbOk == null && cbwait == null) { CheckNoOk.Checked = true; CheckOk.Checked = true; checkWaitMe.Checked = true; } else { if (cbwait == "true") { checkWaitMe.Checked = true; } else { checkWaitMe.Checked = false; } if (cbOk == "true") { CheckOk.Checked = true; } else { CheckOk.Checked = false; } if (cbNoOk == "true") { CheckNoOk.Checked = true; } else { CheckNoOk.Checked = false; } } } }
public void HienThiDanhSach() { string ngonngu = Session["languege"].ToString(); string congty = "LTY"; int YnDuyet; int YnKhongDuyet; if (cbOk.Checked == true) { YnDuyet = 8; } else { YnDuyet = 9; } if (cbNoOk.Checked == true) { YnKhongDuyet = 2; } else { YnKhongDuyet = 9; } string fromdate = txtFromDate.Text.Trim(); string todate = txtToDate.Text.Trim(); if (txtTimKiem.Text.Trim() == "") { if (ngonngu == "lbl_VN") { DataTable dt = dal.AdminTimKiemDanhSachPhieuTheoAllUser(congty, YnDuyet, YnKhongDuyet, fromdate, todate); if (dt.Rows.Count > 0) { divGrid1.Visible = true; divGrid2.Visible = false; GridView1.DataSource = dt; GridView1.DataBind(); Session["UserIDTK"] = "All"; } } else { if (ngonngu == "lbl_TW") { DataTable dt = dal.AdminTimKiemDanhSachPhieuTheoAllUserTW(congty, YnDuyet, YnKhongDuyet, fromdate, todate); if (dt.Rows.Count > 0) { divGrid2.Visible = true; divGrid1.Visible = false; GridView2.DataSource = dt; GridView2.DataBind(); Session["UserIDTK"] = "All"; } } else { DataTable dt = dal.AdminTimKiemDanhSachPhieuTheoAllUser(congty, YnDuyet, YnKhongDuyet, fromdate, todate); if (dt.Rows.Count > 0) { divGrid1.Visible = true; divGrid2.Visible = false; GridView1.DataSource = dt; GridView1.DataBind(); Session["UserIDTK"] = "All"; } } } } else { string UserIDTK = txtTimKiem.Text.Trim(); DataTable dtUser = dalUser.TimNhanVienTheoMa(congty, UserIDTK); if (dtUser.Rows.Count > 0) { if (ngonngu == "lbl_VN") { DataTable dt = dal.AdminTimKiemDanhSachPhieuTheoUser(UserIDTK, congty, YnDuyet, YnKhongDuyet, fromdate, todate); if (dt.Rows.Count > 0) { divGrid1.Visible = true; divGrid2.Visible = false; GridView1.DataSource = dt; GridView1.DataBind(); Session["UserIDTK"] = UserIDTK; } } else { if (ngonngu == "lbl_TW") { DataTable dt = dal.AdminTimKiemDanhSachPhieuTheoUserTW(UserIDTK, congty, YnDuyet, YnKhongDuyet, fromdate, todate); if (dt.Rows.Count > 0) { divGrid2.Visible = true; divGrid1.Visible = false; GridView2.DataSource = dt; GridView2.DataBind(); Session["UserIDTK"] = UserIDTK; } } else { DataTable dt = dal.AdminTimKiemDanhSachPhieuTheoUser(UserIDTK, congty, YnDuyet, YnKhongDuyet, fromdate, todate); if (dt.Rows.Count > 0) { divGrid1.Visible = true; divGrid2.Visible = false; GridView1.DataSource = dt; GridView1.DataBind(); Session["UserIDTK"] = UserIDTK; } } } Session["fromdate"] = fromdate; Session["todate"] = todate; Session["YnDuyet"] = YnDuyet.ToString(); Session["YnKhongDuyet"] = YnKhongDuyet.ToString(); } else { lblThongBao.Text = "UserID incorect, please try again!"; } } }
protected void Page_Load(object sender, EventArgs e) { // txtDate.Text = DateTime.Now.ToString("dd-MM-yyyy"); string macongty = (string)Session["congty"]; string manhanvien = (string)Session["user"]; if (manhanvien == null && macongty == null) { Response.Redirect("http://" + linkWebPortal + "/"); } LayNgonNgu(18); GanNgonNguyVaoControl(); if (!IsPostBack) { string pTuNgay = (string)Session["TuNgay"]; string pDenNgay = (string)Session["DenNgay"]; if (pTuNgay != null && pDenNgay != null) { txtFromDate.Text = DateTime.Parse(pTuNgay).ToString("yyyy/MM/dd"); txtToDate.Text = DateTime.Parse(pDenNgay).ToString("yyyy/MM/dd"); } else { DataTable dt = dal.GetDate(); string date = dt.Rows[0]["NgayThang"].ToString(); DateTime a = DateTime.Parse(date.ToString()); txtFromDate.Text = a.ToString("yyyy/MM/dd"); txtToDate.Text = DateTime.Now.ToString("yyyy/MM/dd"); } DataTable dtUs = dalUser.TimNhanVienTheoMa(macongty, manhanvien); if (dtUs.Rows.Count > 0) { lblNhanVien.Text = dtUs.Rows[0]["USERNAME"].ToString(); } string chuadich = (string)Session["cChuaDich"]; string dadich = (string)Session["cDaDich"]; string dagui = (string)Session["cDaGui"]; string daky = (string)Session["cDaKy"]; string khongky = (string)Session["cKhongKy"]; string nhap = (string)Session["cNhap"]; string TraVe = (string)Session["checkTraVe"]; if (chuadich == null && dadich == null && dagui == null && daky == null && khongky == null && nhap == null) { checkDaGui.Checked = true; checkNhap.Checked = true; CheckNoOk.Checked = true; checkNotYetTrans.Checked = true; CheckOk.Checked = true; CheckTranslated.Checked = true; CheckTraVe.Checked = true; } else { if (chuadich == "True") { checkNotYetTrans.Checked = true; } else { checkNotYetTrans.Checked = false; } if (dadich == "True") { CheckTranslated.Checked = true; } else { CheckTranslated.Checked = false; } if (dagui == "True") { checkDaGui.Checked = true; } else { checkDaGui.Checked = false; } if (daky == "True") { CheckOk.Checked = true; } else { CheckOk.Checked = false; } if (khongky == "True") { CheckNoOk.Checked = true; } else { CheckNoOk.Checked = false; } if (nhap == "True") { checkNhap.Checked = true; } else { checkNhap.Checked = false; } if (TraVe == "True") { CheckTraVe.Checked = true; } else { CheckTraVe.Checked = false; } } } }