protected void btnSave_Click(object sender, EventArgs e) { taxmaster tax = new taxmaster(HttpContext.Current.Server.MapPath("~/XML/database.xml")); tax.taxmaster_SRNO = -1; tax.taxmaster_TAXNAME = txttaxname.Text; tax.taxmaster_TAXVALUE = Convert.ToDouble(txttaxvalue.Text); tax.taxmaster_TAXUNIT = ddlunit.SelectedValue.ToString(); tax.taxmaster_STATUS = 0; if (tax.Insert(true, "taxmaster")) { MessageBox("Tax Entry Added Successfully"); gettaxdetails(); } }
protected void btnedit_Click(object sender, EventArgs e) { taxmaster tax = new taxmaster(HttpContext.Current.Server.MapPath("~/XML/database.xml")); tax.taxmaster_SRNO = -1; tax.taxmaster_TAXNAME = txteditname.Text.Trim().ToString(); tax.taxmaster_TAXVALUE = Convert.ToDouble(txteditvalue.Text.Trim().ToString()); tax.taxmaster_TAXUNIT = ddleditunit.SelectedValue.ToString(); tax.taxmaster_STATUS = General.Parse<int>(ddlstatus.SelectedValue.ToString()); string condition = "SRNO=" + ViewState["tax"].ToString(); if (tax.Insert(false, "taxmaster", condition)) { MessageBox("Tax Entry Updated Successfully"); gettaxdetails(); } ScriptManager.RegisterStartupScript(this, this.GetType(), "Edit", "FillState();", true); }