private void CheckAppliedModule() { int RequiredModuleID; LoginUserDetails objLoginUserDetails = (LoginUserDetails)InsiderTrading.Common.Common.GetSessionValue((string)ConstEnum.SessionValue.UserDetails); using (var objInsiderInitialDisclosureSL = new InsiderInitialDisclosureSL()) { InsiderTradingDAL.InsiderInitialDisclosure.DTO.InsiderInitialDisclosureDTO objInsiderInitialDisclosureDTO = null; objInsiderInitialDisclosureDTO = objInsiderInitialDisclosureSL.Get_mst_company_details(objLoginUserDetails.CompanyDBConnectionString); RequiredModuleID = objInsiderInitialDisclosureDTO.RequiredModule; } switch (RequiredModuleID) { case ConstEnum.Code.RequiredModuleOwnSecurity: ViewBag.RequiredModuleOwn = true; ViewBag.RequiredModuleBoth = false; ViewBag.RequiredModuleOther = false; break; case ConstEnum.Code.RequiredModuleOtherSecurity: ViewBag.RequiredModuleOwn = false; ViewBag.RequiredModuleBoth = false; ViewBag.RequiredModuleOther = true; break; case ConstEnum.Code.RequiredModuleBoth: ViewBag.RequiredModuleOwn = true; ViewBag.RequiredModuleBoth = true; ViewBag.RequiredModuleOther = true; break; } }
public ActionResult DownloadFormBOS(int acid, int MapToTypeCodeId = 0, int nTransactionMasterId = 0, string DisplayCode = "") { LoginUserDetails objLoginUserDetails = null; InsiderInitialDisclosureSL objInsiderInitialDisclosureSL = new InsiderInitialDisclosureSL(); FormBDetails_OSDTO objFormBDetails_OSDTO = null; try { objLoginUserDetails = (LoginUserDetails)Common.Common.GetSessionValue(ConstEnum.SessionValue.UserDetails); objFormBDetails_OSDTO = objInsiderInitialDisclosureSL.GetFormBDetails_OS(objLoginUserDetails.CompanyDBConnectionString, Common.ConstEnum.Code.DisclosureTransactionforOS, Convert.ToInt32(nTransactionMasterId)); Response.Clear(); Response.ClearContent(); Response.ClearHeaders(); Response.ContentType = "application/pdf"; Response.AppendHeader("content-disposition", "attachment;filename=" + DisplayCode + ".pdf"); Response.Flush(); Response.Cache.SetCacheability(System.Web.HttpCacheability.NoCache); Response.Buffer = true; // objFormEDetailsDTO = new FormEDetailsDTO(); // objFormEDetailsDTO.GeneratedFormContents = "<html><body>1.1.1 Description: Admin shall have the facility to set the configuration of trade details submission for insiders/employees in initial and period end disclosures.</body></html>"; string LetterHTMLContent = objFormBDetails_OSDTO.GeneratedFormContents; System.Text.RegularExpressions.Regex rReplaceScript = new System.Text.RegularExpressions.Regex(@"<br>"); LetterHTMLContent = rReplaceScript.Replace(LetterHTMLContent, "<br />"); using (var ms = new MemoryStream()) { using (var doc = new Document(PageSize.A4, 30f, 30f, 30f, 30f)) { using (var writer = PdfWriter.GetInstance(doc, Response.OutputStream)) { doc.Open(); doc.NewPage(); using (var msCss = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(LetterHTMLContent))) { using (var msHtml = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(LetterHTMLContent))) { iTextSharp.tool.xml.XMLWorkerHelper.GetInstance().ParseXHtml(writer, doc, msHtml, msCss); } } doc.Close(); } Response.Write(doc); Response.End(); } } return(null); } catch (Exception exp) { ModelState.AddModelError("Warning", Common.Common.GetErrorMessage(exp)); return(View("OtherSecuritiesIndex")); } }
public ActionResult Index(int acid, int UserInfoId = 0, int ReqModuleId = 0) { //Checking setting for Required Module For Mst_Company Table LoginUserDetails objLoginUserDetails = null; objLoginUserDetails = (LoginUserDetails)Common.Common.GetSessionValue(ConstEnum.SessionValue.UserDetails); if (!(objLoginUserDetails.UserTypeCodeId == InsiderTrading.Common.ConstEnum.Code.Admin || objLoginUserDetails.UserTypeCodeId == InsiderTrading.Common.ConstEnum.Code.COUserType)) { UserInfoId = objLoginUserDetails.LoggedInUserID; ViewBag.show_cancel_btn = false; } //ImplementedCompanyDTO objImplementedCompanyDTO = null; InsiderInitialDisclosureDTO objInsiderInitialDisclosureDTO = null; using (var objInsiderInitialDisclosureSL = new InsiderInitialDisclosureSL()) { objInsiderInitialDisclosureDTO = objInsiderInitialDisclosureSL.Get_TradingPolicyID_forOS(objLoginUserDetails.CompanyDBConnectionString, UserInfoId); ViewBag.TradingPolicyID_OS = objInsiderInitialDisclosureDTO.TradingPolicyID_OS; objInsiderInitialDisclosureDTO = objInsiderInitialDisclosureSL.Get_mst_company_details(objLoginUserDetails.CompanyDBConnectionString); ViewBag.RequiredModuleID = objInsiderInitialDisclosureDTO.RequiredModule; return(RedirectToAction("SecuritiesIndex", "InsiderInitialDisclosure", new { acid = acid, UserInfoId = UserInfoId, RequiredModuleID = @ViewBag.RequiredModuleID, requiredModuleIDOnbtnclick = ReqModuleId, TradingPolicyID_OS = ViewBag.TradingPolicyID_OS })); } //return View(); }
public ActionResult Next(UsersPolicyDocumentModel objUsersPolicyDocumentModel, int acid) { bool bReturn = false; UserPolicyDocumentEventLogModel objUserPolicyDocumentEventLogModel = new UserPolicyDocumentEventLogModel(); UserPolicyDocumentEventLogDTO objUserPolicyDocumentEventLogDTO = new UserPolicyDocumentEventLogDTO(); InsiderInitialDisclosureSL objInsiderInitialDisclosureSL = new InsiderInitialDisclosureSL(); LoginUserDetails objLoginUserDetails = (LoginUserDetails)InsiderTrading.Common.Common.GetSessionValue((string)ConstEnum.SessionValue.UserDetails); try { objUserPolicyDocumentEventLogModel.EventCodeId = ConstEnum.Code.PolicyDocumentViewd; objUserPolicyDocumentEventLogModel.MapToTypeCodeId = ConstEnum.Code.PolicyDocument; objUserPolicyDocumentEventLogModel.MapToId = objUsersPolicyDocumentModel.PolicyDocumentId; Common.Common.CopyObjectPropertyByName(objUserPolicyDocumentEventLogModel, objUserPolicyDocumentEventLogDTO); bReturn = objInsiderInitialDisclosureSL.SaveEvent(objLoginUserDetails.CompanyDBConnectionString, objUserPolicyDocumentEventLogDTO, objLoginUserDetails.LoggedInUserID); return(RedirectToAction("Index", "InsiderInitialDisclosure", new { acid = ConstEnum.UserActions.INSIDER_DISCLOSURE_DETAILS_INITIAL_DISCLOSURE }).Success("Policy is viewed.")); } catch { return(View()); } finally { objUserPolicyDocumentEventLogModel = null; objUserPolicyDocumentEventLogDTO = null; objInsiderInitialDisclosureSL = null; objLoginUserDetails = null; } }
//public ActionResult Index(int acid, string SoftCopySubmitted = "", string HardCopySubmitted = "") public ActionResult Index(int acid, int UserInfoId = 0, int ReqModuleId = 0) { //Checking setting for Required Module For Mst_Company Table LoginUserDetails objLoginUserDetails = null; objLoginUserDetails = (LoginUserDetails)Common.Common.GetSessionValue(ConstEnum.SessionValue.UserDetails); UserInfoId = objLoginUserDetails.LoggedInUserID; //ImplementedCompanyDTO objImplementedCompanyDTO = null; InsiderInitialDisclosureDTO objInsiderInitialDisclosureDTO = null; using (var objInsiderInitialDisclosureSL = new InsiderInitialDisclosureSL()) { objInsiderInitialDisclosureDTO = objInsiderInitialDisclosureSL.Get_mst_company_details(objLoginUserDetails.CompanyDBConnectionString); ViewBag.RequiredModuleID = objInsiderInitialDisclosureDTO.RequiredModule; if (ReqModuleId == 0) { ReqModuleId = objInsiderInitialDisclosureDTO.RequiredModule; } ; return(RedirectToAction("SecuritiesIndex", "COInitialDisclosure", new { acid = acid, RequiredModuleID = @ViewBag.RequiredModuleID, requiredModuleIDOnbtnclick = ReqModuleId })); } //return View(); }
public ActionResult ContinuousDisclosuresCODashnoard(String inp_sParam, int acid, string SoftCopySubmitted = "", string HardCopySubmitted = "") { ViewBag.GridType = Common.ConstEnum.GridType.InitialDisclosureListForCO; //string inp_sParam7 = "154002"; ViewData["inp_sParam"] = inp_sParam; LoginUserDetails objLoginUserDetails = (LoginUserDetails)Common.Common.GetSessionValue(ConstEnum.SessionValue.UserDetails); PopulateComboDTO objPopulateComboDTO = new PopulateComboDTO(); objPopulateComboDTO.Key = "0"; objPopulateComboDTO.Value = "Select"; List <PopulateComboDTO> HoldingDetailStatus = new List <PopulateComboDTO>(); HoldingDetailStatus.Add(objPopulateComboDTO); HoldingDetailStatus.AddRange(Common.Common.GetPopulateCombo(objLoginUserDetails.CompanyDBConnectionString, ConstEnum.ComboType.EventStatusList, ConstEnum.CodeGroup.DisclosureAndTradeDetailsStatus, "showuploaded", null, null, null, sLookUpPrefix)); ViewBag.HoldingDetailStatus = HoldingDetailStatus; List <PopulateComboDTO> SoftCopySubmissionStatus = new List <PopulateComboDTO>(); SoftCopySubmissionStatus.Add(objPopulateComboDTO); SoftCopySubmissionStatus.AddRange(Common.Common.GetPopulateCombo(objLoginUserDetails.CompanyDBConnectionString, ConstEnum.ComboType.EventStatusList, ConstEnum.CodeGroup.DisclosureAndTradeDetailsStatus, "a", null, null, null, sLookUpPrefix)); ViewBag.SoftCopySubmissionStatus = SoftCopySubmissionStatus; List <PopulateComboDTO> HardCopySubmissionStatus = new List <PopulateComboDTO>(); HardCopySubmissionStatus.Add(objPopulateComboDTO); HardCopySubmissionStatus.AddRange(Common.Common.GetPopulateCombo(objLoginUserDetails.CompanyDBConnectionString, ConstEnum.ComboType.EventStatusList, ConstEnum.CodeGroup.DisclosureAndTradeDetailsStatus, "a", null, null, null, sLookUpPrefix)); ViewBag.HardCopySubmissionStatus = HardCopySubmissionStatus; List <PopulateComboDTO> StockExchangeSubmissionStatus = new List <PopulateComboDTO>(); StockExchangeSubmissionStatus.Add(objPopulateComboDTO); StockExchangeSubmissionStatus.AddRange(Common.Common.GetPopulateCombo(objLoginUserDetails.CompanyDBConnectionString, ConstEnum.ComboType.EventStatusList, ConstEnum.CodeGroup.DisclosureAndTradeDetailsStatus, "a", null, null, null, sLookUpPrefix)); ViewBag.StockExchangeSubmissionStatus = StockExchangeSubmissionStatus; ViewBag.SoftCopySubmitted = SoftCopySubmitted; ViewBag.HardCopySubmitted = HardCopySubmitted; List <PopulateComboDTO> EmployeeStatus = new List <PopulateComboDTO>(); EmployeeStatus.Add(objPopulateComboDTO); EmployeeStatus.AddRange(Common.Common.GetPopulateCombo(objLoginUserDetails.CompanyDBConnectionString, ConstEnum.ComboType.EmpStatusList, ConstEnum.CodeGroup.EmployeeStatus, "a", null, null, null, sLookUpPrefix)); ViewBag.EmployeeStatus = EmployeeStatus; ViewBag.LoginUserTypeCodeId = objLoginUserDetails.UserTypeCodeId; InsiderInitialDisclosureDTO objInsiderInitialDisclosureDTO = null; using (var objInsiderInitialDisclosureSL = new InsiderInitialDisclosureSL()) { objInsiderInitialDisclosureDTO = objInsiderInitialDisclosureSL.Get_mst_company_details(objLoginUserDetails.CompanyDBConnectionString); ViewBag.RequiredModuleID = objInsiderInitialDisclosureDTO.RequiredModule; } return(View("InsiderList")); }
public ActionResult Accept(UsersPolicyDocumentModel objUsersPolicyDocumentModel, int acid) { bool bReturn = false; UserPolicyDocumentEventLogModel objUserPolicyDocumentEventLogModel = new UserPolicyDocumentEventLogModel(); UserPolicyDocumentEventLogDTO objUserPolicyDocumentEventLogDTO = new UserPolicyDocumentEventLogDTO(); InsiderInitialDisclosureSL objInsiderInitialDisclosureSL = new InsiderInitialDisclosureSL(); LoginUserDetails objLoginUserDetails = (LoginUserDetails)InsiderTrading.Common.Common.GetSessionValue((string)ConstEnum.SessionValue.UserDetails); InsiderInitialDisclosureDTO objInsiderInitialDisclosureDTO = null; try { objUserPolicyDocumentEventLogModel.EventCodeId = ConstEnum.Code.PolicyDocumentAgreed; objUserPolicyDocumentEventLogModel.MapToTypeCodeId = ConstEnum.Code.PolicyDocument; objUserPolicyDocumentEventLogModel.MapToId = objUsersPolicyDocumentModel.PolicyDocumentId; Common.Common.CopyObjectPropertyByName(objUserPolicyDocumentEventLogModel, objUserPolicyDocumentEventLogDTO); bReturn = objInsiderInitialDisclosureSL.SaveEvent(objLoginUserDetails.CompanyDBConnectionString, objUserPolicyDocumentEventLogDTO, objLoginUserDetails.LoggedInUserID); if (bReturn) { objInsiderInitialDisclosureDTO = objInsiderInitialDisclosureSL.GetInitialDisclosureDetails(objLoginUserDetails.CompanyDBConnectionString, objLoginUserDetails.LoggedInUserID).FirstOrDefault(); } if (objInsiderInitialDisclosureDTO.EventDate != null) { return(RedirectToAction("List", "InsiderInitialDisclosure", new { acid = ConstEnum.UserActions.INSIDER_DISCLOSURE_DETAILS_POLICY_DOCUMENT_LIST }).Success(InsiderTrading.Common.Common.getResource("dis_grd_17452")));//"Policy is accepted."); } else { return(RedirectToAction("Index", "InsiderInitialDisclosure", new { acid = ConstEnum.UserActions.INSIDER_DISCLOSURE_DETAILS_INITIAL_DISCLOSURE, ReqModuleId = objUsersPolicyDocumentModel.RequiredModuleID }).Success(InsiderTrading.Common.Common.getResource("dis_grd_17452")));//"Policy is accepted."); } } catch { return(View()); } finally { objUserPolicyDocumentEventLogModel = null; objUserPolicyDocumentEventLogDTO = null; objInsiderInitialDisclosureSL = null; objLoginUserDetails = null; } }
public ActionResult List(int acid) { InsiderInitialDisclosureCountDTO objInsiderInitialDisclosureCountDTO = null; InsiderInitialDisclosureCountModel objInsiderInitialDisclosureCountModel = null; LoginUserDetails objLoginUserDetails = null; try { objInsiderInitialDisclosureCountModel = new InsiderInitialDisclosureCountModel(); objLoginUserDetails = (LoginUserDetails)Common.Common.GetSessionValue(ConstEnum.SessionValue.UserDetails); using (InsiderInitialDisclosureSL objInsiderInitialDisclosureSL = new InsiderInitialDisclosureSL()) { objInsiderInitialDisclosureCountDTO = objInsiderInitialDisclosureSL.GetDashBoardInsiderCount(objLoginUserDetails.CompanyDBConnectionString); Common.Common.CopyObjectPropertyByName(objInsiderInitialDisclosureCountDTO, objInsiderInitialDisclosureCountModel); } if (objLoginUserDetails.BackURL != null && objLoginUserDetails.BackURL != "") { ViewBag.BackButton = true; ViewBag.BackURL = objLoginUserDetails.BackURL; objLoginUserDetails.BackURL = ""; Common.Common.SetSessionValue(ConstEnum.SessionValue.UserDetails, objLoginUserDetails); } else { ViewBag.BackButton = false; } return(View(objInsiderInitialDisclosureCountModel)); } catch (Exception exp) { string sErrMessage = Common.Common.getResource(exp.InnerException.Data[0].ToString()); ModelState.AddModelError("Error", sErrMessage); return(View("Index")); } finally { objLoginUserDetails = null; } }
public ActionResult DisplayHardCopy(int acid, int DocumentID, string DocumentPath, int TransactionMasterId, int DisclosureTypeId, string CalledFrom) { UsersPolicyDocumentModel objUsersPolicyDocumentModel = new UsersPolicyDocumentModel(); UsersPolicyDocumentDTO objUsersPolicyDocumentDTO = new UsersPolicyDocumentDTO(); InsiderInitialDisclosureSL objInsiderInitialDisclosureSL = new InsiderInitialDisclosureSL(); try { objUsersPolicyDocumentModel.PolicyDocumentPath = DocumentPath; objUsersPolicyDocumentModel.DocumentId = DocumentID; ViewBag.TransactionMasterId = TransactionMasterId; ViewBag.DisclosureTypeId = DisclosureTypeId; Common.Common.CopyObjectPropertyByName(objUsersPolicyDocumentDTO, objUsersPolicyDocumentModel); if (objUsersPolicyDocumentModel.DocumentViewAgreeFlag == true) { ViewBag.ViewAgreeFlag = true; ViewBag.ViewFlag = false; } else if (objUsersPolicyDocumentModel.DocumentViewFlag == true) { ViewBag.ViewAgreeFlag = false; ViewBag.ViewFlag = true; } ViewBag.CalledFrom = CalledFrom; return(View("ViewDocument", objUsersPolicyDocumentModel)); } catch { return(View("ViewDocument")); } finally { objUsersPolicyDocumentModel = null; objInsiderInitialDisclosureSL = null; } }
public ActionResult ConfirmDetails(int acid) { LoginUserDetails objLoginUserDetails = null; UserPolicyDocumentEventLogDTO objUserPolicyDocumentEventLogDTO = null; string strConfirmMessage = ""; int UserInfoID = 0; int RequiredModuleID = 0; try { objLoginUserDetails = (LoginUserDetails)InsiderTrading.Common.Common.GetSessionValue((string)ConstEnum.SessionValue.UserDetails); objUserPolicyDocumentEventLogDTO = new UserPolicyDocumentEventLogDTO(); //set values to save into event log table objUserPolicyDocumentEventLogDTO.EventCodeId = ConstEnum.Code.Event_ConfirmPersonalDetails; objUserPolicyDocumentEventLogDTO.UserInfoId = Convert.ToInt32(Session["UserInfoId"]); objUserPolicyDocumentEventLogDTO.MapToId = Convert.ToInt32(Session["UserInfoId"]); objUserPolicyDocumentEventLogDTO.MapToTypeCodeId = ConstEnum.Code.UserDocument; UserInfoID = Convert.ToInt32(Session["UserInfoId"]); bool isConfirm = false; InsiderInitialDisclosureDTO objInsiderInitialDisclosureDTO = null; using (var objInsiderInitialDisclosureSL = new InsiderInitialDisclosureSL()) { objInsiderInitialDisclosureDTO = objInsiderInitialDisclosureSL.Get_mst_company_details(objLoginUserDetails.CompanyDBConnectionString); if (objInsiderInitialDisclosureDTO.RequiredModule == InsiderTrading.Common.ConstEnum.Code.RequiredModuleOtherSecurity) { RequiredModuleID = InsiderTrading.Common.ConstEnum.Code.RequiredModuleOtherSecurity; } else { RequiredModuleID = InsiderTrading.Common.ConstEnum.Code.RequiredModuleOwnSecurity; } } using (InsiderInitialDisclosureSL objInsiderInitialDisclosureSL = new InsiderInitialDisclosureSL()) { isConfirm = objInsiderInitialDisclosureSL.SaveEvent(objLoginUserDetails.CompanyDBConnectionString, objUserPolicyDocumentEventLogDTO, objLoginUserDetails.LoggedInUserID); } using (InsiderInitialDisclosureSL objInsiderInitialDisclosureSL = new InsiderInitialDisclosureSL()) { isConfirm = objInsiderInitialDisclosureSL.SaveReconfirmation(objLoginUserDetails.CompanyDBConnectionString, UserInfoID, objLoginUserDetails.LoggedInUserID); } if (isConfirm) { strConfirmMessage = Common.Common.getResource("usr_msg_11420"); //Personal Details confirm successfully. return(RedirectToAction("Index", "InsiderInitialDisclosure", new { acid = ConstEnum.UserActions.INSIDER_DISCLOSURE_DETAILS_INITIAL_DISCLOSURE, UserInfoId = UserInfoID, ReqModuleId = RequiredModuleID }).Success(HttpUtility.UrlEncode(strConfirmMessage))); } } catch (Exception ex) { strConfirmMessage = Common.Common.getResource(ex.InnerException.Data[0].ToString()); throw ex; } finally { objUserPolicyDocumentEventLogDTO = null; } return(RedirectToAction("Create", "NonEmployeeInsider", new { acid = ConstEnum.UserActions.INSIDER_INSIDERUSER_EDIT, nUserInfoID = objLoginUserDetails.LoggedInUserID })); }
public ActionResult Create(UserInfoModel objUserInfoModel, string OldPassword, int acid, bool IsConfirmDetails = false) { int nUserInfoID = 0; LoginUserDetails objLoginUserDetails = null; UserInfoDTO objUserInfoDTO = new UserInfoDTO(); ImplementedCompanyDTO objImplementedCompanyDTO = new ImplementedCompanyDTO(); bool show_create_role_link = true; bool show_not_login_user_details = true; bool show_confirm_personal_details_btn = false; bool showMsgConfirmPersonalDetails = false; List <PopulateComboDTO> lstSelectedRole = null; UserInfoModel objNewUserInfoModel = new UserInfoModel(); bool isError = false; //flag to check for validation error string sMsgDOJ = ""; string sMsgDOBI = ""; string sMsgDateCompare = ""; string sMsgException = ""; UserPolicyDocumentEventLogDTO objUserPolicyDocumentEventLogDTO = null; EmployeeModel objEmployeeModel = new EmployeeModel(); string strConfirmMessage = ""; try { //check if details being shown for login user then set flag to do not show create role link objLoginUserDetails = (LoginUserDetails)InsiderTrading.Common.Common.GetSessionValue((string)ConstEnum.SessionValue.UserDetails); if (objUserInfoModel.UserInfoId != 0 && objUserInfoModel.UserInfoId == objLoginUserDetails.LoggedInUserID) { show_create_role_link = false; show_not_login_user_details = false; //check if login user has already confirm personal details - if user has confirm personal details then do not show confirm button if (objUserInfoModel.IsRequiredConfirmPersonalDetails != null && (bool)objUserInfoModel.IsRequiredConfirmPersonalDetails) { show_confirm_personal_details_btn = true; showMsgConfirmPersonalDetails = true; } } ViewBag.show_create_role_link = show_create_role_link; ViewBag.show_not_login_user_details = show_not_login_user_details; ViewBag.IsShowMsgConfirmDetails = showMsgConfirmPersonalDetails; ViewBag.show_confirm_personal_details_btn = show_confirm_personal_details_btn; ViewBag.user_action = acid; switch (objLoginUserDetails.UserTypeCodeId) { case ConstEnum.Code.Admin: case ConstEnum.Code.COUserType: if (objUserInfoModel.UserInfoId > 0) { ViewBag.user_action = ConstEnum.UserActions.INSIDER_INSIDERUSER_EDIT; } else { ViewBag.user_action = ConstEnum.UserActions.INSIDER_INSIDERUSER_CREATE; } break; case ConstEnum.Code.NonEmployeeType: if (objUserInfoModel.UserInfoId > 0) { ViewBag.user_action = ConstEnum.UserActions.INSIDER_INSIDERUSER_EDIT; } else { ViewBag.user_action = ConstEnum.UserActions.INSIDER_INSIDERUSER_CREATE; } break; } using (CompaniesSL objCompaniesSL = new CompaniesSL()){ objImplementedCompanyDTO = objCompaniesSL.GetDetails(objLoginUserDetails.CompanyDBConnectionString, 0, 1); } if (objUserInfoModel.DateOfJoining != null || objUserInfoModel.DateOfBecomingInsider != null) { DateTime current_date = Common.Common.GetCurrentDate(objLoginUserDetails.CompanyDBConnectionString); if (objUserInfoModel.DateOfJoining > current_date) { sMsgDOJ = Common.Common.getResource("usr_msg_11413"); // "Date of Joining should be less than today's date"; isError = true; } if (objUserInfoModel.DateOfBecomingInsider > current_date) { sMsgDOBI = Common.Common.getResource("usr_msg_11414"); // "Date of Becoming Insider should be less than today's date"; isError = true; } if (objUserInfoModel.DateOfBecomingInsider < objUserInfoModel.DateOfJoining) { sMsgDateCompare = Common.Common.getResource("usr_msg_11415"); // "Date of Becoming Insider should not be less than Date of Joining"; isError = true; } } //check if validation error by checking flag if (!isError) { if (objUserInfoModel.UserInfoId != 0) { using (UserInfoSL objUserInfoSL = new UserInfoSL()) { objUserInfoDTO = objUserInfoSL.GetUserDetails(objLoginUserDetails.CompanyDBConnectionString, objUserInfoModel.UserInfoId); } } InsiderTrading.Common.Common.CopyObjectPropertyByNameAndActivity(objUserInfoModel, objUserInfoDTO); objUserInfoDTO.UserTypeCodeId = ConstEnum.Code.NonEmployeeType; objUserInfoDTO.IsInsider = ConstEnum.UserType.Insider; objUserInfoDTO.StatusCodeId = Common.Common.ConvertToInt32(ConstEnum.UserStatus.Active); objUserInfoDTO.LoggedInUserId = objLoginUserDetails.LoggedInUserID; objUserInfoDTO.AllowUpsiUser = objUserInfoModel.AllowUpsiUser; if (objUserInfoDTO.StateId == 0) { objUserInfoDTO.StateId = null; } if (objUserInfoDTO.CountryId == 0) { objUserInfoDTO.CountryId = null; } objUserInfoDTO.UPSIAccessOfCompanyID = objImplementedCompanyDTO.CompanyId; objUserInfoDTO.Password = ""; using (UserInfoSL objUserInfoSL = new UserInfoSL()){ objUserInfoDTO = objUserInfoSL.InsertUpdateUserDetails(objLoginUserDetails.CompanyDBConnectionString, objUserInfoDTO); } if (objUserInfoDTO.UserInfoId != 0) { nUserInfoID = objUserInfoDTO.UserInfoId; } //check if need to confirm personal details if (IsConfirmDetails && objUserInfoModel.IsRequiredConfirmPersonalDetails == true) { int UserInfoID = 0; int RequiredModuleID = 0; try { objUserPolicyDocumentEventLogDTO = new UserPolicyDocumentEventLogDTO(); //set values to save into event log table objUserPolicyDocumentEventLogDTO.EventCodeId = ConstEnum.Code.Event_ConfirmPersonalDetails; objUserPolicyDocumentEventLogDTO.UserInfoId = objUserInfoDTO.UserInfoId; objUserPolicyDocumentEventLogDTO.MapToId = objUserInfoDTO.UserInfoId; objUserPolicyDocumentEventLogDTO.MapToTypeCodeId = ConstEnum.Code.UserDocument; UserInfoID = objUserInfoDTO.UserInfoId; InsiderInitialDisclosureDTO objInsiderInitialDisclosureDTO = null; using (var objInsiderInitialDisclosureSL = new InsiderInitialDisclosureSL()) { objInsiderInitialDisclosureDTO = objInsiderInitialDisclosureSL.Get_mst_company_details(objLoginUserDetails.CompanyDBConnectionString); if (objInsiderInitialDisclosureDTO.RequiredModule == InsiderTrading.Common.ConstEnum.Code.RequiredModuleOtherSecurity) { RequiredModuleID = InsiderTrading.Common.ConstEnum.Code.RequiredModuleOtherSecurity; } else { RequiredModuleID = InsiderTrading.Common.ConstEnum.Code.RequiredModuleOwnSecurity; } } bool isConfirm = false; using (InsiderInitialDisclosureSL objInsiderInitialDisclosureSL = new InsiderInitialDisclosureSL()){ isConfirm = objInsiderInitialDisclosureSL.SaveEvent(objLoginUserDetails.CompanyDBConnectionString, objUserPolicyDocumentEventLogDTO, objLoginUserDetails.LoggedInUserID); } if (isConfirm) { strConfirmMessage = Common.Common.getResource("usr_msg_11420"); //Personal Details confirm successfully. //return RedirectToAction("Index", "InsiderInitialDisclosure", new { acid = ConstEnum.UserActions.INSIDER_DISCLOSURE_DETAILS_INITIAL_DISCLOSURE }).Success(HttpUtility.UrlEncode(strConfirmMessage)); return(RedirectToAction("Index", "InsiderInitialDisclosure", new { acid = ConstEnum.UserActions.INSIDER_DISCLOSURE_DETAILS_INITIAL_DISCLOSURE, UserInfoId = UserInfoID, ReqModuleId = RequiredModuleID }).Success(HttpUtility.UrlEncode(strConfirmMessage))); } } catch (Exception ex) { strConfirmMessage = Common.Common.getResource(ex.InnerException.Data[0].ToString()); throw ex; } finally{ objUserPolicyDocumentEventLogDTO = null; } } } } catch (Exception exp) { sMsgException = Common.Common.getResource(exp.InnerException.Data[0].ToString()); isError = true; using (CompaniesSL objCompaniesSL = new CompaniesSL()){ objImplementedCompanyDTO = objCompaniesSL.GetDetails(objLoginUserDetails.CompanyDBConnectionString, 0, 1); } } //check if there are validation error and show validation error if (isError) { ModelState.Remove("KEY"); ModelState.Add("KEY", new ModelState()); ModelState.Clear(); //set validation error messages if (sMsgDOJ != "") { ModelState.AddModelError("Error", sMsgDOJ); } if (sMsgDOBI != "") { ModelState.AddModelError("Error", sMsgDOBI); } if (sMsgDateCompare != "") { ModelState.AddModelError("Error", sMsgDateCompare); } if (sMsgException != "") { ModelState.AddModelError("Error", sMsgException); } if (strConfirmMessage != "") { ModelState.AddModelError("Error", strConfirmMessage); } //check if user has selected role and assign those role if (objUserInfoModel.SubmittedRole != null) { lstSelectedRole = new List <PopulateComboDTO>(); for (int cnt = 0; cnt < objUserInfoModel.SubmittedRole.Count; cnt++) { PopulateComboDTO objPopulateComboDTO = new PopulateComboDTO(); objPopulateComboDTO.Key = objUserInfoModel.SubmittedRole[cnt]; lstSelectedRole.Add(objPopulateComboDTO); objPopulateComboDTO = null; } } //check if user already saved and set non editable property with already saved valued in DB if (objUserInfoModel.UserInfoId != 0) { //get saved info from DB UserInfoDTO objExistingDetails_UserInfoDTO = null; using (UserInfoSL objUserInfoSL = new UserInfoSL()){ objExistingDetails_UserInfoDTO = objUserInfoSL.GetUserDetails(objLoginUserDetails.CompanyDBConnectionString, objUserInfoModel.UserInfoId); } //copy editable property into DTO so we get existing property and change property Common.Common.CopyObjectPropertyByNameAndActivity(objUserInfoModel, objExistingDetails_UserInfoDTO); //copy DTO to new model which can be pass to view with already saved details with newly change details Common.Common.CopyObjectPropertyByName(objExistingDetails_UserInfoDTO, objNewUserInfoModel); //set user info model to employee model which content edited info and already save info //objUserInfoModel = objNewUserInfoModel; } else { //set user info model to employee model which content edited info and already save info objNewUserInfoModel = objUserInfoModel; } objNewUserInfoModel.DefaultRole = FillComboValues(ConstEnum.ComboType.RoleList, ConstEnum.Code.NonEmployeeType.ToString(), null, null, null, null, true); //check if user has selected role and assign those role if (lstSelectedRole != null && lstSelectedRole.Count > 0) { objNewUserInfoModel.AssignedRole = lstSelectedRole; } else { objNewUserInfoModel.AssignedRole = FillComboValues(ConstEnum.ComboType.RoleList, ConstEnum.Code.NonEmployeeType.ToString(), nUserInfoID.ToString(), null, null, null, false); } lstSelectedRole = null; PopulateCombo(objImplementedCompanyDTO.CompanyId); objEmployeeModel.userInfoModel = objNewUserInfoModel; //check if dmat details model is set or not if (objEmployeeModel.dmatDetailsModel == null) { objEmployeeModel.dmatDetailsModel = new DMATDetailsModel(); if (objUserInfoModel.UserInfoId != 0) { objEmployeeModel.dmatDetailsModel.UserInfoID = objEmployeeModel.userInfoModel.UserInfoId; } } //check if document details are set or not if (objEmployeeModel.documentDetailsModel == null) { objEmployeeModel.documentDetailsModel = new DocumentDetailsModel(); objEmployeeModel.documentDetailsModel.MapToTypeCodeId = ConstEnum.Code.UserDocument; objEmployeeModel.documentDetailsModel.PurposeCodeId = null; if (objUserInfoModel.UserInfoId != 0) { objEmployeeModel.documentDetailsModel.MapToId = objEmployeeModel.userInfoModel.UserInfoId; } } return(View("Create", objEmployeeModel)); } ArrayList lst = new ArrayList(); //before showing success message check if first name and last name is NOT NULL string fname = objUserInfoModel.FirstName == null ? "" : objUserInfoModel.FirstName.Replace("'", "\'").Replace("\"", "\""); string lname = objUserInfoModel.LastName == null ? "" : objUserInfoModel.LastName.Replace("'", "\'").Replace("\"", "\""); lst.Add(fname + " " + lname); string AlertMessage = Common.Common.getResource("usr_msg_11266", lst); objUserInfoModel = null; return(RedirectToAction("Create", new { acid = ConstEnum.UserActions.INSIDER_INSIDERUSER_EDIT, nUserInfoID = nUserInfoID, isPPD_Details_Saved = true }).Success(HttpUtility.UrlEncode(AlertMessage))); }
public ActionResult Index(int acid) { TempData.Remove("SearchArray"); LoginUserDetails objLoginUserDetails = null; InsiderDashboardDTO objInsiderDashboardDTO = null; UserInfoDTO objUserInfoDTO = null; ApprovedPCLDTO objApprovedPCLDTO = null; PasswordExpiryReminderDTO objPassExpiryReminderDTO = null; DateTime CurrentDate; ArrayList lst = new ArrayList(); UserPolicyDocumentEventLogDTO objChangePasswordEventLogDTO = null; CompanyConfigurationDTO objCompanyConfigurationDTO = null; int RequiredModuleID = 0; int noOfDays = 0; object path; ViewBag.dupTransCnt = false; ViewBag.ApprovedPCLCnt = false; Common.Common.WriteLogToFile("Start Method", System.Reflection.MethodBase.GetCurrentMethod()); try { objLoginUserDetails = (LoginUserDetails)Common.Common.GetSessionValue(ConstEnum.SessionValue.UserDetails); // check IsUserLogin flag in session, and set flag true -- this will indicate user is login and redirect here for first time if (!objLoginUserDetails.IsUserLogin) { objLoginUserDetails.IsUserLogin = true; Common.Common.SetSessionValue(ConstEnum.SessionValue.UserDetails, objLoginUserDetails); } if (objLoginUserDetails.CompanyName == "DCBBank") { ViewBag.IsVisible = 0; } else { ViewBag.IsVisible = 1; } using (var objInsiderInitialDisclosureSL = new InsiderInitialDisclosureSL()) { InsiderInitialDisclosureDTO objInsiderInitialDisclosureDTO = null; objInsiderInitialDisclosureDTO = objInsiderInitialDisclosureSL.Get_mst_company_details(objLoginUserDetails.CompanyDBConnectionString); RequiredModuleID = objInsiderInitialDisclosureDTO.RequiredModule; } objInsiderDashboardModel = new InsiderDashboardModel(); objInsiderDashboardModel.objInsiderDashboardOtherModel = new InsiderDashboardOtherModel(); switch (RequiredModuleID) { case ConstEnum.Code.RequiredModuleOwnSecurity: ViewBag.RequiredModuleOwn = true; ViewBag.RequiredModuleBoth = false; ViewBag.RequiredModuleOther = false; break; case ConstEnum.Code.RequiredModuleOtherSecurity: ViewBag.RequiredModuleOwn = false; ViewBag.RequiredModuleBoth = false; ViewBag.RequiredModuleOther = true; objInsiderDashboardModel.objInsiderDashboardOtherModel = BindDashboardForOtherSecurities(); break; case ConstEnum.Code.RequiredModuleBoth: ViewBag.RequiredModuleOwn = true; int?TradingPolicyID_OS; //check other sericity model is applicable for user or not InsiderInitialDisclosureDTO objInsiderInitialDisclosureDTO = null; using (var objInsiderInitialDisclosureSL = new InsiderInitialDisclosureSL()) { objInsiderInitialDisclosureDTO = objInsiderInitialDisclosureSL.Get_TradingPolicyID_forOS(objLoginUserDetails.CompanyDBConnectionString, objLoginUserDetails.LoggedInUserID); TradingPolicyID_OS = objInsiderInitialDisclosureDTO.TradingPolicyID_OS; } if (TradingPolicyID_OS == null || TradingPolicyID_OS == 0) { ViewBag.RequiredModuleBoth = false; ViewBag.RequiredModuleOther = false; } else { ViewBag.RequiredModuleBoth = true; ViewBag.RequiredModuleOther = true; } objInsiderDashboardModel.objInsiderDashboardOtherModel = BindDashboardForOtherSecurities(); break; } if (objInsiderDashboardModel.objInsiderDashboardOtherModel.IsChangePassword) { Common.Common.SetSessionValue("IsChangePassword", true); return(RedirectToAction("ChangePassword", "UserDetails", new { acid = Convert.ToString(Common.ConstEnum.UserActions.CHANGE_PASSWORD) })); } using (InsiderDashboardSL objInsiderDashboardSL = new InsiderDashboardSL()) { objInsiderDashboardDTO = objInsiderDashboardSL.GetTradingCalenderDetails(objLoginUserDetails.CompanyDBConnectionString, objLoginUserDetails.LoggedInUserID); if (objInsiderDashboardDTO.IsActivated == 1) { ViewBag.hideTrading = 0; } else { ViewBag.hideTrading = 1; } objInsiderDashboardDTO = objInsiderDashboardSL.GetDashboardDetails(objLoginUserDetails.CompanyDBConnectionString, objLoginUserDetails.LoggedInUserID); Common.Common.CopyObjectPropertyByName(objInsiderDashboardDTO, objInsiderDashboardModel); CurrentDate = Convert.ToDateTime(DateTime.Now.Date.ToString("dd/MM/yyyy"), System.Globalization.CultureInfo.GetCultureInfo("hi-IN").DateTimeFormat); objPassExpiryReminderDTO = objInsiderDashboardSL.GetPasswordExpiryReminder(objLoginUserDetails.CompanyDBConnectionString, objLoginUserDetails.LoggedInUserID); if (objLoginUserDetails.LoggedInUserID == objPassExpiryReminderDTO.UserID && objPassExpiryReminderDTO.ValidityDate.Date >= CurrentDate && objPassExpiryReminderDTO.ExpiryReminderDate.Date <= CurrentDate) { if ((objPassExpiryReminderDTO.ValidityDate.Date - CurrentDate.Date).Days == 1) { noOfDays = (objPassExpiryReminderDTO.ValidityDate.Date - CurrentDate.Date).Days; } else { noOfDays = (objPassExpiryReminderDTO.ValidityDate.Date - CurrentDate.Date).Days + 1; } lst.Add(noOfDays); lst.Add(objPassExpiryReminderDTO.ValidityDate.Date.ToString("dd/MM/yyyy")); ViewBag.PasswordReminderMsg = Common.Common.getResource("pc_msg_50569", lst); } else if (objPassExpiryReminderDTO.ValidityDate.Date < CurrentDate) { Common.Common.SetSessionValue("IsChangePassword", true); return(RedirectToAction("ChangePassword", "UserDetails", new { acid = Convert.ToString(Common.ConstEnum.UserActions.CHANGE_PASSWORD) })); } } using (UserInfoSL objUserInfoSL = new UserInfoSL()) { objUserInfoDTO = objUserInfoSL.GetUserDetails(objLoginUserDetails.CompanyDBConnectionString, objLoginUserDetails.LoggedInUserID); if (objUserInfoDTO.DateOfBecomingInsider != null) { ViewBag.InsiderTypeUser = 1; } else { ViewBag.InsiderTypeUser = 0; } } int SecurityTypeCodeIdCnt = 0; int TransactionTypeCodeIdCnt = 0; int DateOfAcquisitionCnt = 0; using (InsiderDashboardSL objInsiderDashboardSL = new InsiderDashboardSL()) { List <DupTransCntDTO> lstDupTransCnt = objInsiderDashboardSL.Get_DupTransCnt(objLoginUserDetails.CompanyDBConnectionString, objLoginUserDetails.LoggedInUserID); foreach (var dupTransCnt in lstDupTransCnt) { SecurityTypeCodeIdCnt = dupTransCnt.SecurityTypeCodeIdCnt; TransactionTypeCodeIdCnt = dupTransCnt.TransactionTypeCodeIdCnt; DateOfAcquisitionCnt = dupTransCnt.DateOfAcquisitionCnt; } } if (SecurityTypeCodeIdCnt != 0 && TransactionTypeCodeIdCnt != 0 && DateOfAcquisitionCnt != 0) { ViewBag.dupTransCnt = true; TempData["TradingTransactionModel"] = null; TempData["DuplicateTransaction"] = null; } int localApprovedPCLCnt = 0; using (TradingTransactionSL objTradingTransactionSL = new TradingTransactionSL()) { List <ApprovedPCLDTO> lstApprovedPCLCnt = objTradingTransactionSL.GetApprovedPCLCntSL(objLoginUserDetails.CompanyDBConnectionString, objLoginUserDetails.LoggedInUserID); foreach (var ApprovedPCLCnt in lstApprovedPCLCnt) { localApprovedPCLCnt = ApprovedPCLCnt.ApprovedPCLCnt; } } if (localApprovedPCLCnt != 0) { ViewBag.ApprovedPCLCnt = true; } } catch (Exception exp) { Common.Common.WriteLogToFile("Exception occurred ", System.Reflection.MethodBase.GetCurrentMethod(), exp); } finally { objLoginUserDetails = null; objInsiderDashboardDTO = null; objUserInfoDTO = null; } Common.Common.WriteLogToFile("End Method", System.Reflection.MethodBase.GetCurrentMethod()); return(View(objInsiderDashboardModel)); }
public ActionResult SecuritiesIndex(int acid, int UserInfoId = 0, int RequiredModuleID = 0, int requiredModuleIDOnbtnclick = 0, int TradingPolicyID_OS = 0) { LoginUserDetails objLoginUserDetails = null; InsiderInitialDisclosureSL objInsiderInitialDisclosureSL = null; List <InsiderInitialDisclosureDTO> lstInsiderInitialDisclosureDTO = null; InsiderInitialDisclosureModel objInsiderInitialDisclosureModel = new InsiderInitialDisclosureModel(); objInsiderInitialDisclosureModel.InsiderInitialDisclosureModelEmployee1 = new List <InsiderInitialDisclosureModelEmployee>(); objInsiderInitialDisclosureModel.InsiderInitialDisclosureModelInsider1 = new List <InsiderInitialDisclosureModelInsider>(); ViewBag.show_cancel_btn = true; ViewBag.Change_Btn_Color = false; ViewBag.ShowOwnEmp = false; ViewBag.ShowOwnInsider = false; ViewBag.ShowOtherEmp = false; ViewBag.ShowOtherInsider = false; try { objLoginUserDetails = (LoginUserDetails)Common.Common.GetSessionValue(ConstEnum.SessionValue.UserDetails); objInsiderInitialDisclosureSL = new InsiderInitialDisclosureSL(); if (!(objLoginUserDetails.UserTypeCodeId == InsiderTrading.Common.ConstEnum.Code.Admin || objLoginUserDetails.UserTypeCodeId == InsiderTrading.Common.ConstEnum.Code.COUserType)) { UserInfoId = objLoginUserDetails.LoggedInUserID; ViewBag.show_cancel_btn = false; } ViewBag.UsrTypeCodeId = objLoginUserDetails.UserTypeCodeId; ViewBag.UsrTypeCodeIdEmp = objLoginUserDetails.UserTypeCodeId; if (requiredModuleIDOnbtnclick == 513001 || requiredModuleIDOnbtnclick == 513003 || ((RequiredModuleID == 513003 || RequiredModuleID == 513001) && requiredModuleIDOnbtnclick == 0 && TradingPolicyID_OS == 0)) { //get policy and event list (combine list) lstInsiderInitialDisclosureDTO = objInsiderInitialDisclosureSL.GetDashBoardDetails(objLoginUserDetails.CompanyDBConnectionString, UserInfoId, objLoginUserDetails.UserTypeCodeId).ToList(); //convert DTO object to model foreach (InsiderInitialDisclosureDTO objInsiderInitialDisclosureDTO in lstInsiderInitialDisclosureDTO) { objInsiderInitialDisclosureModel.InsiderInitialDisclosureModelEmployee = new InsiderInitialDisclosureModelEmployee(); Common.Common.CopyObjectPropertyByName(objInsiderInitialDisclosureDTO, objInsiderInitialDisclosureModel.InsiderInitialDisclosureModelEmployee); objInsiderInitialDisclosureModel.InsiderInitialDisclosureModelEmployee1.Add(objInsiderInitialDisclosureModel.InsiderInitialDisclosureModelEmployee); } if (lstInsiderInitialDisclosureDTO.Count > 0) { ViewBag.ShowOwnEmp = true; } lstInsiderInitialDisclosureDTO = null; lstInsiderInitialDisclosureDTO = objInsiderInitialDisclosureSL.GetDashBoardDetailsInsider(objLoginUserDetails.CompanyDBConnectionString, UserInfoId, objLoginUserDetails.UserTypeCodeId).ToList(); //convert DTO object to model foreach (InsiderInitialDisclosureDTO objInsiderInitialDisclosureDTO in lstInsiderInitialDisclosureDTO) { objInsiderInitialDisclosureModel.InsiderInitialDisclosureModelInsider = new InsiderInitialDisclosureModelInsider(); Common.Common.CopyObjectPropertyByName(objInsiderInitialDisclosureDTO, objInsiderInitialDisclosureModel.InsiderInitialDisclosureModelInsider); objInsiderInitialDisclosureModel.InsiderInitialDisclosureModelInsider1.Add(objInsiderInitialDisclosureModel.InsiderInitialDisclosureModelInsider); } if (lstInsiderInitialDisclosureDTO.Count > 0) { ViewBag.ShowOwnInsider = true; } } else { ////get policy and event list (combine list) //lstInsiderInitialDisclosureDTO = objInsiderInitialDisclosureSL.GetDashBoardDetails_OS(objLoginUserDetails.CompanyDBConnectionString, UserInfoId, objLoginUserDetails.UserTypeCodeId).ToList(); ////convert DTO object to model //foreach (InsiderInitialDisclosureDTO objInsiderInitialDisclosureDTO in lstInsiderInitialDisclosureDTO) //{ // objInsiderInitialDisclosureModel.InsiderInitialDisclosureModelEmployee = new InsiderInitialDisclosureModelEmployee(); // Common.Common.CopyObjectPropertyByName(objInsiderInitialDisclosureDTO, objInsiderInitialDisclosureModel.InsiderInitialDisclosureModelEmployee); // objInsiderInitialDisclosureModel.InsiderInitialDisclosureModelEmployee1.Add(objInsiderInitialDisclosureModel.InsiderInitialDisclosureModelEmployee); //} //if (lstInsiderInitialDisclosureDTO.Count > 0) // ViewBag.ShowOtherEmp = true; lstInsiderInitialDisclosureDTO = null; lstInsiderInitialDisclosureDTO = objInsiderInitialDisclosureSL.GetDashBoardDetailsInsider_OS(objLoginUserDetails.CompanyDBConnectionString, UserInfoId, objLoginUserDetails.UserTypeCodeId).ToList(); //convert DTO object to model foreach (InsiderInitialDisclosureDTO objInsiderInitialDisclosureDTO in lstInsiderInitialDisclosureDTO) { objInsiderInitialDisclosureModel.InsiderInitialDisclosureModelInsider = new InsiderInitialDisclosureModelInsider(); Common.Common.CopyObjectPropertyByName(objInsiderInitialDisclosureDTO, objInsiderInitialDisclosureModel.InsiderInitialDisclosureModelInsider); objInsiderInitialDisclosureModel.InsiderInitialDisclosureModelInsider1.Add(objInsiderInitialDisclosureModel.InsiderInitialDisclosureModelInsider); } if (lstInsiderInitialDisclosureDTO.Count > 0) { ViewBag.ShowOtherInsider = true; } } ViewBag.UserInfoId = UserInfoId; ViewBag.UserInfoIdEmp = UserInfoId; bool bReturn = true; ViewBag.GridType = ConstEnum.GridType.InitialDisclosureListForEmployee; ViewBag.InsiderGridType = ConstEnum.GridType.InitialDisclosureListForInsider; ViewBag.Company = objLoginUserDetails.CompanyName; //ViewBag.PolicyDocumentList = lstDashBoeard; ViewBag.IsFirstLogin = bReturn; ViewBag.Incomplete = false; ViewBag.RequiredModuleID = RequiredModuleID; ViewBag.TradingPolicyID_OS = TradingPolicyID_OS; //if (requiredModuleIDOnbtnclick == 513001 || requiredModuleIDOnbtnclick == 513003) //return View("Index", lstInsiderInitialDisclosureModel); if (requiredModuleIDOnbtnclick == 513001 || requiredModuleIDOnbtnclick == 513003 || ((RequiredModuleID == 513003 || RequiredModuleID == 513001) && requiredModuleIDOnbtnclick == 0 && TradingPolicyID_OS == 0)) { ViewBag.Change_Btn_Color = true; return(View("Index", objInsiderInitialDisclosureModel)); } else { ViewBag.Change_Btn_Color = true; return(View("OtherSecuritiesIndex", objInsiderInitialDisclosureModel)); } } catch (Exception exp) { ViewBag.Incomplete = false; string sErrMessage = Common.Common.getResource(exp.InnerException.Data[0].ToString()); ModelState.AddModelError("Error", sErrMessage); return(View("Index", objInsiderInitialDisclosureModel)); } finally { objLoginUserDetails = null; objInsiderInitialDisclosureSL = null; lstInsiderInitialDisclosureDTO = null; objInsiderInitialDisclosureModel = null; } }
public ActionResult DisplayPolicy(int acid, int PolicyDocumentID, int DocumentID, string CalledFrom, bool CalledFromHardCopy = false, int year = 0, int Period = 0, string frm = "", bool IsFromDashboard = false, int nUserInfoId = 0, string DiscType = "", int RequiredModuleID = 0) { DocumentDetailsSL objDocumentDetailsSL = null; List <DocumentDetailsDTO> objDocumentDetailsDTOList = null; string FAQMenuURL = string.Empty; string[] MenuURLParts = null; string PID = string.Empty; string ID = string.Empty; List <InsiderTradingDAL.MenuMasterDTO> menuList = new List <MenuMasterDTO>(); ViewBag.RequiredModuleID = InsiderTrading.Common.ConstEnum.Code.RequiredModuleOwnSecurity; menuList = (List <InsiderTradingDAL.MenuMasterDTO>)TempData["MenuList"]; if (CalledFrom == "ViewAgree_OS") { ViewBag.RequiredModuleID = InsiderTrading.Common.ConstEnum.Code.RequiredModuleOtherSecurity; } else { ViewBag.RequiredModuleID = InsiderTrading.Common.ConstEnum.Code.RequiredModuleOwnSecurity; } //Get the MenuURL of FAQ if (CalledFrom.ToUpper().Contains("FAQ") && IsFromDashboard) { foreach (InsiderTradingDAL.MenuMasterDTO item in menuList) { if (!String.IsNullOrEmpty(item.MenuURL) && item.MenuURL.Contains("FAQ")) { FAQMenuURL = item.MenuURL; } } if (!String.IsNullOrEmpty(FAQMenuURL)) { MenuURLParts = FAQMenuURL.Split('&'); } if (MenuURLParts.Length > 0) { for (int i = 0; i <= MenuURLParts.Length - 1; i++) { if (MenuURLParts[i].ToUpper().Contains("DOCUMENTID")) { if (MenuURLParts[i].ToUpper().Contains('=')) { if (MenuURLParts[i].ToUpper().Contains("POLICY")) { PID = MenuURLParts[i].Split('=')[1]; } else { ID = MenuURLParts[i].Split('=')[1]; } } } } PolicyDocumentID = Convert.ToInt32(PID); DocumentID = Convert.ToInt32(ID); } } Boolean isShowDownloadDocumentMsg = true; //flag used to show message to download file bool IsCalledFromReport = false; // flag used to show this page is show from Report page link bool HardCopyFileNotUploaded = false; UsersPolicyDocumentModel objUsersPolicyDocumentModel = new UsersPolicyDocumentModel(); UsersPolicyDocumentDTO objUsersPolicyDocumentDTO = new UsersPolicyDocumentDTO(); InsiderInitialDisclosureSL objInsiderInitialDisclosureSL = new InsiderInitialDisclosureSL(); LoginUserDetails objLoginUserDetails = (LoginUserDetails)InsiderTrading.Common.Common.GetSessionValue((string)ConstEnum.SessionValue.UserDetails); int PurposeCodeId = 0; if (Convert.ToString(objLoginUserDetails.DateOfBecomingInsider).Equals("") && objLoginUserDetails.UserTypeCodeId.Equals(InsiderTrading.Common.ConstEnum.Code.EmployeeType) && (PolicyDocumentID == InsiderTrading.Common.ConstEnum.Code.FAQInsiderPolicyDocumentID || PolicyDocumentID == InsiderTrading.Common.ConstEnum.Code.FAQEmployeePolicyDocumentID)) { PolicyDocumentID = InsiderTrading.Common.ConstEnum.Code.FAQInsiderPolicyDocumentID; DocumentID = InsiderTrading.Common.ConstEnum.Code.FAQDocumentID; } DocumentDetailsDTO objDocumentDetailsDTO = new DocumentDetailsDTO(); UserPolicyDocumentEventLogDTO objUserPolicyDocumentEventLogDTO = null; try { if (DiscType == "OS") { RequiredModuleID = InsiderTrading.Common.ConstEnum.Code.RequiredModuleOtherSecurity; } else { RequiredModuleID = InsiderTrading.Common.ConstEnum.Code.RequiredModuleOwnSecurity; } objDocumentDetailsSL = new DocumentDetailsSL(); objUsersPolicyDocumentModel.PolicyDocumentId = PolicyDocumentID; //in case of hard copy display this value is MapToId objUsersPolicyDocumentModel.DocumentId = DocumentID; objUsersPolicyDocumentModel.CalledFrom = CalledFrom; objUsersPolicyDocumentModel.RequiredModuleID = RequiredModuleID; if (!CalledFromHardCopy && !Common.Common.CheckUserTypeAccess(objLoginUserDetails.CompanyDBConnectionString, ConstEnum.Code.PolicyDocument, Convert.ToInt64(PolicyDocumentID), objLoginUserDetails.LoggedInUserID)) { return(RedirectToAction("Unauthorised", "Home")); } //check if to show policy document details or hard copy file and get details accourdingly if (CalledFromHardCopy) { //get hard copy document details //check if document has uploaded or not -- by checking document id - in case of not uploaded document id is "0" if (DocumentID > 0) { objDocumentDetailsDTO = objDocumentDetailsSL.GetDocumentDetails(objLoginUserDetails.CompanyDBConnectionString, DocumentID); } else { HardCopyFileNotUploaded = true; } //copy document details DTO into User policy document model objUsersPolicyDocumentModel.DocumentId = objDocumentDetailsDTO.DocumentId; objUsersPolicyDocumentModel.PolicyDocumentName = objDocumentDetailsDTO.DocumentName; objUsersPolicyDocumentModel.PolicyDocumentFileType = objDocumentDetailsDTO.FileType; objUsersPolicyDocumentModel.CalledFrom = CalledFrom; objUsersPolicyDocumentModel.DocumentViewFlag = false; objUsersPolicyDocumentModel.DocumentViewAgreeFlag = false; } else { objUsersPolicyDocumentDTO = objInsiderInitialDisclosureSL.GetDocumentDetails(objLoginUserDetails.CompanyDBConnectionString, PolicyDocumentID, DocumentID); objUsersPolicyDocumentDTO.DocumentId = DocumentID; Common.Common.CopyObjectPropertyByName(objUsersPolicyDocumentDTO, objUsersPolicyDocumentModel); } if (objUsersPolicyDocumentModel.DocumentViewAgreeFlag == true) { ViewBag.ViewAgreeFlag = true; ViewBag.ViewFlag = false; } else if (objUsersPolicyDocumentModel.DocumentViewFlag == true) { ViewBag.ViewAgreeFlag = false; ViewBag.ViewFlag = true; } ViewBag.CalledFrom = CalledFrom; ViewBag.Company = objLoginUserDetails.CompanyName; ViewBag.PDID = PolicyDocumentID; ViewBag.Year = year; ViewBag.Period = Period; ViewBag.nUserInfoId = nUserInfoId; int DocMapToTypeCodeId = 0; //get document details - document id - to set and show document to user if (DiscType == "OS") { DocMapToTypeCodeId = (CalledFromHardCopy) ? ConstEnum.Code.DisclosureTransactionforOS : ConstEnum.Code.PolicyDocument; } else { DocMapToTypeCodeId = (CalledFromHardCopy) ? ConstEnum.Code.DisclosureTransaction : ConstEnum.Code.PolicyDocument; } //get details if document is uploaded by checking document id if (DocumentID > 0) { PurposeCodeId = (CalledFrom == "DisclosureDocuments") ? ConstEnum.Code.TransactionDetailsUpload : 0; objDocumentDetailsDTOList = objDocumentDetailsSL.GetDocumentList(objLoginUserDetails.CompanyDBConnectionString, DocMapToTypeCodeId, PolicyDocumentID, PurposeCodeId); ViewBag.DocumentId = objDocumentDetailsDTOList[0].DocumentId; ViewBag.GUID = objDocumentDetailsDTOList[0].GUID; ViewBag.DocumentName = objDocumentDetailsDTOList[0].DocumentName; ViewBag.FileType = objDocumentDetailsDTOList[0].FileType; //check for following file type and set flag to false so message to download file will not be appear if (objDocumentDetailsDTOList[0].FileType == ".pdf") { isShowDownloadDocumentMsg = false; } } //set flag to show download document message ViewBag.ShowDownloadDocumentMsg = isShowDownloadDocumentMsg; //check if in session "BackURL" is set or not -- this URL is set from report contoller //if url is set then set flag true in viewbag for URL from Report page and reset backurl to empty if (objLoginUserDetails.BackURL != null && objLoginUserDetails.BackURL != "") { IsCalledFromReport = true; ViewBag.ReturnUrl = objLoginUserDetails.BackURL; objLoginUserDetails.BackURL = ""; Common.Common.SetSessionValue(ConstEnum.SessionValue.UserDetails, objLoginUserDetails); } ViewBag.IsCalledFromReport = IsCalledFromReport; ViewBag.CalledFromHardCopy = CalledFromHardCopy; ViewBag.HardCopyFileNotUploaded = HardCopyFileNotUploaded; ViewBag.frm = frm; ViewBag.UserAction = acid; // check from where document is displayed -- if policy document is displayed to user which are view only and whoes status is view only // then add event to viewed for user if (CalledFrom != null && (CalledFrom.ToLower() == "view" || CalledFrom.ToLower() == "viewagreelist")) { //check is document show is view only document if (objUsersPolicyDocumentModel.DocumentViewAgreeFlag != true && objUsersPolicyDocumentModel.DocumentViewFlag == true) { objUserPolicyDocumentEventLogDTO = new UserPolicyDocumentEventLogDTO(); objUserPolicyDocumentEventLogDTO.EventCodeId = ConstEnum.Code.PolicyDocumentViewd; objUserPolicyDocumentEventLogDTO.MapToTypeCodeId = ConstEnum.Code.PolicyDocument; objUserPolicyDocumentEventLogDTO.MapToId = objUsersPolicyDocumentModel.PolicyDocumentId; // save policy document viewed event objInsiderInitialDisclosureSL.SaveEvent(objLoginUserDetails.CompanyDBConnectionString, objUserPolicyDocumentEventLogDTO, objLoginUserDetails.LoggedInUserID); } } return(View("~/Views/InsiderInitialDisclosure/ViewDocument.cshtml", objUsersPolicyDocumentModel)); } catch (Exception ex) { string sErrMessage = Common.Common.getResource(ex.InnerException.Data[0].ToString()); ModelState.AddModelError("Error", sErrMessage); return(View("~/Views/InsiderInitialDisclosure/ViewDocument.cshtml")); } finally { objDocumentDetailsSL = null; objDocumentDetailsDTOList = null; objUsersPolicyDocumentModel = null; objUsersPolicyDocumentDTO = null; objInsiderInitialDisclosureSL = null; objLoginUserDetails = null; objDocumentDetailsDTO = null; objUserPolicyDocumentEventLogDTO = null; } }
public ActionResult AllMassUpload(int acid) { ViewBag.acid = acid; LoginUserDetails objLoginUserDetails = null; objLoginUserDetails = (LoginUserDetails)Common.Common.GetSessionValue(Common.ConstEnum.SessionValue.UserDetails); List <MassUploadDTO> lstMassUploadDTO = new List <MassUploadDTO>(); MassUploadSL massUploadSL = new MassUploadSL(); List <RoleActivityDTO> lstRoleActivities; int roleId, RequiredModuleID; switch (objLoginUserDetails.UserTypeCodeId) { case InsiderTradingMassUpload.ConstEnum.UserTypeCodeId.Admin: roleId = 1; break; case InsiderTradingMassUpload.ConstEnum.UserTypeCodeId.COUserType: roleId = 2; break; default: roleId = 7; break; } using (var objInsiderInitialDisclosureSL = new InsiderInitialDisclosureSL()) { InsiderInitialDisclosureDTO objInsiderInitialDisclosureDTO = null; objInsiderInitialDisclosureDTO = objInsiderInitialDisclosureSL.Get_mst_company_details(objLoginUserDetails.CompanyDBConnectionString); RequiredModuleID = objInsiderInitialDisclosureDTO.RequiredModule; } if (acid == 344) { using (var objRoleActivityDAL = new RoleActivityDAL()) { lstRoleActivities = objRoleActivityDAL.GetDetails(objLoginUserDetails.CompanyDBConnectionString, roleId); } bool isOwnUnable = false; bool IsOtherEnable = false; switch (RequiredModuleID) { case Common.ConstEnum.Code.RequiredModuleOwnSecurity: isOwnUnable = true; lstMassUploadDTO = massUploadSL.GetUploadMassList(GetAllMassUpload(), isOwnUnable, IsOtherEnable, objLoginUserDetails.UserTypeCodeId); break; case Common.ConstEnum.Code.RequiredModuleOtherSecurity: IsOtherEnable = true; lstMassUploadDTO = massUploadSL.GetUploadMassList(GetAllMassUpload(), isOwnUnable, IsOtherEnable, objLoginUserDetails.UserTypeCodeId); break; case Common.ConstEnum.Code.RequiredModuleBoth: isOwnUnable = Convert.ToBoolean(lstRoleActivities.Where(c => c.ActivityID == 344).Select(c => c.IsSelected).Single()); IsOtherEnable = Convert.ToBoolean(lstRoleActivities.Where(c => c.ActivityID == 345).Select(c => c.IsSelected).Single()); lstMassUploadDTO = massUploadSL.GetUploadMassList(GetAllMassUpload(), isOwnUnable, IsOtherEnable, objLoginUserDetails.UserTypeCodeId); break; } } else { switch (RequiredModuleID) { case Common.ConstEnum.Code.RequiredModuleOwnSecurity: lstMassUploadDTO = GetAllMassUpload().Where(c => !c.MassUploadName.Contains("- Other")).ToList(); break; case Common.ConstEnum.Code.RequiredModuleOtherSecurity: lstMassUploadDTO = GetAllMassUpload().Where(c => c.MassUploadExcelId != 2 && c.MassUploadExcelId != 5 && c.MassUploadExcelId != 4 && c.MassUploadExcelId != 51).ToList(); break; case Common.ConstEnum.Code.RequiredModuleBoth: lstMassUploadDTO = GetAllMassUpload(); break; } } lstMassUploadDTO = massUploadSL.GetSequenceMassUploadList(lstMassUploadDTO); ViewBag.AllMassUpload = lstMassUploadDTO; return(View("~/Views/Common/MassUpload.cshtml")); }
public ActionResult Index(int acid) { int RequiredModuleID = 0; LoginUserDetails objLoginUserDetails = null; CODashboardDTO objInsiderDashboardDTO = null; PasswordExpiryReminderDTO objPassExpiryReminderDTO = null; DateTime CurrentDate; ArrayList lst = new ArrayList(); UserPolicyDocumentEventLogDTO objChangePasswordEventLogDTO = null; int noOfDays = 0; Common.Common.WriteLogToFile("Start Method", System.Reflection.MethodBase.GetCurrentMethod()); try { objLoginUserDetails = (LoginUserDetails)Common.Common.GetSessionValue(ConstEnum.SessionValue.UserDetails); // check IsUserLogin flag in session, and set flag true -- this will indicate user is login and redirect here for first time if (!objLoginUserDetails.IsUserLogin) { objLoginUserDetails.IsUserLogin = true; Common.Common.SetSessionValue(ConstEnum.SessionValue.UserDetails, objLoginUserDetails); } objInsiderDashboardModel = new CODashboardModel(); using (var objInsiderInitialDisclosureSL = new InsiderInitialDisclosureSL()) { InsiderInitialDisclosureDTO objInsiderInitialDisclosureDTO = null; objInsiderInitialDisclosureDTO = objInsiderInitialDisclosureSL.Get_mst_company_details(objLoginUserDetails.CompanyDBConnectionString); RequiredModuleID = objInsiderInitialDisclosureDTO.RequiredModule; } ViewBag.UserTypeCodeId = objLoginUserDetails.UserTypeCodeId; objInsiderDashboardModel.objCODashboardModel_OS = new CODashboardModel_OS(); switch (RequiredModuleID) { case ConstEnum.Code.RequiredModuleOwnSecurity: ViewBag.RequiredModuleOwn = true; ViewBag.RequiredModuleBoth = false; ViewBag.RequiredModuleOther = false; break; case ConstEnum.Code.RequiredModuleOtherSecurity: ViewBag.RequiredModuleOwn = false; ViewBag.RequiredModuleBoth = false; ViewBag.RequiredModuleOther = true; objInsiderDashboardModel.objCODashboardModel_OS = BindCODashboardForOtherSecurities(); break; case ConstEnum.Code.RequiredModuleBoth: ViewBag.RequiredModuleOwn = true; ViewBag.RequiredModuleBoth = true; ViewBag.RequiredModuleOther = true; objInsiderDashboardModel.objCODashboardModel_OS = BindCODashboardForOtherSecurities(); break; } using (CODashboardSL objInsiderDashboardSL = new CODashboardSL()) { objInsiderDashboardDTO = objInsiderDashboardSL.GetDashboardDetails(objLoginUserDetails.CompanyDBConnectionString, objLoginUserDetails.LoggedInUserID); Common.Common.CopyObjectPropertyByName(objInsiderDashboardDTO, objInsiderDashboardModel); } using (InsiderDashboardSL objInsiderDashboardSL = new InsiderDashboardSL()) { CurrentDate = Convert.ToDateTime(DateTime.Now.Date.ToString("dd/MM/yyyy"), System.Globalization.CultureInfo.GetCultureInfo("hi-IN").DateTimeFormat); objPassExpiryReminderDTO = objInsiderDashboardSL.GetPasswordExpiryReminder(objLoginUserDetails.CompanyDBConnectionString, objLoginUserDetails.LoggedInUserID); if (objLoginUserDetails.LoggedInUserID == objPassExpiryReminderDTO.UserID && objPassExpiryReminderDTO.ValidityDate.Date >= CurrentDate && objPassExpiryReminderDTO.ExpiryReminderDate.Date <= CurrentDate) { if ((objPassExpiryReminderDTO.ValidityDate.Date - CurrentDate.Date).Days == 1) { noOfDays = (objPassExpiryReminderDTO.ValidityDate.Date - CurrentDate.Date).Days; } else { noOfDays = (objPassExpiryReminderDTO.ValidityDate.Date - CurrentDate.Date).Days + 1; } lst.Add(noOfDays); lst.Add(objPassExpiryReminderDTO.ValidityDate.Date.ToString("dd/MM/yyyy")); ViewBag.PasswordReminderMsg = Common.Common.getResource("pc_msg_50569", lst); } else if (objPassExpiryReminderDTO.ValidityDate.Date < CurrentDate) { Common.Common.SetSessionValue("IsChangePassword", true); return(RedirectToAction("ChangePassword", "UserDetails", new { acid = Convert.ToString(Common.ConstEnum.UserActions.CHANGE_PASSWORD) })); } } } catch (Exception exp) { Common.Common.WriteLogToFile("Exception occurred ", System.Reflection.MethodBase.GetCurrentMethod(), exp); } finally { objLoginUserDetails = null; } Common.Common.WriteLogToFile("End Method", System.Reflection.MethodBase.GetCurrentMethod()); return(View(objInsiderDashboardModel)); }