protected void btnAdd_Click(object sender, EventArgs e) { string TypeName = ""; string TypeDesc = ""; //Validation Assignment if (txtBloodType.Text.Trim().Length > 0) { TypeName = txtBloodType.Text.Trim(); } else { lblMsg.Text = "Enter Blood Type..."; } txtBloodType.Focus(); if (txtBloodDesc.Text.Trim().Length > 0) { TypeDesc = txtBloodDesc.Text.Trim(); } else { lblMsg.Text = "Enter Description..."; } txtBloodDesc.Focus(); //Calling Business Class BloodTypeBusinessLayer.InsertBloodType(TypeName, TypeDesc); lblMsg.Text = "Type Addded Successfully...!"; txtBloodType.Focus(); }
protected void Page_Load(object sender, EventArgs e) { if (Session["username"] == null) { Response.Redirect("~/Login.aspx"); } if (!IsPostBack) { DataSet ds3 = BloodTypeBusinessLayer.ShowBloodType(); DataSet ds4 = blood.ShowAllBloodGroup(); BindDDL(ddlBloodType, ds3, "TypeName", "BloodTypeID"); BindDDL(ddlBloodGroup, ds4, "BloodGroup", "BloodGroupID"); org.Username = Session["username"].ToString(); DataSet ds = new DataSet(); ds = org.GetAccountId(); AcId = ds.Tables[0].Rows[0][0].ToString(); org.Orgid = int.Parse(AcId); DataSet ds2 = new DataSet(); ds2 = org.ShowOrganizationAllDetail(); txtName.Text = ds2.Tables[0].Rows[0][0].ToString(); txtMail.Text = ds2.Tables[0].Rows[0][1].ToString(); txtPhone.Text = ds2.Tables[0].Rows[0][2].ToString(); txtCountry.Text = ds2.Tables[0].Rows[0][3].ToString(); txtState.Text = ds2.Tables[0].Rows[0][4].ToString(); txtCity.Text = ds2.Tables[0].Rows[0][5].ToString(); txtLocation.Text = ds2.Tables[0].Rows[0][6].ToString(); } }
protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e) { Label l; int BloodId = 0; l = (Label)GridView1.Rows[e.RowIndex].FindControl("lbltypeid"); BloodId = int.Parse(l.Text); BloodTypeBusinessLayer.DeleteBloodType(BloodId); ShowBloodType(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //ViewState["Password"] = txtPassword.Text; DataSet ds = AddCountry.GetCountryName(); DataSet ds1 = BloodTypeBusinessLayer.ShowBloodType(); DataSet ds2 = blood.ShowAllBloodGroup(); BindDDL(ddlCountry, ds, "CountryName", "CountryID"); ddlCountry.Items.Insert(0, "---Select---"); BindDDL(ddlBloodType, ds1, "TypeName", "BloodTypeID"); BindDDL(ddlBloodGroup, ds2, "BloodGroup", "BloodGroupID"); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DataSet ds = new DataSet(); ds = AddCountry.GetCountryName(); BindDDL(ddlCountry, ds, "CountryName", "CountryID"); ddlCountry.Items.Insert(0, "---Select---"); DataSet ds1 = BloodTypeBusinessLayer.ShowBloodType(); DataSet ds2 = group.ShowAllBloodGroup(); BindDDL(ddlBloodType, ds1, "TypeName", "BloodTypeID"); ddlBloodType.Items.Insert(0, "---Select---"); BindDDL(ddlBloodGroup, ds2, "BloodGroup", "BloodGroupID"); ddlBloodGroup.Items.Insert(0, "---Select---"); } }
protected void btnDelete_Click(object sender, EventArgs e) { foreach (GridViewRow gr in GridView1.Rows) { CheckBox chk; chk = (CheckBox)gr.FindControl("chkid"); if (chk.Checked == true) { Label l; l = (Label)gr.FindControl("lbltypeid"); int BloodId = 0; BloodId = int.Parse(l.Text); BloodTypeBusinessLayer.DeleteBloodType(BloodId); ShowBloodType(); } } }
protected void Page_Load(object sender, EventArgs e) { if (Session["username"] == null) { Response.Redirect("~/Login.aspx"); } if (!IsPostBack) { DataSet ds = AddCountry.GetCountryName(); BindDDL(ddlCountry, ds, "CountryName", "CountryID"); ddlCountry.Items.Insert(0, "---Select---"); DataSet ds1 = BloodTypeBusinessLayer.ShowBloodType(); DataSet ds2 = blood.ShowAllBloodGroup(); BindDDL(ddlBloodType, ds1, "TypeName", "BloodTypeID"); BindDDL(ddlBloodGroup, ds2, "BloodGroup", "BloodGroupID"); DataSet ds3 = new DataSet(); string Acid = Session["Acid"].ToString(); user.Accountid = int.Parse(Acid); ds3 = user.GetPersonalDetail(); ViewState["Url"] = ds3.Tables[0].Rows[0][15].ToString(); } LinkButton4.Attributes.Add("onclick", "javascript:showImg();"); LinkButton4.Attributes.Add("target", ""); string strScript; strScript = "<script>function showImg() {"; strScript += "var mywin=window.open('','Image','top=20,left=10,width=500,height=300,scrollbars=yes,resizable=yes,toolbar=no');"; strScript += "mywin.document.write('<title>BDA</title>');"; // strScript += "mywin.document.write('<img src=\"" + "../" + ConfigurationManager.AppSettings["MemberImage"].Replace("\\", "/") + ViewState["MemberIMAGE"].ToString() + "\">');";26005.jpg strScript += "mywin.document.write('<img src=\"" + "Images/" + ViewState["Url"].ToString() + "\">');"; // strScript += "mywin.document.write('<img src=\"" + "Donor/Images/" + "SFairytopia-Mermaidia-She.jpg" + "\">');"; strScript += "mywin.focus();}</script>"; Page.RegisterStartupScript("StartUp", strScript); }
public void ShowBloodType() { GridView1.DataSource = BloodTypeBusinessLayer.ShowBloodType(); GridView1.DataBind(); }