protected void btnSearch_Click(object sender, EventArgs e)
    {
        if ((this.ddlCaseType.SelectedIndex < 1) && (this.txtRegDate.Text == "____/__/__") && (this.txtAppelantName.Text.Trim() == "") && (this.txtRespondantName.Text.Trim() == ""))
        {
            this.lblStatusMessage.Text = "Please Enter (Or) Select Atleast One Field.";
            this.programmaticModalPopup.Show();
            return;
        }


        try
        {
            ATTCaseSearch obj = new ATTCaseSearch();
            //obj.CourtID = orgID;
            if (ddlCaseType.SelectedIndex > 0)
            {
                obj.CaseTypeID = int.Parse(ddlCaseType.SelectedValue);
            }
            if (txtRegDate.Text.Trim() != "" && txtRegDate.Text.Trim() != "____/__/__")
            {
                obj.RegDate = txtRegDate.Text;
            }
            if (txtAppelantName.Text.Trim() != "")
            {
                obj.Appelant = txtAppelantName.Text;
            }
            if (txtRespondantName.Text.Trim() != "")
            {
                obj.Respondant = txtRespondantName.Text;
            }

            obj.Verified      = "U";
            obj.DecisionYesNo = null;


            List <ATTCaseSearch> lst = BLLCaseSearch.GetCaseSearch(obj);
            Session["CaseRegistration"] = lst;
            grdCase.DataSource          = lst;
            // CaseCount = lst.Count;

            grdCase.DataBind();
            grdCase.SelectedIndex = -1;

            this.lblSearch.Text = "Total Records:- " + lst.Count;
        }
        catch (Exception ex)
        {
            lblStatusMessage.Text = ex.Message.ToString();
            this.programmaticModalPopup.Show();
        }
    }
        public static List <ATTCaseSearch> GetCaseSearch(ATTCaseSearch caseSrchSearch)
        {
            try
            {
                List <ATTCaseSearch> caseSrchLIST = new List <ATTCaseSearch>();
                foreach (DataRow drow in DLLCaseSearch.GetCaseSearch(caseSrchSearch).Rows)
                {
                    ATTCaseSearch caseSrch = new ATTCaseSearch();
                    if (drow["CASE_ID"] != null)
                    {
                        if (drow["CASE_ID"].ToString() != "")
                        {
                            caseSrch.CaseID = int.Parse(drow["CASE_ID"].ToString());
                        }
                    }
                    if (drow["COURT_ID"] != null)
                    {
                        if (drow["COURT_ID"].ToString() != "")
                        {
                            caseSrch.CourtID = int.Parse(drow["COURT_ID"].ToString());
                        }
                    }
                    caseSrch.CaseRegDate = drow["CASE_REG_DATE"].ToString();
                    caseSrch.CaseNo      = drow["CASE_NUMBER"].ToString();
                    caseSrch.RegNo       = drow["REG_NUMBER"].ToString();
                    if (drow["CASE_TYPE_ID"] != null)
                    {
                        if (drow["CASE_TYPE_ID"].ToString() != "")
                        {
                            caseSrch.CaseTypeID = int.Parse(drow["CASE_TYPE_ID"].ToString());
                        }
                    }
                    caseSrch.CaseTypeName = drow["CASE_TYPE_NAME"].ToString();
                    if (drow["REG_DIARY_ID"] != null)
                    {
                        if (drow["REG_DIARY_ID"].ToString() != "")
                        {
                            caseSrch.RegistrationDiaryID = int.Parse(drow["REG_DIARY_ID"].ToString());
                        }
                    }
                    caseSrch.RegistrationDiary     = drow["REG_DIARY_NAME"].ToString();
                    caseSrch.RegistrationDiaryCode = drow["REG_DIARY_CODE"].ToString();
                    if (drow["REG_SUBJECT_ID"] != null)
                    {
                        if (drow["REG_SUBJECT_ID"].ToString() != "")
                        {
                            caseSrch.RegistrationSubjectID = int.Parse(drow["REG_SUBJECT_ID"].ToString());
                        }
                    }
                    caseSrch.SubjectName = drow["SUBJECT_NAME"].ToString();
                    if (drow["REG_DIARY_NAME_ID"] != null)
                    {
                        if (drow["REG_DIARY_NAME_ID"].ToString() != "")
                        {
                            caseSrch.RegistrationDiaryNameID = int.Parse(drow["REG_DIARY_NAME_ID"].ToString());
                        }
                    }
                    caseSrch.RegDiaryNameDesc = drow["REG_DIARY_NAME_DESC"].ToString();



                    if (drow["WRIT_SUB_ID"] != null)
                    {
                        if (drow["WRIT_SUB_ID"].ToString() != "")
                        {
                            caseSrch.WritSubID = int.Parse(drow["WRIT_SUB_ID"].ToString());
                        }
                    }
                    caseSrch.WritSubName = drow["WRIT_SUB_NAME"].ToString();
                    if (drow["WRIT_CAT_ID"] != null)
                    {
                        if (drow["WRIT_CAT_ID"].ToString() != "")
                        {
                            caseSrch.WritCatID = int.Parse(drow["WRIT_CAT_ID"].ToString());
                        }
                    }
                    caseSrch.WritSubCatName = drow["WRIT_SUB_CAT_NAME"].ToString();
                    if (drow["WRIT_CAT_TITLE_ID"] != null)
                    {
                        if (drow["WRIT_CAT_TITLE_ID"].ToString() != "")
                        {
                            caseSrch.WritCatTitleID = int.Parse(drow["WRIT_CAT_TITLE_ID"].ToString());
                        }
                    }
                    caseSrch.WritSubCatTitleName = drow["WRIT_SUB_CAT_TITLE_NAME"].ToString();
                    if (drow["WRIT_CAT_SUBTITLE_ID"] != null)
                    {
                        if (drow["WRIT_CAT_SUBTITLE_ID"].ToString() != "")
                        {
                            caseSrch.WritCatSubTitleID = int.Parse(drow["WRIT_CAT_SUBTITLE_ID"].ToString());
                        }
                    }
                    caseSrch.WritSubCatSubTitleName = drow["WRIT_SUB_CAT_SUBTITLE_NAME"].ToString();


                    caseSrch.AccountForwarded = drow["ACCOUNT_FORWARDED"].ToString();
                    caseSrch.Verified         = drow["VERIFIED_YES_NO"].ToString();

                    if (drow["VERIFIED_BY"] != null)
                    {
                        if (drow["VERIFIED_BY"].ToString() != "")
                        {
                            caseSrch.VerifiedBy = int.Parse(drow["VERIFIED_BY"].ToString());
                        }
                    }
                    if (drow["DECISION_YES_NO"] != null)
                    {
                        if (drow["DECISION_YES_NO"].ToString() != "")
                        {
                            caseSrch.DecisionYesNo = drow["DECISION_YES_NO"].ToString();
                        }
                    }
                    caseSrch.VerifiedDate   = drow["VERIFIED_DATE"].ToString();
                    caseSrch.DarpithRemarks = drow["DARPITH_REMARKS"].ToString();
                    if (drow["PROCEEDING_ID"] != null)
                    {
                        if (drow["PROCEEDING_ID"].ToString() != "")
                        {
                            caseSrch.ProceedingID = int.Parse(drow["PROCEEDING_ID"].ToString());
                        }
                    }
                    caseSrch.CaseSummary = drow["CASE_SUMMARY"].ToString();
                    if (drow["RELATED_CASE_ID"] != null)
                    {
                        if (drow["RELATED_CASE_ID"].ToString() != "")
                        {
                            caseSrch.RelatedCaseID = int.Parse(drow["RELATED_CASE_ID"].ToString());
                        }
                    }
                    caseSrch.FY         = drow["FY"].ToString();
                    caseSrch.Appelant   = drow["APPELLANT"].ToString();
                    caseSrch.Respondant = drow["RESPONDENT"].ToString();


                    caseSrchLIST.Add(caseSrch);
                }

                return(caseSrchLIST);
            }
            catch (Exception)
            {
                throw;
            }
        }
