public List <LichsucongtacEntity> LichsucongtacGetByPK(long lichsucongtacID)
        {
            List <LichsucongtacEntity> glstLichsucongtac = new List <LichsucongtacEntity>();

            cnn.Open();
            using (SqlCommand cmd = new SqlCommand("spXemdanhsachLichsucongtac", cnn))
            {
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@PK_iLichsucongtacID", lichsucongtacID);
                SqlDataReader dar = cmd.ExecuteReader();
                if (dar.HasRows)
                {
                    while (dar.Read())
                    {
                        LichsucongtacEntity lichsucongtac = new LichsucongtacEntity();
                        lichsucongtac.PK_iLichsucongtacID = Convert.ToInt64(dar["PK_iLichsucongtacID"]);
                        lichsucongtac.FK_iChucvuID        = Convert.ToInt64(dar["FK_iChucvuID"]);
                        lichsucongtac.FK_iBophanID        = Convert.ToInt64(dar["FK_iBophanID"]);
                        lichsucongtac.FK_iCanboID         = Convert.ToInt64(dar["FK_iCanboID"]);
                        lichsucongtac.TThoigianketthuc    = Convert.ToDateTime(dar["tThoigianketthuc"]);
                        glstLichsucongtac.Add(lichsucongtac);
                    }
                }
                cnn.Close();
                return(glstLichsucongtac);
            }
        }
        protected void rptLichsuCongtac_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                LichsucongtacEntity lichsucongtac = e.Item.DataItem as LichsucongtacEntity;
                if (lichsucongtac != null)
                {
                    Literal ltrBophan = e.Item.FindControl("ltrBophan") as Literal;
                    if (ltrBophan != null)
                    {
                        List <BophanEntity> glstBophan = (new BophanBRL()).GetBophanByPK(lichsucongtac.FK_iBophanID);
                        if (glstBophan.Count > 0)
                        {
                            ltrBophan.Text = glstBophan[0].STenBophan;
                        }
                    }

                    Literal ltrChucvu = e.Item.FindControl("ltrChucvu") as Literal;
                    if (ltrChucvu != null)
                    {
                        List <ChucvuEntity> gltsChucvu = (new ChucvuBRL().GetChucvuByPK(lichsucongtac.FK_iChucvuID));
                        if (gltsChucvu.Count > 0)
                        {
                            ltrChucvu.Text = gltsChucvu[0].STenChucvu;
                        }
                    }
                    Literal ltrCanbo = e.Item.FindControl("ltrCanbo") as Literal;
                    if (ltrCanbo != null)
                    {
                        List <CanboEntity> gltsCanbo = (new CanboBRL().GetCanboByPK(lichsucongtac.FK_iCanboID));
                        if (gltsCanbo.Count > 0)
                        {
                            ltrCanbo.Text = gltsCanbo[0].STenCanbo;
                        }
                    }
                }
            }
        }