protected void save()
    {
        DataTable Dtb = new DataTable();

        string[] stringdate1 = new string[3];
        if (TxtDueDate.Text != "")
        {
            stringdate1 = TxtDueDate.Text.Split('/');
        }
        else
        {
            stringdate1 = "01/01/1990".Split('/');
        }
        DateTime DueDate = new DateTime(Convert.ToInt32(stringdate1[2]), Convert.ToInt32(stringdate1[1]), Convert.ToInt32(stringdate1[0]));

        bool IsActive = chkActive.Checked == true ? true : false;

        if (HdnID.Value == "0")
        {
            Dtb = P.BookReturnDueDateEntry("INSERT", 0, Convert.ToInt32(ddlSemester.SelectedValue)
                                           , DueDate, TxtRemarks.Text, IsActive, Convert.ToInt32(Session["UserId"]), GetIPAddress());
        }
        else
        {
            Dtb = P.BookReturnDueDateEntry("UPDATE", Convert.ToInt32(HdnID.Value), Convert.ToInt32(ddlSemester.SelectedValue)
                                           , DueDate, TxtRemarks.Text, IsActive, Convert.ToInt32(Session["UserId"]), GetIPAddress());
        }
        if (Dtb.Rows.Count > 0)
        {
            if (Convert.ToInt32(Dtb.Rows[0][0]) > 0)
            {
                ClearData();
                BtnSave.Text = "SAVE";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Data saved succesfully!!');", true);
            }
        }

        //Session["Duedateforemail"] = DueDate;
    }