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");
            }
            if (!Page.IsPostBack)
            {
                CongViecBUS        service = new CongViecBUS();
                List <CongViecDTO> list    = service.GetAllCongViec();

                foreach (CongViecDTO cv in list)
                {
                    table.Append("<tr>");
                    table.Append("<td>" + cv.Id + "</td>");
                    table.Append("<td>" + cv.TenCongViec + "</td>");
                    table.Append("<td>" + service.getTenNvById(cv.Id) + "</td>");
                    table.Append("<td>" + cv.NgayBatDau + "</td>");
                    table.Append("<td>" + cv.NgayKetThuc + "</td>");
                    /* table.Append(service.CheckStatusCv(cv.Status));*/
                    table.Append("</tr>");
                }

                showCV.Controls.Add(new Literal {
                    Text = table.ToString()
                });
            }
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                CongViecBUS service = new CongViecBUS();
                string      idCv    = Request.QueryString["id"];
                string      idNV    = Request.QueryString["idnv"];
                //List<CongViecDTO> list = service.GetAllCongViecNVcv(idCv,idNV);

                /*foreach (CongViecDTO cv in list)
                 * {
                 *  table.Append("<option>" + cv.TenCongViec + "</option>");
                 * }
                 *
                 * getAllCV.Controls.Add(new Literal { Text = table.ToString() });*/
            }
            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");
            }
        }
Example #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            CongViecBUS service = new CongViecBUS();
            String      idcv    = Request.QueryString["id"];

            service.updateStatusById(idcv);
            Response.Redirect("./DanhSachCongViecNv.aspx");
        }
Example #4
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()
                    });
                }
            }
        }
Example #5
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            CongViecBUS service = new CongViecBUS();
            //Thêm công việc vào chỗ này
            string ten       = tenCongViec.Value;
            String timeStart = DateTime.Parse(dateStart.Value).ToString();
            String timeEnd   = DateTime.Parse(dateEnd.Value).ToString();
            String partner   = idPartner.Value;
            String phamvi    = phamVi.Value;

            // gọi hàm xử ly trên server
            Console.WriteLine(timeStart, ten + timeEnd + partner + phamVi);

            if (service.themCongViec(ten, timeStart, timeEnd, partner, phamvi))
            {
                Response.Redirect("./DanhSachCongViec.aspx");
            }
        }
Example #6
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            CongViecBUS service = new CongViecBUS();
            //Cập nhập công việc tại đây với quyên admin
            string idCv      = Request.QueryString["id"];
            string idNV      = Request.QueryString["idnv"];
            string dateEnd   = DateTime.Parse(dateE.Value).ToString();
            string dateStart = DateTime.Parse(dateS.Value).ToString();
            string comments  = comment.Value;

            Console.WriteLine(idCv, idNV, dateStart, dateE, comments);

            if (service.updatePCCV(idCv, idNV, dateStart, dateEnd, comments))
            {
                Response.Redirect("./chitietcongviec.aspx?id=" + idNV);
            }
            else
            {
                Response.Redirect("./CapNhatCV.aspx?id=" + idCv + "&idnv=" + idNV);
            }
        }
Example #7
0
 private void frmDangky_Load(object sender, EventArgs e)
 {
     cbxCongviec.DataSource    = CongViecBUS.Load_DSCV();
     cbxCongviec.DisplayMember = "ten_cv";
     cbxCongviec.ValueMember   = "ma_cv";
 }