Exemple #1
0
 protected void btnInActive_Click(object sender, EventArgs e)
 {
     if (BALBlockedAppointments.InsertUpdateBlockAppointment("inactive", "0", "1/1/1900", "0", "0", "", ReturnIds(), -1, 1, chkIsClosed.Checked) == true)
     {
         ShowMessage("Record Deactivated succefully");
         FillGrid(1);
     }
     else
     {
         ShowMessage("Error in record deactivation.");
     }
 }
Exemple #2
0
    protected void imgbtn_Insert_Click(object sender, EventArgs e)
    {
        if (ValidateInput() == false)
        {
            Page.Validate("AddCategory");
            if (Page.IsValid == true)
            {
                string strDate        = txtblockcal.Text;
                string strFromTime    = ddlFrom.SelectedValue.ToString() + ":00 " + ddlFromAMPM.SelectedValue.ToString();
                string strToTime      = ddlTo.SelectedValue.ToString() + ":00 " + ddlToAMPM.SelectedValue.ToString();
                string strDescription = txtDescription.Text;
                int    iBranchName    = Convert.ToInt32(ddlBranchName.SelectedValue);

                if (string.IsNullOrEmpty(lblMode.Text))
                {
                    lblMode.Text = "0";
                    if (BALBlockedAppointments.InsertUpdateBlockAppointment("insert", lblMode.Text, strDate, strFromTime, strToTime, strDescription, ReturnIds(), 0, iBranchName, chkIsClosed.Checked) == true)
                    {
                        ShowMessage("Record Insert Susseccfully.");
                        FillGrid(1);
                        ClearInput();
                    }
                    else
                    {
                        ShowMessage("Error in record updation.");
                    }
                    lblMode.Text = string.Empty;
                }
                else
                {
                    if (BALBlockedAppointments.InsertUpdateBlockAppointment("update", lblMode.Text, strDate, strFromTime, strToTime, strDescription, ReturnIds(), 0, iBranchName, chkIsClosed.Checked) == true)
                    {
                        ShowMessage("Record Updated Susseccfully.");
                        FillGrid(1);
                        ClearInput();
                    }
                    else
                    {
                        ShowMessage("Error in record insertion.");
                    }
                    lblMode.Text = string.Empty;
                }
            }
            else
            {
                ShowMessage("Some Required Field Missing");
            }
        }
    }