protected void btnnew_Click(object sender, EventArgs e)
    {
        try
        {
            Boolean BoolIns = false;
            Whitfieldcore wIns = new Whitfieldcore();
            BoolIns = wIns.PopulateMasterMaterials(Convert.ToInt32(ddlType.SelectedItem.Value), txtRefNumber.Text.Trim(), txtDescription.Text.Trim(), "", "N", txtMemo.Text.Trim());
            if (BoolIns)
            {
                lblMsg.Text = "Material is added";
            }
            else
            {
                lblMsg.Text = "There is an error occured";
            }
            Response.Write("<script language='javascript'>parent.location.replace('master_materials.aspx');</script>");

        }
        catch (Exception exp)
        {
            Response.Write(exp.Message.ToString());
        }
    }