Ejemplo n.º 1
0
        public PartialViewResult Index()
        {
            LoginUserDetails objLoginUserDetails = null;

            IEnumerable <InsiderTradingDAL.MenuMasterDTO> lstMenu = null;

            Common.Common.WriteLogToFile("Start Method", System.Reflection.MethodBase.GetCurrentMethod());

            try
            {
                objLoginUserDetails = (LoginUserDetails)Common.Common.GetSessionValue(ConstEnum.SessionValue.UserDetails);

                int out_iTotalRecords = 0;

                using (GenericSLImpl <InsiderTradingDAL.MenuMasterDTO> g = new GenericSLImpl <InsiderTradingDAL.MenuMasterDTO>())
                {
                    lstMenu = g.ListAllDataTable(objLoginUserDetails.CompanyDBConnectionString, Common.ConstEnum.GridType.MenuList, 10, 1,
                                                 null, null, objLoginUserDetails.LoggedInUserID.ToString(), null, null, null,
                                                 null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, out out_iTotalRecords, sLookUpPrefix);

                    //Replace the query string parameter during building of the Menu
                    #region ReplaceQueryStringParameters
                    for (int key = 0; key < lstMenu.Count(); key++)
                    {
                        if (lstMenu.ElementAt(key).MenuURL != null && lstMenu.ElementAt(key).MenuURL.Contains("{UserInfoID}"))
                        {
                            lstMenu.ElementAt(key).MenuURL = lstMenu.ElementAt(key).MenuURL.Replace("{UserInfoID}", objLoginUserDetails.LoggedInUserID.ToString());
                        }
                    }
                    #endregion ReplaceQueryStringParameters
                }

                ViewBag.Menu             = lstMenu;
                ViewBag.LoginUserName    = objLoginUserDetails.UserName;
                ViewBag.IsChangePassword = Common.Common.GetSessionValue("IsChangePassword") == null ? false : Common.Common.GetSessionValue("IsChangePassword");
                Common.Common.WriteLogToFile("End Method", System.Reflection.MethodBase.GetCurrentMethod());
                TempData["MenuList"] = lstMenu;
                return(PartialView("_menuLayout", lstMenu));
            }
            catch (Exception exp)
            {
                Common.Common.WriteLogToFile("exception occured", System.Reflection.MethodBase.GetCurrentMethod(), exp);

                return(PartialView("_menuLayout"));
            }
            finally
            {
                objLoginUserDetails = null;
            }
        }