Ejemplo n.º 3
0
        public static DataTable GetCaseSearch(ATTCaseSearch caseSearch)
        {
            try
            {
                string SelectSql = "SELECT * FROM VW_CASE_REG  WHERE 1=1  ";

                List <OracleParameter> ParamLIST = new List <OracleParameter>();
                if (caseSearch.CourtID > 0)
                {
                    SelectSql += " AND COURT_ID = :CourtId";
                    ParamLIST.Add(Utilities.GetOraParam(":CourtId", caseSearch.CourtID, OracleDbType.Int64, ParameterDirection.Input));
                }

                if (!string.IsNullOrEmpty(caseSearch.CaseNo))
                {
                    SelectSql += " AND CASE_NUMBER = :CaseNo";
                    ParamLIST.Add(Utilities.GetOraParam(":CaseNo", caseSearch.CaseNo, OracleDbType.Varchar2, ParameterDirection.Input));
                }
                if (!string.IsNullOrEmpty(caseSearch.RegNo))
                {
                    SelectSql += " AND REG_NUMBER = :RegNo";
                    ParamLIST.Add(Utilities.GetOraParam(":RegNo", caseSearch.RegNo, OracleDbType.Varchar2, ParameterDirection.Input));
                }
                if (caseSearch.CaseTypeID > 0)
                {
                    SelectSql += " AND CASE_TYPE_ID = :CaseTypeID";
                    ParamLIST.Add(Utilities.GetOraParam(":CaseTypeID", caseSearch.CaseTypeID, OracleDbType.Int64, ParameterDirection.Input));
                }
                if (!string.IsNullOrEmpty(caseSearch.RegDate))
                {
                    SelectSql += " AND CASE_REG_DATE = :RegDate";
                    ParamLIST.Add(Utilities.GetOraParam(":RegDate", caseSearch.RegDate, OracleDbType.Varchar2, ParameterDirection.Input));
                }

                if (!string.IsNullOrEmpty(caseSearch.Appelant))
                {
                    SelectSql += " AND APPELLANT LIKE  '%'|| :Appelant ||'%' ";
                    ParamLIST.Add(Utilities.GetOraParam(":Appelant", caseSearch.Appelant, OracleDbType.Varchar2, ParameterDirection.Input));
                }
                if (!string.IsNullOrEmpty(caseSearch.Respondant))
                {
                    SelectSql += " AND RESPONDENT LIKE  '%'|| :Respondant ||'%' ";
                    ParamLIST.Add(Utilities.GetOraParam(":Respondant", caseSearch.Respondant, OracleDbType.Varchar2, ParameterDirection.Input));
                }

                //if (caseSearch.LitigantSubTypeID > 0)
                //{
                //    SelectSql += " AND LITIGANT_SUB_TYPE_ID = :LitigantSubTypeId";
                //    ParamLIST.Add(Utilities.GetOraParam(":LitigantSubTypeId", caseSearch.LitigantSubTypeID, OracleDbType.Int64, ParameterDirection.Input));
                //}

                if (!string.IsNullOrEmpty(caseSearch.AccountForwarded))
                {
                    SelectSql += " AND ACCOUNT_FORWARDED = :AccForwarded";
                    ParamLIST.Add(Utilities.GetOraParam(":AccForwarded", caseSearch.AccountForwarded, OracleDbType.Varchar2, ParameterDirection.Input));
                }

                if (caseSearch.Verified != null)
                {
                    if (caseSearch.Verified == "U")
                    {
                        SelectSql += " AND VERIFIED_YES_NO is null";
                    }
                    else
                    {
                        SelectSql += " AND VERIFIED_YES_NO = :Verified";
                        ParamLIST.Add(Utilities.GetOraParam(":Verified", caseSearch.Verified, OracleDbType.Varchar2, ParameterDirection.Input));
                    }
                }

                if (caseSearch.DecisionYesNo != null)
                {
                    if (caseSearch.DecisionYesNo == "U")
                    {
                        SelectSql += " AND DECISION_YES_NO is null";
                    }
                    else
                    {
                        SelectSql += " AND DECISION_YES_NO = :Verified";
                        ParamLIST.Add(Utilities.GetOraParam(":Verified", caseSearch.DecisionYesNo, OracleDbType.Varchar2, ParameterDirection.Input));
                    }
                }



                SelectSql += " ORDER BY CASE_ID";

                GetConnection    GetConn = new GetConnection();
                OracleConnection DBConn  = GetConn.GetDbConn(Module.CMS);
                DataSet          ds      = SqlHelper.ExecuteDataset(DBConn, CommandType.Text, SelectSql, ParamLIST.ToArray());
                return((DataTable)ds.Tables[0]);

                //DataSet ds = SqlHelper.ExecuteDataset(CommandType.Text, SelectSql, ParamLIST.ToArray());
                //return (DataTable)ds.Tables[0];
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    protected void btnSearch_Click(object sender, EventArgs e)
    {
        if ((this.ddlCaseType.SelectedIndex < 1) && (this.txtCaseNo.Text == "___-__-____") && (this.txtRegNo.Text == "__-___-_____") &&
            (this.txtRegDate.Text == "____/__/__") && (this.txtAppelantName.Text.Trim() == "") && (this.txtRespondantName.Text.Trim() == ""))
        {
            this.lblStatusMessage.Text = "Please Enter (Or) Select Atleast One Field.";
            this.programmaticModalPopup.Show();
            return;
        }


        try
        {
            ATTCaseSearch obj = new ATTCaseSearch();
            obj.CourtID = orgID;
            if (ddlCaseType.SelectedIndex > 0)
            {
                obj.CaseTypeID = int.Parse(ddlCaseType.SelectedValue);
            }
            if (txtRegNo.Text.Trim() != "" && txtRegNo.Text.Trim() != "__-___-_____")
            {
                obj.RegNo = txtRegNo.Text;
            }
            if (txtCaseNo.Text.Trim() != "" && txtCaseNo.Text.Trim() != "___-__-____")
            {
                obj.CaseNo = txtCaseNo.Text;
            }
            if (txtRegDate.Text.Trim() != "" && txtRegDate.Text.Trim() != "____/__/__")
            {
                obj.RegDate = txtRegDate.Text;
            }
            if (txtAppelantName.Text.Trim() != "")
            {
                obj.Appelant = txtAppelantName.Text;
            }
            if (txtRespondantName.Text.Trim() != "")
            {
                obj.Respondant = txtRespondantName.Text;
            }


            if (VerifiedYesNo.ToString() == "Y")
            {
                obj.Verified = "Y";
            }
            else if (VerifiedYesNo.ToString() == "N")
            {
                obj.Verified = "N";
            }
            else if (VerifiedYesNo.ToString() == "U")
            {
                obj.Verified = "U";
            }
            else
            {
                obj.Verified = null;
            }


            if (DecisionYesNo.ToString() == "Y")
            {
                obj.DecisionYesNo = "Y";
            }
            else if (DecisionYesNo.ToString() == "N")
            {
                obj.DecisionYesNo = "N";
            }
            else if (DecisionYesNo.ToString() == "U")
            {
                obj.DecisionYesNo = "U";
            }
            else
            {
                obj.DecisionYesNo = null;
            }


            List <ATTCaseSearch> lst = BLLCaseSearch.GetCaseSearch(obj);
            grdCase.DataSource = lst;
            CaseCount          = lst.Count;

            grdCase.DataBind();
            grdCase.SelectedIndex = -1;

            if (lst.Count > 0)
            {
                pnlCase.Height = Unit.Pixel(150);
            }
            else
            {
                pnlCase.Height = Unit.Pixel(30);
            }

            if (i1 == 0)//to prevent the event below from executing more than 1 time
            {
                i1++;
                OnBubbleClickBtn(e);
            }
        }
        catch (Exception ex)
        {
            lblStatusMessage.Text = ex.Message.ToString();
            this.programmaticModalPopup.Show();
        }
    }