protected void btnEscalateReason_Click(object sender, EventArgs e)
    {
        BusinessObjects.Complaint info = new BusinessObjects.Complaint();
        info.Id                      = Convert.ToInt32(Request.QueryString["ComplaintId"]);
        info                         = BusinessLogic.ComplaintBL.GetDetails(info.Id);
        info.IsEscalated             = true;
        info.CurrentEscalationNumber = info.CurrentEscalationNumber + 1;

        BusinessLogic.ComplaintBL.Update(info);

        BusinessObjects.DepartmentEscalationLevel obj = new BusinessObjects.DepartmentEscalationLevel();
        obj = BusinessLogic.DepartmentEscalationLevelBL.GetDetailsByDepartmentId(info.DepartmentId, info.CurrentEscalationNumber);

        BusinessObjects.GovernmentOfficial go = new BusinessObjects.GovernmentOfficial();
        go = BusinessLogic.GovernmentOfficialsBL.GetDetails(obj.DesignatedOfficialId);

        OutwardCommunication.EmailHelper.SendComplaintEscalationEmail(go.Name, go.ContactEmail, Request.QueryString["ComplaintId"], info.Description);

        BusinessObjects.ComplaintXEscalationLevel cxe = new BusinessObjects.ComplaintXEscalationLevel();
        //cxe = BusinessLogic.ComplaintXEscalationLevelBL.GetDetails(Convert.ToInt32(Request.QueryString["ComplaintId"]));
        cxe.ComplaintId = Convert.ToInt32(Request.QueryString["ComplaintId"]);
        //cxe.EscalationLevelNumber = cxe.EscalationLevelNumber + 1;
        cxe.EscalationLevelNumber = info.CurrentEscalationNumber;
        cxe.EscalationTime        = DateTime.Now;
        cxe.EscalationReason      = txtEscalationReason.Text;
        BusinessLogic.ComplaintXEscalationLevelBL.Add(cxe);

        ddComplaintDetails.DataBind();
    }
    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 Page_Load(object sender, EventArgs e)
    {
        if (!Request.IsAuthenticated)
        {
            Response.Redirect("~/Login.aspx");
        }
        BusinessObjects.GovernmentOfficial obj = new BusinessObjects.GovernmentOfficial();
        obj = BusinessLogic.GovernmentOfficialsBL.GetDetailsByContactNumber(System.Threading.Thread.CurrentPrincipal.Identity.Name);

        if (obj != null)
        {
            HiddenField1.Value = Convert.ToString(obj.Id);
        }
    }
Пример #4
0
    protected void DetailsView1_ItemInserting(object sender, DetailsViewInsertEventArgs e)
    {
        TextBox txtNewCode = (TextBox)DetailsView1.FindControl("txtNewCode");

        BusinessObjects.GovernmentOfficial info = BusinessLogic.GovernmentOfficialsBL.GetDetails(txtNewCode.Text);

        e.Values.Add("OnDutyPersonId", info.Id);
        e.Values.Add("CityId", ddlCity.SelectedValue);
        e.Values.Add("StateId", ddlState.SelectedValue);
        e.Values.Add("LocalityId", ddlLocality.SelectedValue);
        if (e.Values.Contains("VillageId"))
        {
            e.Values.Add("VillageId", ddlVillage.SelectedValue);
        }
        e.Values.Add("DepartmentId", ddlSelectDepartment.SelectedValue);
    }