Ejemplo n.º 2
0
        public void GetLoginUserApplicableActions(string i_sConnectionString, string i_sLoginId, out List <string> o_lstActivityActions, out List <int> o_lstActivityIds)
        {
            int    out_iTotalRecords = 0;
            string sLookUpPrefix     = "usr_msg_";
            IEnumerable <UserActivityDTO> lstActivityList = new List <UserActivityDTO>();
            //GenericSLImpl<UserActivityDTO> objGenericSLImpl = new GenericSLImpl<UserActivityDTO>();

            string sAcidURLMap = "";

            try
            {
                o_lstActivityActions = new List <string>();
                o_lstActivityIds     = new List <int>();
                using (var objGenericSLImpl = new GenericSLImpl <UserActivityDTO>())
                {
                    lstActivityList = objGenericSLImpl.ListAllDataTable(i_sConnectionString, ConstEnum.GridType.ActivityList, 0, 1,
                                                                        null, null, i_sLoginId, null, null, null, null, null,
                                                                        null, null, null, null, null, null, null, null, null, null, null, null, null, null, out out_iTotalRecords, sLookUpPrefix);
                }
                foreach (UserActivityDTO objUserActivityDTO in lstActivityList)
                {
                    o_lstActivityIds.Add(objUserActivityDTO.ActivityId);

                    if (objUserActivityDTO.ControllerName != null)
                    {
                        string actionName = string.Empty;
                        if (!string.IsNullOrEmpty(objUserActivityDTO.ActionName))
                        {
                            actionName = objUserActivityDTO.ActionName.ToLower();
                        }

                        sAcidURLMap = objUserActivityDTO.ActivityId + "_" + objUserActivityDTO.ControllerName.ToLower() + "_" + actionName + ((objUserActivityDTO.ActionButtonName != null && objUserActivityDTO.ActionButtonName != "") ? "_" + objUserActivityDTO.ActionButtonName.ToLower() : "");
                        o_lstActivityActions.Add(sAcidURLMap);
                        sAcidURLMap = "";
                    }
                }

                o_lstActivityIds = o_lstActivityIds.Distinct().ToList();
            }
            catch (Exception exp)
            {
                throw exp;
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// This function will return the header data seen on the Initial Disclosure Employee report.
        /// </summary>
        public IEnumerable <ReportHeaderKeyValueDTO> FetchReportHeaderKeyValueDetails(string i_sConnectionString, int i_nGridType, string[] i_sParamArr)
        {
            //GenericSLImpl<ReportHeaderKeyValueDTO> objGenericSLImpl = new GenericSLImpl<ReportHeaderKeyValueDTO>();
            IEnumerable <ReportHeaderKeyValueDTO> lstCRUserList = new List <ReportHeaderKeyValueDTO>();
            int out_iTotalRecords = 0;

            try
            {
                using (var objGenericSLImpl = new GenericSLImpl <ReportHeaderKeyValueDTO>())
                {
                    lstCRUserList = objGenericSLImpl.ListAllDataTableGrid(i_sConnectionString, i_nGridType, 0, 1,
                                                                          "", "ASC", out out_iTotalRecords, "rpt_grd_", i_sParamArr[0], i_sParamArr[1], i_sParamArr[2], i_sParamArr[3], i_sParamArr[4], i_sParamArr[5],
                                                                          i_sParamArr[6], i_sParamArr[7], i_sParamArr[8], i_sParamArr[9], i_sParamArr[10], i_sParamArr[11], i_sParamArr[12], i_sParamArr[13], i_sParamArr[14],
                                                                          i_sParamArr[15], i_sParamArr[16], i_sParamArr[17], i_sParamArr[18], i_sParamArr[19]);
                }
            }
            catch (Exception exp)
            {
            }
            return(lstCRUserList);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// This function will fetch the data with the filters applied and then add the data to the excel file.
        /// </summary>
        /// <param name="i_Search"></param>
        public void AddTableinSheet(string i_Search)
        {
            IEnumerable <Object> lstCRUserList = new List <Object>();
            //GenericSLImpl<Object> objGenericSLImpl = new GenericSLImpl<Object>();
            int    out_iTotalRecords = 0;
            String sLookUpPrefix     = "";
            int    nCellCounter      = 1;

            if (i_Search == null)
            {
                i_Search = "";
            }

            String[] arr    = new string[21];
            String[] recArr = i_Search.Split(new string[] { "|_|" }, StringSplitOptions.None);
            for (int i = 0; i <= arr.Length - 1; i++)
            {
                if (i < recArr.Length)
                {
                    if (recArr[i] == "" || recArr[i] == "0")
                    {
                        arr[i] = null;
                    }
                    else
                    {
                        arr[i] = recArr[i];
                    }
                }
                else
                {
                    arr[i] = null;
                }
            }
            try
            {
                //Query to Grid
                using (var objGenericSLImpl = new GenericSLImpl <Object>())
                {
                    lstCRUserList = objGenericSLImpl.ListAllDataTableGrid(m_objLoginUserDetails.CompanyDBConnectionString, m_nGridType, -1, 1,
                                                                          "", "", out out_iTotalRecords, sLookUpPrefix, arr[0], arr[1], arr[2], arr[3], arr[4], arr[5],
                                                                          arr[6], arr[7], arr[8], arr[9], arr[10], arr[11], arr[12], arr[13], arr[14], arr[15], arr[16], arr[17], arr[18], arr[19]);
                }

                foreach (dynamic objUserList in lstCRUserList)
                {
                    m_nRowCount++;
                    m_objCommonOpenXMLObject.CreateNewRow(m_nRowCount);
                    nCellCounter = 1;
                    IDictionary <string, object> resultList = (IDictionary <string, object>)objUserList;

                    foreach (string sColumnToShow in m_lstToShowColumnHeadingsForDateColumnSequence)
                    {
                        if (resultList.ContainsKey(sColumnToShow))
                        {
                            if (nCellCounter == 1 && m_nGridType == ConstEnum.GridType.Report_Defaulter && Convert.ToString(resultList[sColumnToShow]) == "1")
                            {
                                m_objCommonOpenXMLObject.CreateTextCell(m_sExcelColumnNames[nCellCounter], "ž", m_nRowCount,
                                                                        (int)InsiderTradingExcelWriter.ExcelFacade.ConstantEnum.OpenXMLStyleIndex.TEXT_PLANE_BACKGROUND_WINGDINGS_FONT_ORANGE);
                            }
                            else
                            {
                                m_objCommonOpenXMLObject.CreateTextCell(m_sExcelColumnNames[nCellCounter], Convert.ToString(resultList[sColumnToShow]), m_nRowCount,
                                                                        (int)InsiderTradingExcelWriter.ExcelFacade.ConstantEnum.OpenXMLStyleIndex.ARIAL_NARROW_10_TEXT_PLAIN_BACKGROUND_NORMAL_WITH_BORDERS);
                            }

                            nCellCounter++;
                        }
                    }
                    m_objCommonOpenXMLObject.AddToSheetData();
                }
                lstCRUserList = null;
                m_lstToShowColumnHeadingsForDateColumnSequence = null;
            }
            catch (Exception exp)
            {
            }
        }
Ejemplo n.º 5
0
        public ActionResult AjaxHandler(String gridtype, String inp_sParam = "", String isInsider = "", int acid = 0, String ClearSearchFilter = "")
        {
            if (ClearSearchFilter == "True")
            {
                TempData.Remove("SearchArray");
                JsonResult returnJson = Json(new
                {
                    status = false
                }, JsonRequestBehavior.AllowGet);
                return(returnJson);
            }
            int                  out_iTotalRecords   = 0;
            String               sLookUpPrefix       = "";
            LoginUserDetails     objLoginUserDetails = (LoginUserDetails)Common.Common.GetSessionValue(ConstEnum.SessionValue.UserDetails);
            IEnumerable <Object> lstCRUserList       = new List <Object>();
            // Change the received generic object to <key, value> pair as per required for datatable.
            List <Dictionary <string, Object> > lstUserList = new List <Dictionary <string, Object> >();

            Common.Common objCommon = new Common.Common();
            try
            {
                if (!objCommon.ValidateCSRFForAJAX())
                {
                    return(RedirectToAction("Unauthorised", "Home"));
                }

                //Fetch Search parameters
                String   sSearch = Request.Form["Search"];
                String[] arr     = new string[51];
                arr = sSearch.Split(new string[] { "|#|" }, StringSplitOptions.None);
                for (int i = 0; i <= arr.Length - 1; i++)
                {
                    if (arr[i] == "" || arr[i] == "0")
                    {
                        arr[i] = null;
                    }
                }
                if (!IsNullOrEmpty(arr) &&
                    (gridtype == InsiderTrading.Common.ConstEnum.GridType.ContinuousDisclosureListForCO.ToString() ||
                     gridtype == InsiderTrading.Common.ConstEnum.GridType.ContinousDisclosureStatusList.ToString() ||
                     gridtype == InsiderTrading.Common.ConstEnum.GridType.Report_ContinuousReportEmployeeWise.ToString() ||
                     gridtype == InsiderTrading.Common.ConstEnum.GridType.Report_InitialDisclosureEmployeeWise.ToString() ||
                     gridtype == InsiderTrading.Common.ConstEnum.GridType.InitialDisclosureListForCO.ToString() ||
                     gridtype == InsiderTrading.Common.ConstEnum.GridType.COUserList.ToString() ||
                     gridtype == InsiderTrading.Common.ConstEnum.GridType.EmployeeUserList.ToString() ||
                     (gridtype == InsiderTrading.Common.ConstEnum.GridType.RestrictedList.ToString() && arr[8] != "History")))
                {
                    TempData["SearchArray"] = arr;
                    TempData.Keep("SearchArray");
                }
                if (!IsNullOrEmpty(arr) && (gridtype == InsiderTrading.Common.ConstEnum.GridType.Report_ContinuousReportEmployeeIndividual.ToString() ||
                                            gridtype == InsiderTrading.Common.ConstEnum.GridType.Report_InitialDisclosureEmployeeIndividual.ToString()))
                {
                    TempData["ReportSearchArray"] = arr;
                    TempData.Keep("ReportSearchArray");
                }
                //Get sort column, direction, display length and page number
                String sSortCol       = Request.Form["mDataProp_" + Request.Form["iSortCol_0"]];
                String sSortDir       = Request.Form["sSortDir_0"];
                int    nDisplayLength = Convert.ToInt32(Request.Form["iDisplayLength"]);
                int    nPage          = 0;
                if (nDisplayLength != 0)
                {
                    nPage = Convert.ToInt32(Request.Form["iDisplayStart"]) / nDisplayLength + 1;
                }

                using (GenericSLImpl <Object> objGenericSLImpl = new GenericSLImpl <Object>())
                {
                    //PENDING TRANSACTIONS DASHBOARD : Initial Disclosures-Insider
                    if (isInsider == "InitialDisInsider" && inp_sParam == "154002")
                    {
                        //nDisplayLength = 10;

                        lstCRUserList = objGenericSLImpl.ListAllDataTableGrid(objLoginUserDetails.CompanyDBConnectionString, Convert.ToInt32(gridtype), nDisplayLength, nPage,
                                                                              sSortCol, sSortDir, out out_iTotalRecords, sLookUpPrefix, arr[0], arr[1], arr[2], arr[3], arr[4], arr[5],
                                                                              inp_sParam, arr[7], arr[8], arr[9], arr[10], arr[11], arr[12], arr[13], arr[14], arr[15], arr[16], arr[17], arr[18], arr[19],
                                                                              arr[20], arr[21], arr[22], arr[23], arr[24], arr[25], arr[26], arr[27], arr[28], arr[29],
                                                                              arr[30], arr[31], arr[32],
                                                                              arr[33], arr[34], arr[35], arr[36], arr[37], arr[38], arr[39], arr[40], arr[41], arr[42], arr[43], arr[44], arr[45], arr[46], arr[47],
                                                                              arr[48], arr[49]
                                                                              );
                    }
                    //PENDING TRANSACTIONS DASHBOARD : Initial Disclosures-Insider Relative
                    else if (isInsider == "InitialDisInsider-Relative" && inp_sParam == "154002")
                    {
                        //nDisplayLength = 10;

                        lstCRUserList = objGenericSLImpl.ListAllDataTableGrid(objLoginUserDetails.CompanyDBConnectionString, Convert.ToInt32(gridtype), nDisplayLength, nPage,
                                                                              sSortCol, sSortDir, out out_iTotalRecords, sLookUpPrefix, arr[0], arr[1], arr[2], arr[3], arr[4], arr[5],
                                                                              inp_sParam, arr[7], arr[8], arr[9], arr[10], arr[11], arr[12], arr[13], arr[14], arr[15], arr[16], arr[17], arr[18], arr[19],
                                                                              "1", arr[21], arr[22], arr[23], arr[24], arr[25], arr[26], arr[27], arr[28], arr[29],
                                                                              arr[30], arr[31], arr[32],
                                                                              arr[33], arr[34], arr[35], arr[36], arr[37], arr[38], arr[39], arr[40], arr[41], arr[42], arr[43], arr[44], arr[45], arr[46], arr[47],
                                                                              arr[48], arr[49]
                                                                              );
                    }
                    //PENDING TRANSACTIONS DASHBOARD : Initial Disclosures-CO
                    else if (isInsider == "ContiDisCO" && inp_sParam == "154006")
                    {
                        //nDisplayLength = 10;
                        lstCRUserList = objGenericSLImpl.ListAllDataTableGrid(objLoginUserDetails.CompanyDBConnectionString, Convert.ToInt32(gridtype), nDisplayLength, nPage,
                                                                              sSortCol, sSortDir, out out_iTotalRecords, sLookUpPrefix, arr[0], arr[1], arr[2], arr[3], arr[4], arr[5],
                                                                              inp_sParam, arr[7], arr[8], arr[9], arr[10], arr[11], arr[12], arr[13], arr[14], arr[15], arr[16], arr[17], arr[18], arr[19],
                                                                              arr[20], arr[21], arr[22], arr[23], arr[24], arr[25], arr[26], arr[27], arr[28], arr[29],
                                                                              arr[30], arr[31], arr[32],
                                                                              arr[33], arr[34], arr[35], arr[36], arr[37], arr[38], arr[39], arr[40], arr[41], arr[42], arr[43], arr[44], arr[45], arr[46], arr[47],
                                                                              arr[48], arr[49]
                                                                              );
                    }
                    //PENDING TRANSACTIONS DASHBOARD : Continuous Disclosures-CO
                    else if (isInsider == "ContinouseDisCO" && inp_sParam == "114049")
                    {
                        lstCRUserList = objGenericSLImpl.ListAllDataTableGrid(objLoginUserDetails.CompanyDBConnectionString, Convert.ToInt32(gridtype), nDisplayLength, nPage,
                                                                              sSortCol, sSortDir, out out_iTotalRecords, sLookUpPrefix, arr[0], arr[1], arr[2], arr[3], arr[4], arr[5],
                                                                              arr[6], "153019", arr[8], arr[9], arr[10], arr[11], arr[12], arr[13], arr[14], arr[15], arr[16], arr[17], arr[18], arr[19],
                                                                              arr[20], arr[21], arr[22], arr[23], "2", arr[25], arr[26], arr[27], arr[28], arr[29],
                                                                              arr[30], arr[31], arr[32],
                                                                              arr[33], arr[34], arr[35], arr[36], arr[37], arr[38], arr[39], arr[40], arr[41], arr[42], arr[43], arr[44], arr[45], arr[46], arr[47],
                                                                              arr[48], arr[49]
                                                                              );
                    }

                    //PENDING TRANSACTIONS DASHBOARD : Continuous Disclosures-Insider
                    else if (isInsider == "ContiDisInsider" && inp_sParam == "144001")
                    {
                        lstCRUserList = objGenericSLImpl.ListAllDataTableGrid(objLoginUserDetails.CompanyDBConnectionString, Convert.ToInt32(gridtype), nDisplayLength, nPage,
                                                                              sSortCol, sSortDir, out out_iTotalRecords, sLookUpPrefix, arr[0], arr[1], arr[2], arr[3], arr[4], arr[5],
                                                                              arr[6], "153019", arr[8], arr[9], arr[10], arr[11], arr[12], arr[13], arr[14], arr[15], arr[16], arr[17], arr[18], arr[19],
                                                                              arr[20], arr[21], arr[22], arr[23], "3", arr[25], arr[26], arr[27], arr[28], arr[29],
                                                                              arr[30], arr[31], arr[32],
                                                                              arr[33], arr[34], arr[35], arr[36], arr[37], arr[38], arr[39], arr[40], arr[41], arr[42], arr[43], arr[44], arr[45], arr[46], arr[47],
                                                                              arr[48], arr[49]
                                                                              );
                    }
                    //PENDING TRANSACTIONS DASHBOARD : Period End Disclosures-Insider
                    else if (isInsider == "PeriodEndDisInsider" && inp_sParam == "154002")
                    {
                        lstCRUserList = objGenericSLImpl.ListAllDataTableGrid(objLoginUserDetails.CompanyDBConnectionString, Convert.ToInt32(gridtype), nDisplayLength, nPage,
                                                                              sSortCol, sSortDir, out out_iTotalRecords, sLookUpPrefix, arr[0], arr[1], arr[2], arr[3], arr[4], arr[5],
                                                                              arr[6], inp_sParam, arr[8], arr[9], arr[10], arr[11], arr[12], arr[13], arr[14], arr[15], arr[16], arr[17], arr[18], arr[19],
                                                                              arr[20], arr[21], arr[22], arr[23], arr[24], arr[25], arr[26], arr[27], arr[28], arr[29],
                                                                              arr[30], arr[31], arr[32],
                                                                              arr[33], arr[34], arr[35], arr[36], arr[37], arr[38], arr[39], arr[40], arr[41], arr[42], arr[43], arr[44], arr[45], arr[46], arr[47],
                                                                              arr[48], arr[49]
                                                                              );
                    }
                    //PENDING TRANSACTIONS DASHBOARD : Period End Disclosures-Insider
                    else if (isInsider == "PeriodEndDisCO")
                    {
                        lstCRUserList = objGenericSLImpl.ListAllDataTableGrid(objLoginUserDetails.CompanyDBConnectionString, Convert.ToInt32(gridtype), nDisplayLength, nPage,
                                                                              sSortCol, sSortDir, out out_iTotalRecords, sLookUpPrefix, arr[0], arr[1], arr[2], arr[3], arr[4], arr[5],
                                                                              arr[6], arr[7], arr[8], arr[9], arr[10], arr[11], arr[12], arr[13], arr[14], arr[15], arr[16], arr[17], arr[18], "1",
                                                                              arr[20], arr[21], arr[22], arr[23], arr[24], arr[25], arr[26], arr[27], arr[28], arr[29],
                                                                              arr[30], arr[31], arr[32],
                                                                              arr[33], arr[34], arr[35], arr[36], arr[37], arr[38], arr[39], arr[40], arr[41], arr[42], arr[43], arr[44], arr[45], arr[46], arr[47],
                                                                              arr[48], arr[49]
                                                                              );
                    }
                    //PENDING TRANSACTIONS DASHBOARD : Trade details-Insider
                    else if (isInsider == "TradeDetailsInsider" && inp_sParam == "154002")
                    {
                        lstCRUserList = objGenericSLImpl.ListAllDataTableGrid(objLoginUserDetails.CompanyDBConnectionString, Convert.ToInt32(gridtype), nDisplayLength, nPage,
                                                                              sSortCol, sSortDir, out out_iTotalRecords, sLookUpPrefix, arr[0], arr[1], arr[2], arr[3], arr[4], arr[5],
                                                                              inp_sParam, arr[7], arr[8], arr[9], arr[10], arr[11], arr[12], arr[13], arr[14], arr[15], arr[16], arr[17], arr[18], arr[19],
                                                                              arr[20], arr[21], arr[22], arr[23], "1", arr[25], arr[26], arr[27], arr[28], arr[29],
                                                                              arr[30], arr[31], arr[32],
                                                                              arr[33], arr[34], arr[35], arr[36], arr[37], arr[38], arr[39], arr[40], arr[41], arr[42], arr[43], arr[44], arr[45], arr[46], arr[47],
                                                                              arr[48], arr[49]
                                                                              );
                    }
                    //PENDING TRANSACTIONS DASHBOARD : Trade details-CO
                    else if (isInsider == "TradeDetailsCO" && inp_sParam == "154006")
                    {
                        lstCRUserList = objGenericSLImpl.ListAllDataTableGrid(objLoginUserDetails.CompanyDBConnectionString, Convert.ToInt32(gridtype), nDisplayLength, nPage,
                                                                              sSortCol, sSortDir, out out_iTotalRecords, sLookUpPrefix, arr[0], arr[1], arr[2], arr[3], arr[4], arr[5],
                                                                              inp_sParam, arr[7], arr[8], arr[9], arr[10], arr[11], arr[12], arr[13], arr[14], arr[15], arr[16], arr[17], arr[18], arr[19],
                                                                              arr[20], arr[21], arr[22], arr[23], "1", arr[25], arr[26], arr[27], arr[28], arr[29],
                                                                              arr[30], arr[31], arr[32],
                                                                              arr[33], arr[34], arr[35], arr[36], arr[37], arr[38], arr[39], arr[40], arr[41], arr[42], arr[43], arr[44], arr[45], arr[46], arr[47],
                                                                              arr[48], arr[49]
                                                                              );
                    }
                    //PENDING TRANSACTIONS DASHBOARD : Submission to Stock Exchange-CO
                    else if (isInsider == "SubToStckExCO" && inp_sParam == "154002")
                    {
                        lstCRUserList = objGenericSLImpl.ListAllDataTableGrid(objLoginUserDetails.CompanyDBConnectionString, Convert.ToInt32(gridtype), nDisplayLength, nPage,
                                                                              sSortCol, sSortDir, out out_iTotalRecords, sLookUpPrefix, arr[0], arr[1], arr[2], arr[3], arr[4], arr[5],
                                                                              arr[6], arr[7], arr[8], arr[9], arr[10], arr[11], arr[12], arr[13], arr[14], arr[15], arr[16], arr[17], inp_sParam, arr[19],
                                                                              arr[20], arr[21], arr[22], arr[23], "1", arr[25], arr[26], arr[27], arr[28], arr[29],
                                                                              arr[30], arr[31], arr[32],
                                                                              arr[33], arr[34], arr[35], arr[36], arr[37], arr[38], arr[39], arr[40], arr[41], arr[42], arr[43], arr[44], arr[45], arr[46], arr[47],
                                                                              arr[48], arr[49]
                                                                              );
                    }
                    //PENDING TRANSACTIONS DASHBOARD : Pre-clearances-CO
                    else if (isInsider == "PreClearancesCO" && inp_sParam == "144001")
                    {
                        lstCRUserList = objGenericSLImpl.ListAllDataTableGrid(objLoginUserDetails.CompanyDBConnectionString, Convert.ToInt32(gridtype), nDisplayLength, nPage,
                                                                              sSortCol, sSortDir, out out_iTotalRecords, sLookUpPrefix, arr[0], arr[1], inp_sParam, arr[3], arr[4], arr[5],
                                                                              arr[6], arr[7], arr[8], arr[9], arr[10], arr[11], arr[12], arr[13], arr[14], arr[15], arr[16], arr[17], arr[18], arr[19],
                                                                              arr[20], arr[21], arr[22], arr[23], arr[24], arr[25], arr[26], arr[27], arr[28], arr[29],
                                                                              arr[30], arr[31], arr[32],
                                                                              arr[33], arr[34], arr[35], arr[36], arr[37], arr[38], arr[39], arr[40], arr[41], arr[42], arr[43], arr[44], arr[45], arr[46], arr[47],
                                                                              arr[48], arr[49]
                                                                              );
                    }
                    else if (isInsider == "PreClearancesCO_OS" && inp_sParam == "144001")
                    {
                        lstCRUserList = objGenericSLImpl.ListAllDataTableGrid(objLoginUserDetails.CompanyDBConnectionString, Convert.ToInt32(gridtype), nDisplayLength, nPage,
                                                                              sSortCol, sSortDir, out out_iTotalRecords, sLookUpPrefix, arr[0], arr[1], arr[2], arr[3], inp_sParam, arr[5],
                                                                              arr[6], arr[7], arr[8], arr[9], arr[10], arr[11], arr[12], arr[13], arr[14], arr[15], arr[16], arr[17], arr[18], arr[19],
                                                                              arr[20], arr[21], arr[22], arr[23], arr[24], arr[25], arr[26], arr[27], arr[28], arr[29],
                                                                              arr[30], arr[31], arr[32],
                                                                              arr[33], arr[34], arr[35], arr[36], arr[37], arr[38], arr[39], arr[40], arr[41], arr[42], arr[43], arr[44], arr[45], arr[46], arr[47],
                                                                              arr[48], arr[49]
                                                                              );
                    }
                    else if (isInsider == "PreClearancesCO_OS" && inp_sParam == "154002")
                    {
                        lstCRUserList = objGenericSLImpl.ListAllDataTableGrid(objLoginUserDetails.CompanyDBConnectionString, Convert.ToInt32(gridtype), nDisplayLength, nPage,
                                                                              sSortCol, sSortDir, out out_iTotalRecords, sLookUpPrefix, arr[0], arr[1], arr[2], arr[3], arr[4], arr[5],
                                                                              inp_sParam, arr[7], arr[8], arr[9], arr[10], arr[11], arr[12], arr[13], arr[14], arr[15], arr[16], arr[17], arr[18], arr[19],
                                                                              arr[20], arr[21], arr[22], arr[23], arr[24], arr[25], arr[26], arr[27], arr[28], arr[29],
                                                                              arr[30], arr[31], arr[32],
                                                                              arr[33], arr[34], arr[35], arr[36], arr[37], arr[38], arr[39], arr[40], arr[41], arr[42], arr[43], arr[44], arr[45], arr[46], arr[47],
                                                                              arr[48], arr[49]
                                                                              );
                    }
                    //Defaulter DASHBOARD : Initial, Continouse, Period End, Pre-Clearance
                    else if (inp_sParam == "170001" || inp_sParam == "170002" || inp_sParam == "170003" || inp_sParam == "170004")
                    {
                        lstCRUserList = objGenericSLImpl.ListAllDataTableGrid(objLoginUserDetails.CompanyDBConnectionString, Convert.ToInt32(gridtype), nDisplayLength, nPage,
                                                                              sSortCol, sSortDir, out out_iTotalRecords, sLookUpPrefix, arr[0], arr[1], arr[2], arr[3], arr[4], arr[5],
                                                                              arr[6], arr[7], arr[8], arr[9], arr[10], arr[11], arr[12], arr[13], arr[14], arr[15], arr[16], arr[17], arr[18], arr[19],
                                                                              arr[20], arr[21], arr[22], arr[23], arr[24], inp_sParam, arr[26], arr[27], arr[28], arr[29],
                                                                              arr[30], arr[31], arr[32],
                                                                              arr[33], arr[34], arr[35], arr[36], arr[37], arr[38], arr[39], arr[40], arr[41], arr[42], arr[43], arr[44], arr[45], arr[46], arr[47],
                                                                              arr[48], arr[49]
                                                                              );
                    }
                    //Defaulter DASHBOARD : Contra Trade
                    else if (inp_sParam == "169007")
                    {
                        lstCRUserList = objGenericSLImpl.ListAllDataTableGrid(objLoginUserDetails.CompanyDBConnectionString, Convert.ToInt32(gridtype), nDisplayLength, nPage,
                                                                              sSortCol, sSortDir, out out_iTotalRecords, sLookUpPrefix, arr[0], arr[1], arr[2], arr[3], arr[4], arr[5],
                                                                              arr[6], arr[7], arr[8], arr[9], arr[10], arr[11], arr[12], arr[13], arr[14], arr[15], arr[16], arr[17], arr[18], arr[19],
                                                                              arr[20], arr[21], arr[22], arr[23], arr[24], arr[25], inp_sParam, arr[27], arr[28], arr[29],
                                                                              arr[30], arr[31], arr[32],
                                                                              arr[33], arr[34], arr[35], arr[36], arr[37], arr[38], arr[39], arr[40], arr[41], arr[42], arr[43], arr[44], arr[45], arr[46], arr[47],
                                                                              arr[48], arr[49]
                                                                              );
                    }
                    else
                    {
                        lstCRUserList = objGenericSLImpl.ListAllDataTableGrid(objLoginUserDetails.CompanyDBConnectionString, Convert.ToInt32(gridtype), nDisplayLength, nPage,
                                                                              sSortCol, sSortDir, out out_iTotalRecords, sLookUpPrefix, arr[0], arr[1], arr[2], arr[3], arr[4], arr[5],
                                                                              arr[6], arr[7], arr[8], arr[9], arr[10], arr[11], arr[12], arr[13], arr[14], arr[15], arr[16], arr[17], arr[18], arr[19],
                                                                              arr[20], arr[21], arr[22], arr[23], arr[24], arr[25], arr[26], arr[27], arr[28], arr[29],
                                                                              arr[30], arr[31], arr[32],
                                                                              arr[33], arr[34], arr[35], arr[36], arr[37], arr[38], arr[39], arr[40], arr[41], arr[42], arr[43], arr[44], arr[45], arr[46], arr[47],
                                                                              arr[48], arr[49]
                                                                              );
                    }
                }

                foreach (dynamic objUserList in lstCRUserList)
                {
                    var dictionary = new Dictionary <string, Object>();
                    foreach (KeyValuePair <string, Object> kvp in objUserList) // enumerating over it exposes the Properties and Values as a KeyValuePair
                    {
                        dictionary.Add(kvp.Key, kvp.Value);
                    }
                    lstUserList.Add(dictionary);
                    dictionary = null;
                }
                JsonResult returnJson = Json(new
                {
                    aaData               = lstUserList,
                    status               = true,
                    draw                 = Request.Form["draw"],
                    iTotalRecords        = out_iTotalRecords,
                    iTotalDisplayRecords = out_iTotalRecords
                }, JsonRequestBehavior.AllowGet);
                return(returnJson);
            }
            catch (Exception exp)
            {
                lstUserList = new List <Dictionary <string, Object> >();
                JsonResult returnJson = Json(new
                {
                    aaData               = lstUserList,
                    status               = false,
                    draw                 = Request.Form["draw"],
                    iTotalRecords        = 0,
                    iTotalDisplayRecords = 0
                }, JsonRequestBehavior.AllowGet);
                return(returnJson);
            }
            finally
            {
                lstCRUserList = null;
                lstUserList   = null;
            }
        }