protected void FvAssignOfficer_Load(object sender, EventArgs e)
    {
        Button   btnAssignOfficer = ((Button)FvAssignOfficer.FindControl("btnAssignOfficer"));
        CheckBox chkAssignEnquiry = ((CheckBox)FvAssignOfficer.FindControl("chkAssignEnquiry"));

        if (chkAssignEnquiry != null)
        {
            chkAssignEnquiry.Attributes.Add("onClick", "showEnquiryDetails('" + chkAssignEnquiry.ClientID + "', '" + btnAssignOfficer.ClientID + "')");
        }
    }
 protected void FvAssignOfficer_ItemCommand(object sender, FormViewCommandEventArgs e)
 {
     if (e.CommandName == "AssignOfficer")
     {
         Complain     cmp       = new Complain();
         DropDownList ddlOffice = (DropDownList)FvAssignOfficer.FindControl("ddlOfficeName");
         DropDownList ddlDesig  = (DropDownList)FvAssignOfficer.FindControl("ddlDesigination");
         string[]     officer   = WorkflowSupport.GetUserAtOfficeRole(new Guid(ddlOffice.SelectedValue), new Guid(ddlDesig.SelectedValue));
         cmp.AssignEnquiryOfficer(officer[0], new Guid(fldComplainId.Value));
         Response.Redirect("~/");
     }
 }
    protected void txtComplaintDateUps_DataBinding(object sender, EventArgs e)
    {
        TextBox txt = (TextBox)FvAssignOfficer.FindControl("txtComplaintDateUps");

        if (txt.Text != "")
        {
            //

            DateTime s = Convert.ToDateTime(txt.Text);
            txt.Text = s.ToString("dd/MM/yyyy");
        }
    }
 protected void gdComplain_SelectedIndexChanged(object sender, EventArgs e)
 {
     mvAssignOfficer.SetActiveView(mvAssignOfficer.Views[1]);
     fldComplainId.Value = gdComplain.SelectedDataKey.Value.ToString();
     FvAssignOfficer.ChangeMode(FormViewMode.ReadOnly);
 }