protected void btnAddMatter_Click(object sender, EventArgs e)
    {
        string Mode = "INSERT";

        if (ddlMatterNumber.SelectedIndex != 0)
        {
            if (ddlOfficeName.SelectedIndex != 0)
            {
                int Client_Name   = 0;
                int Assigened_ID  = 0;
                int superviser_ID = 0;
                int MatteType_ID  = 0;

                dt = MV.GetMatterDetails(ddlMatterNumber.SelectedValue);
                if (dt.Rows.Count > 0)
                {
                    Client_Name   = Convert.ToInt32(dt.Rows[0]["Client_Name"]);
                    Assigened_ID  = Convert.ToInt32(dt.Rows[0]["assigned_ID"]);
                    superviser_ID = Convert.ToInt32(dt.Rows[0]["superviser_ID"]);
                    MatteType_ID  = Convert.ToInt32(dt.Rows[0]["MatteType_ID"]);
                }
                try
                {
                    dt = MV.UniqueMatterNo(ddlMatterNumber.SelectedValue);
                    if (dt.Rows.Count > 0)
                    {
                        MyMessageBoxInfo.Show(MyMessageBox.MessageType.Info, "Matter Number Already Exist.", 125, 300);
                    }
                    else
                    {
                        int i = MV.MatterAction(ddlMatterNumber.SelectedValue, Client_Name, superviser_ID, Assigened_ID, MatteType_ID, Convert.ToDateTime(txtOpenDate.Text), txtMatterDiscription.Text, Convert.ToInt32(ddlOfficeName.SelectedValue), Mode);
                        if (i > 0)
                        {
                            int j = SV.AuditMatter(Convert.ToInt32(ddlMatterNumber.SelectedItem.ToString()), Mode, USERID);
                            ddlOfficeName.SelectedIndex   = 0;
                            ddlMatterNumber.SelectedIndex = 0;
                            MyMessageBoxInfo.Show(MyMessageBox.MessageType.Success, commessage.RecordSaved, 125, 300);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MyMessageBoxInfo.Show(MyMessageBox.MessageType.Error, ex.Message.ToString(), 125, 300);
                }
            }
            else
            {
                MyMessageBoxInfo.Show(MyMessageBox.MessageType.Info, "Please Select office.", 125, 300);
            }
        }
        else
        {
            MyMessageBoxInfo.Show(MyMessageBox.MessageType.Info, "Please Select Matter number.", 125, 300);
        }
    }