protected void Button1_Click1(object sender, EventArgs e)
 {
     try
     {
         ClassDataManager v = new ClassDataManager();
         v.AddMedicine(TextBox1.Text, TextBox2.Text, TextBox3.Text, double.Parse(Label6.Text));
         Response.Redirect("AddMedicine.aspx?AdminID=" + double.Parse(Label6.Text));
         //Response.Redirect("AddMedicine.aspx?AdminID=" + double.Parse(Label6.Text));
     }
     catch (Exception)
     {
         Response.Redirect("AddMedicine.aspx?AdminID=" + double.Parse(Label6.Text));
     }
 }
Ejemplo n.º 2
0
    protected void btnsave_Click(object sender, EventArgs e)
    {
        TextBox txtdrug    = ArticleMedicine.ContentPlaceholder.Controls[0].FindControl("txtdrug") as TextBox;
        TextBox txtgeneric = ArticleMedicine.ContentPlaceholder.Controls[0].FindControl("txtgeneric") as TextBox;
        TextBox txtbrand   = ArticleMedicine.ContentPlaceholder.Controls[0].FindControl("txtbrand") as TextBox;

        double txtdrugcount    = double.Parse(txtdrug.Text.Length.ToString());
        double txtgenericcount = double.Parse(txtgeneric.Text.Length.ToString());
        double txtbrandcount   = double.Parse(txtbrand.Text.Length.ToString());

        try
        {
            ClassDataManager v          = new ClassDataManager();
            Label            lblAdminID = ArticleMedicine.ContentPlaceholder.Controls[0].FindControl("lblAdminID") as Label;
            v.AddMedicine(txtdrug.Text, txtgeneric.Text, txtbrand.Text, double.Parse(lblAdminID.Text));
            Response.Redirect("AddMedicine.aspx?");
        }
        catch (Exception)
        {
            Response.Redirect("AddMedicine.aspx");
        }
    }
Ejemplo n.º 3
0
    protected void btnsave_Click(object sender, EventArgs e)
    {
        TextBox txtdrug = ArticleMedicine.ContentPlaceholder.Controls[0].FindControl("txtdrug") as TextBox;
        TextBox txtgeneric = ArticleMedicine.ContentPlaceholder.Controls[0].FindControl("txtgeneric") as TextBox;
        TextBox txtbrand = ArticleMedicine.ContentPlaceholder.Controls[0].FindControl("txtbrand") as TextBox;

        double txtdrugcount = double.Parse(txtdrug.Text.Length.ToString());
        double txtgenericcount = double.Parse(txtgeneric.Text.Length.ToString());
        double txtbrandcount = double.Parse(txtbrand.Text.Length.ToString());

        try
        {

            ClassDataManager v = new ClassDataManager();
            Label lblAdminID = ArticleMedicine.ContentPlaceholder.Controls[0].FindControl("lblAdminID") as Label;
            v.AddMedicine(txtdrug.Text, txtgeneric.Text, txtbrand.Text, double.Parse(lblAdminID.Text));
            Response.Redirect("AddMedicine.aspx?");

        }
        catch (Exception)
        {
            Response.Redirect("AddMedicine.aspx");
        }
    }