protected void grdHealth_ItemDatabound(object sender, DataGridItemEventArgs e)
 {
     if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
     {
         this.health = e.Item.DataItem as HealthCareInfo;
         ImageButton imgDelete = e.Item.FindControl("imgDelete") as ImageButton;
         if (imgDelete != null)
         {
             imgDelete.Attributes.Add("onClick", "javascript:return confirm('Bạn có muốn xóa');");
         }
         HyperLink hplName = e.Item.FindControl("hplName") as HyperLink;
         if (hplName != null)
         {
             hplName.Text        = objEmplyess.GetEmployees(this.health.employeeid).fullname;
             hplName.NavigateUrl = EditUrl("Id", this.health.id.ToString());
         }
         //Label lblEmployessName = e.Item.FindControl("lblEmployessName") as Label;
         //if (lblEmployessName != null)
         //{
         //    lblEmployessName.Text = objEmplyess.GetEmployees(this.family.employeeid).fullname;
         //}
         //Label lblFullName = e.Item.FindControl("lblFullName") as Label;
         //if (lblFullName != null)
         //{
         //    lblFullName.Text = this.family.fullname;
         //}
     }
 }
        protected void grdHealth_ItemCommand(object source, DataGridCommandEventArgs e)
        {
            int id = Int32.Parse(e.CommandArgument.ToString());


            if (e.CommandName == "Delete")
            {
                this.health = objHealth.GetHealthCare(id);
                objHealth.DeleteHealthCare(health);
                this.grdHealth.DataSource = objHealth.GetHealthCares();
                this.grdHealth.DataBind();
            }
        }
Exemple #3
0
 public override void DeleteHealthCare(HealthCareInfo objHealthCare)
 {
     SqlHelper.ExecuteNonQuery(ConnectionString, GetFullyQualifiedName("HRM_HealthCare1"), objHealthCare.id, objHealthCare.employeeid, objHealthCare.high, objHealthCare.weight, objHealthCare.ha, objHealthCare.otherresult, objHealthCare.conclusion, objHealthCare.testdate, objHealthCare.healthtype, objHealthCare.place, objHealthCare.editor, objHealthCare.modifieddate, objHealthCare.ip, 2);
 }
 public void UpdateHealthCare(HealthCareInfo objHealthCare)
 {
     DataProvider.Instance().UpdateHealthCare(objHealthCare);
 }
 public void DeleteHealthCare(HealthCareInfo objHealthCare)
 {
     DataProvider.Instance().DeleteHealthCare(objHealthCare);
 }
 public void AddHealthCare(HealthCareInfo objHealthCare)
 {
     DataProvider.Instance().AddHealthCare(objHealthCare);
 }
 public abstract void DeleteHealthCare(HealthCareInfo objHealthCare);
 public abstract void UpdateHealthCare(HealthCareInfo objHealthCare);
 public abstract void AddHealthCare(HealthCareInfo objHealthCare);