Exemple #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["MaNV"] == null)
            {
                Response.Redirect("../Login");
            }
            else
            {
                var myStr = Session["user"] as String;
                userName.Controls.Add(new Literal {
                    Text = myStr.ToString()
                });
                if (!Page.IsPostBack)
                {
                    //string id = Session["MaNV"].ToString();
                    CongViecBUS service = new CongViecBUS();
                    //NhanVienBUS nvService = new NhanVienBUS();
                    List <CongViecNvDTO> list = service.GetAllCongViecPublic();
                    //NhanVienDTO partner = nvService.GetNhanVienById(id);
                    int count = 0;
                    foreach (CongViecNvDTO cv in list)
                    {
                        if (cv.IsVisible == true && cv.PhamVi == true)
                        {
                            count++;
                            table.Append("<tr>");
                            table.Append("<td>" + count + "</td>");
                            table.Append("<td>" + cv.Id + "</td>");
                            table.Append("<td>" + cv.TenCongViec + "</td>");
                            table.Append("<td>" + cv.IdPartner + "</td>");
                            table.Append("<td>" + cv.NgayBatDau + "</td>");

                            if (cv.NgayKetThuc == null)
                            {
                                table.Append("<td>" + "Không có" + "</td>");
                            }
                            else
                            {
                                table.Append("<td>" + cv.NgayKetThuc + "</td>");
                            }

                            table.Append("<td>" + "Public" + "</td>");
                            table.Append("<td>" + cv.FileDinhKem + "</td>");
                            table.Append("" + service.CheckStatusCv(cv.Status) + "");
                            //tableAppend(table, cv.Status);
                            table.Append("</tr>");
                        }
                    }

                    showCV.Controls.Add(new Literal {
                        Text = table.ToString()
                    });
                }
            }
        }
Exemple #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(Session["user"] as string))
            {
                var myStr = Session["user"] as String;
                userName.Controls.Add(new Literal {
                    Text = myStr.ToString()
                });
            }
            else
            {
                Response.Redirect("../Login.aspx");
            }
            string g = Request.QueryString["id"];//this value should be 23 now;

            Console.WriteLine(g.ToString());
            List <ChitTietCvDTO> list = services.getChiTiet(Convert.ToInt32(g));

            foreach (ChitTietCvDTO ctcv in list)
            {
                table.Append("<tr>"
                             + "<td>" + ctcv.idcongviec + "</td>"
                             + "<td>" + ctcv.TenCongViec + "</td>"
                             + "<td>" + ctcv.NgayBatDau + "</td>"
                             + "<td>" + ctcv.NgayKetThuc + "</td>"
                             + "<td>" + ctcv.PhamVi + "</td>"
                             + "<td> Ninh Ngọc Hiếu</td>"
                             + "<td>" + ctcv.Files + "</td>"
                             + "<td>" + ctcv.Comment + "</td>"
                             + cv.CheckStatusCv(ctcv.Status)//lay status cua cong viecc
                             + "<td>"
                             + "<a href='CapNhapCV.aspx?id=" + ctcv.idcongviec + "&idnv=" + ctcv.idnhanvien + "' class='btn btn-primary btn-icon-split'>"
                             + "<span class='text'>Sửa</span>"
                             + "</a>"
                             + "</td>"
                             + "</tr>");
            }
            ChitietCV.Controls.Add(new Literal {
                Text = table.ToString()
            });
        }