protected void btnVerifyOTP_Click(object sender, EventArgs e)
    {
        int ComplaintNumber = Convert.ToInt32(txtComplaintNumber.Text);

        BusinessObjects.Complaint complaint = BusinessLogic.ComplaintBL.GetDetails(ComplaintNumber);

        if (txtOTP.Text == complaint.OTP)
        {
            complaint.ComplaintVerifiedViaOTP = true;
            complaint.CurrentStatusId         = 1;
            BusinessLogic.ComplaintBL.Update(complaint);
        }



        // Step 2

        BusinessObjects.ComplaintXStatus cxs = new BusinessObjects.ComplaintXStatus();
        cxs.ComplaintId      = complaint.Id;
        cxs.StatusId         = 1;
        cxs.StatusAssignTime = DateTime.Now;

        BusinessLogic.ComplaintXStatusBL.Add(cxs);

        // Step 3

        BusinessObjects.DepartmentXAreaOnDuty dxaod = BusinessLogic.DepartmentXAreaOnDutyBL.GetByTime(complaint.DepartmentId, DateTime.Now);

        BusinessObjects.OfficialXComplaintsAssigned oxca = new BusinessObjects.OfficialXComplaintsAssigned();
        oxca.ComplaintId = complaint.Id;
        oxca.OfficialId  = dxaod.OnDutyPersonId;
        oxca.AssignedOn  = DateTime.Now;
        oxca.IsEscalated = false;

        BusinessLogic.OfficialXComplaintsAssignedBL.Add(oxca);

        // Step 4

        // Send SMS to the per on duty
        // To send the SMS we will need the phone number of the official

        BusinessObjects.GovernmentOfficial go = BusinessLogic.GovernmentOfficialsBL.GetDetails(oxca.OfficialId);
        string phoneNumber = go.ContactNumber;
        string Message     = String.Format("A new Complaint has been registered for your Department. Click the link to see the full Complaint. {0}", "http://www.google.com");

        OutwardCommunication.SMSHelper.SendSMS(Message, phoneNumber);

        AfterOTPVerification.Visible = true;
        pnlVerifyOTP.Visible         = false;
        pnlStart.Visible             = false;

        //Response.Redirect("~/Citizens/Default.aspx");
    }
    protected void btnFixed_Click(object sender, EventArgs e)
    {
        BusinessObjects.Complaint info = new BusinessObjects.Complaint();
        info.Id = Convert.ToInt32(Request.QueryString["ComplaintId"]);
        info    = BusinessLogic.ComplaintBL.GetDetails(info.Id);
        if (info.CurrentStatusId != 3 && info.CurrentStatusId != 4)
        {
            info.CurrentStatusId = 3;
            BusinessLogic.ComplaintBL.Update(info);

            BusinessObjects.ComplaintXStatus obj = new BusinessObjects.ComplaintXStatus();
            obj.ComplaintId = Convert.ToInt32(Request.QueryString["ComplaintId"]);
            obj.StatusId    = 3;
            BusinessLogic.ComplaintXStatusBL.Add(obj);

            ddComplaintDetails.DataBind();
        }
        else
        {
            Response.Write("<script>alert('Complaint is Already Fixed!')</script>");
        }
    }