protected void btnsubmitcoaltype_Click(object sender, EventArgs e) { coalmaster coalmaster = new coalmaster(HttpContext.Current.Server.MapPath("~/XML/database.xml")); coalmaster.coalmaster_SRNO = -1; coalmaster.coalmaster_COALTYPEID = -1; coalmaster.coalmaster_COALTYPE = txtname.Text.Trim().ToString(); coalmaster.coalmaster_STATUS = 0; if (coalmaster.Insert(true, "coalmaster")) { MessageBox("Caol Type Added Successfully"); FillList(); } ScriptManager.RegisterStartupScript(this, this.GetType(), "msgadds", "showmaster();", true); }
protected void btnupdategrade_Click(object sender, EventArgs e) { coalmaster coalmaster = new coalmaster(HttpContext.Current.Server.MapPath("~/XML/database.xml")); coalmaster.coalmaster_SRNO = -1; coalmaster.coalmaster_COALTYPE = ddleditcoaltype.SelectedItem.Text.Trim().ToString(); coalmaster.coalmaster_COALTYPEID = General.Parse<int>(ddleditcoaltype.SelectedValue.Trim().ToString()); coalmaster.coalmaster_GRADE = txteditgrade.Text.Trim().ToString(); coalmaster.coalmaster_STATUS = General.Parse<int>(ddlgradestatus.SelectedValue.Trim().ToString()); string condition = "SRNO=" + ViewState["gradeid"].ToString(); if (coalmaster.Insert(false, "coalmaster", condition)) { MessageBox("Caol Grade Updated Successfully"); FillList(); } ScriptManager.RegisterStartupScript(this, this.GetType(), "msdsdssg4", "showmaster();", true); }