public ActionResult SearchDataForBenificiary(SearchModel objmodel)
        {
            /*Set values for helper*/
            Helper.CompanyName = Convert.ToString(objmodel.CompanyName);
            Helper.Address     = Convert.ToString(objmodel.Address);
            Helper.City        = Convert.ToString(objmodel.City);
            Helper.State       = Convert.ToString(objmodel.State);
            Helper.PhoneNbr    = Convert.ToString(objmodel.PhoneNbr);
            Helper.Zip         = Convert.ToString(objmodel.Zip);
            Helper.Address1    = Convert.ToString(objmodel.Address2);

            APIResponse      response;
            MainMatchEntity  objmainMatchEntity = new MainMatchEntity();
            CommonSearchData common             = new CommonSearchData();

            if (string.IsNullOrEmpty(objmodel.DUNS))
            {
                objmainMatchEntity = common.LoadData(objmodel.CompanyName, objmodel.Address, objmodel.Address2, objmodel.City, objmodel.State, objmodel.Country, objmodel.Zip, objmodel.PhoneNbr, objmodel.ExcludeNonHeadQuarters, objmodel.ExcludeNonMarketable, objmodel.ExcludeOutofBusiness, objmodel.ExcludeUndeliverable, objmodel.ExcludeUnreachable, objmodel.Language, null, this.CurrentClient.ApplicationDBConnectionString, null);
            }
            else
            {
                CommonSearchData objCommonSearch = new CommonSearchData();
                CommonMethod     objCommon       = new CommonMethod();
                response = objCommonSearch.SearchByDUNS(objmodel.DUNS, this.CurrentClient.ApplicationDBConnectionString);
                objmainMatchEntity.ResponseErroeMessage = Helper.ResponseErroeMessage;
                if (response != null)
                {
                    objCommon.InsertAPILogs(response.TransactionResponseDetail, this.CurrentClient.ApplicationDBConnectionString);
                    CompanyFacade fcd = new CompanyFacade(this.CurrentClient.ApplicationDBConnectionString, Helper.oUser.UserName);
                    fcd.InsertCleanseMatchCallResults("", response.ResponseJSON, response.APIRequest, Helper.oUser.UserId, "");
                    objmainMatchEntity.lstMatches = response.MatchEntities;
                }
                if (!string.IsNullOrEmpty(response?.ResponseJSON))
                {
                    dynamic data = JObject.Parse(response.ResponseJSON);
                    if (data.error != null && !string.IsNullOrEmpty(data.error.errorMessage.Value))
                    {
                        objmainMatchEntity.ResponseErroeMessage = data.error.errorMessage.Value;
                        return(Json(new { result = false, message = objmainMatchEntity.ResponseErroeMessage }));
                    }
                }
            }
            if (objmainMatchEntity.lstMatches == null)
            {
                objmainMatchEntity.lstMatches = new List <MatchEntity>();
            }
            SessionHelper.SearchMatch = JsonConvert.SerializeObject(objmainMatchEntity.lstMatches);
            SessionHelper.SearchModel = JsonConvert.SerializeObject(objmodel);
            return(View("_Index", objmainMatchEntity));
        }
Esempio n. 2
0
        public static SelectList StewGetDataImportProcess(string ConnectionString, string Queue, bool IsMatchdata)
        {
            CompanyFacade         fac = new CompanyFacade(ConnectionString, Helper.oUser.UserName);
            DataTable             dt  = fac.GetImportProcessesByQueue(Queue, IsMatchdata);
            List <SelectListItem> lstImportProcess = new List <SelectListItem>();

            for (int i = 0; i < dt.Rows.Count; i++)
            {
                lstImportProcess.Add(new SelectListItem {
                    Value = dt.Rows[i]["ImportProcess"].ToString(), Text = dt.Rows[i]["ImportProcess"].ToString()
                });
            }
            return(new SelectList(lstImportProcess, "Value", "Text"));
        }
Esempio n. 3
0
        // Get State or region
        public static List <string> GetStates(string ConnectionString)
        {
            int totalrecords = 10;

            BadInputDataModel model = new BadInputDataModel();
            CompanyFacade     fac   = new CompanyFacade(ConnectionString, Helper.UserName);
            //model.Companies = fac.GetBIDCompany(Helper.oUser.UserId, 1, 10, out totalrecords);
            Tuple <List <CompanyEntity>, string> tuplecompany = fac.GetBIDCompany(Helper.oUser.UserId, 1, 10, out totalrecords);

            model.Companies = tuplecompany.Item1;
            var states = (from a in model.Companies select a.State).Distinct().ToList();

            return(states);
        }
Esempio n. 4
0
        public async Task <ActionResult> JobOfferList()
        {
            var company = await CompanyFacade.GetCompanyAccordingToUsernameAsync(User.Identity.Name);

            var filter = new JobOfferFilterDto {
                CompanyId = company.Id
            };
            var result = await JobOfferFacade.GetJobOffersAsync(filter);

            var model = new JobOfferListModel {
                Filter = filter, JobOffers = new List <JobOfferDto>(result.Items)
            };

            return(View(model));
        }
Esempio n. 5
0
        public async Task <ActionResult> Create(StockItemCreation item)
        {
            int companyId = (await CompanyFacade.FindCompanyByEmployeeEmail(User.Identity.Name)).Id;

            await MenuItemFacade.Create(new MenuItemDto
            {
                CompanyId = companyId,
                Name      = item.MenuItem.Name,
                SellPrice = item.MenuItem.SellPrice,
                BuyPrice  = item.MenuItem.BuyPrice,
                Amount    = 0
            });

            return(Stock().Result);
        }
Esempio n. 6
0
        public ActionResult ExportExcel()
        {
            long          searchResultId = Convert.ToInt64(Session["Id"]);
            CompanyFacade fac            = new CompanyFacade(this.CurrentClient.ApplicationDBConnectionString, Helper.UserName);
            var           data           = fac.ExportBuildResult(searchResultId);

            if (searchResultId <= 0)
            {
                data = new System.Data.DataTable();
            }
            string fileName  = "BuildList_" + DateTime.Now.Ticks.ToString() + ".xlsx";
            string SheetName = "BuildList";

            byte[] response = CommonExportMethods.ExportExcelFile(data, fileName, SheetName);
            return(File(response, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", fileName));
        }
Esempio n. 7
0
        public ActionResult DataQueueDashboard()
        {
            // //report for Data Queue Dashboard
            DataTable dtDataQueue = new DataTable();

            if (Session["lstDataQueue"] != null)
            {
                dtDataQueue = Session["lstDataQueue"] as DataTable;
            }
            else
            {
                CompanyFacade fac = new CompanyFacade(this.CurrentClient.ApplicationDBConnectionString, Helper.UserName);
                dtDataQueue = fac.GetDataQueueDashboardReport();
            }
            return(PartialView("DataQueueTitle", dtDataQueue));
        }
Esempio n. 8
0
        public void CompanyFacadeTest()
        {
            var unit = new UnitOfWork(GetInMemoryOptions());

            Seeder.Seed(unit);

            var userService   = new UserService(unit, new UserQueryObject(unit));
            var compService   = new CompanyService(unit, new CompanyQueryObject(unit));
            var companyFacade = new CompanyFacade(unit, mapper, compService, userService);

            // Null ID edit/update
            companyFacade.AddAsync(new CompanyDto()
            {
                Name = "Lol"
            }).Wait();
            //unit.SaveChanges();
            var lol = compService.ListCompaniesByNameAsync("Lol").Result.First();

            Assert.NotNull(lol);
            Assert.NotNull(lol.Id);
            lol.Id   = null;
            lol.Name = "new lol";
            var excp2 = Assert.Throws <AggregateException>(() =>
                                                           companyFacade.EditInfoAsync(mapper.Map <CompanyDto>(lol)).Wait());

            Assert.Contains("The property 'Id' on entity type 'Company' is part of a key " +
                            "and so cannot be modified or marked as modified.",
                            excp2.Message);


            // Addition with conflicting ID
            // This invalidates the database
            var id1Company = unit.CompanyRepository.GetById(1);

            Assert.NotNull(id1Company); // makes sure company with id 1 is already in database
            var excp = Assert.Throws <AggregateException>(() =>
                                                          companyFacade.AddAsync(new CompanyDto()
            {
                Id = 1
            }).Wait());

            Assert.Contains("The instance of entity type 'Company' cannot be tracked " +
                            "because another instance with the same key value for {'Id'} is already being tracked.",
                            excp.Message);

            unit.Dispose();
        }
        public ActionResult MixModeAPICredentials()
        {
            CleanseMatchSettingsModel model = new CleanseMatchSettingsModel();
            SettingFacade             fac   = new SettingFacade(this.CurrentClient.ApplicationDBConnectionString);

            // Fill all dropdown and value for setting value.
            model.Settings = fac.GetCleanseMatchSettings();
            GetSettingIDs(model);
            SetMatchGradeContent(model);
            Clear(model);
            ViewBag.ApiLayer = model.Settings.Where(x => x.SettingName == "API_LAYER").FirstOrDefault().SettingValue;
            CompanyFacade fcd       = new CompanyFacade(this.CurrentClient.ApplicationDBConnectionString, Helper.UserName);
            string        APIFamily = fcd.GetAPILayer("Match and Cleanse");

            ViewBag.APIFamily = APIFamily;
            return(PartialView(model));
        }
Esempio n. 10
0
        //bulk insert for Secondary Auto-Acceptance Criteria
        public bool BulkInsert(DataTable dt, DataTable dtColumns, bool IsOverWrite = false, int?CommentId = null)
        {
            bool          DataInsert = false;
            CompanyFacade fac        = new CompanyFacade(this.CurrentClient.ApplicationDBConnectionString, Helper.UserName);

            using (SqlConnection connection = new SqlConnection(this.CurrentClient.ApplicationDBConnectionString))
            {
                if (connection.State == ConnectionState.Closed)
                {
                    connection.Open();
                }
                //Creating Transaction so that it can rollback if got any error while uploading
                SqlTransaction trans = connection.BeginTransaction();
                //Start bulkCopy
                using (SqlBulkCopy bulkCopy = new SqlBulkCopy(connection, SqlBulkCopyOptions.TableLock | SqlBulkCopyOptions.FireTriggers, trans))
                {
                    //Setting timeout to 0 means no time out for this command will not timeout until upload complete.
                    //Change as per you
                    bulkCopy.BulkCopyTimeout = 0;
                    foreach (DataRow drCol in dtColumns.Rows)
                    {
                        bulkCopy.ColumnMappings.Add(drCol["Excelcolumn"].ToString(), drCol["Tablecolumn"].ToString());
                    }
                    bulkCopy.DestinationTableName = "ext.SecondaryAutoAcceptanceCriteriaGroup";
                    try
                    {
                        bulkCopy.WriteToServer(dt);
                        trans.Commit();
                        DataInsert = true;
                        SettingFacade sfac    = new SettingFacade(this.CurrentClient.ApplicationDBConnectionString);
                        string        Message = sfac.MergeSecondaryAutoAcceptCriteria(IsOverWrite, Helper.oUser.UserId, Convert.ToInt32(CommentId));
                        TempData["BulkMessage"] = "Data Inserted Successfully.";
                        if (!string.IsNullOrEmpty(Message))
                        {
                            TempData["BulkMessage"] = Message;
                        }
                    }
                    catch (Exception ex)
                    {
                        TempData["BulkMessage"] = ex.Message.ToString();
                        DataInsert = false;
                    }
                }
            }
            return(DataInsert);
        }
Esempio n. 11
0
        // GET: Order
        public async Task <ActionResult> Order()
        {
            List <OrderWithFullDependencyDto> orders = await CompanyFacade.GetAllOrdersWithDependencies(User.Identity.Name);

            List <OrderInfo> ordersInfo = new List <OrderInfo>();

            orders = orders.OrderBy(x => x.OrderStartTime).ToList();
            orders.ForEach(o => ordersInfo.Add(
                               new OrderInfo
            {
                Id             = o.Id,
                OrderStartTime = o.OrderStartTime,
                OrderTable     = o.OrderTable,
                isPaid         = o.Items.TrueForAll(i => i.IsPaid),
                isClosed       = o.IsClosed
            }));
            return(View(ordersInfo));
        }
Esempio n. 12
0
        // GET: ReportsList
        public ActionResult Index(string id)
        {
            string UserGroup = "";

            ViewBag.Id = id;
            CompanyFacade fac         = new CompanyFacade(this.CurrentClient.ApplicationDBConnectionString, Helper.UserName);
            DataTable     dtDataQueue = fac.GetDataQueueDashboardReport();

            Session["lstDataQueue"] = dtDataQueue;
            DataSet dtDataStewardStatistics = fac.GetdtDataStewardStatisticsReport(UserGroup);

            SessionHelper.dtDataStewardStatistics = JsonConvert.SerializeObject(dtDataStewardStatistics);

            DataSet dsDataAPIUsage = fac.GetdtAPIReport();

            SessionHelper.dsDataAPIUsage = JsonConvert.SerializeObject(dsDataAPIUsage);

            return(View());
        }
Esempio n. 13
0
        public JsonResult SetUserLayoutPreference(string userLayout)
        {
            CompanyFacade fac = new CompanyFacade(this.CurrentClient.ApplicationDBConnectionString, Helper.UserName);

            fac.SetUserLayoutPreference(Helper.oUser.UserId, userLayout);
            if (userLayout == "PANEL")
            {
                Session["ApproveMatchDataDefaultView"] = "PANEL";
                Session["ApproveMatchDataCurrentView"] = "PANEL";
            }
            else
            {
                Session["ApproveMatchDataDefaultView"] = "GRID";
                Session["ApproveMatchDataCurrentView"] = "GRID";
            }
            return(new JsonResult {
                Data = "success"
            });
        }
Esempio n. 14
0
        public ActionResult AddCorporateLinkageDuns(string Parameters)
        {
            string duns;

            if (!string.IsNullOrEmpty(Parameters))
            {
                duns = StringCipher.Decrypt(Parameters.Replace(Utility.Utility.urlseparator, "+"), General.passPhrase);

                CompanyFacade fac     = new CompanyFacade(this.CurrentClient.ApplicationDBConnectionString, Helper.UserName);
                string        message = fac.PopulateCorporateLinkageDuns(duns);
                return(new JsonResult {
                    Data = new { Message = message, result = true }
                });
            }
            else
            {
                return(Json(false, JsonRequestBehavior.AllowGet));
            }
        }
Esempio n. 15
0
        public ActionResult ReMatchRecords(ReMatchRecordsEntity model)
        {
            //Implement re-match queue (MP-14)
            CompanyFacade fac = new CompanyFacade(this.CurrentClient.ApplicationDBConnectionString, Helper.UserName);

            model.UserId = Helper.oUser.UserId;
            string Message  = fac.StewReMatchBadInputData(model);
            var    response = string.Empty;

            if (model.GetCountsOnly)
            {
                Message  = "Total " + Message + " records are affected, are you sure you want to continue ?";
                response = string.Format("<input id=\"ReMatchMessage\" name=\"ReMatchMessage\" type=\"hidden\" value=\"{0}\">", Message);
            }
            else
            {
                response = string.Format("<input id=\"ReMatchMessage\" name=\"ReMatchMessage\" type=\"hidden\" value=\"{0}\">", Message);
            }
            return(Content(response));
        }
Esempio n. 16
0
        public ActionResult GetAPIUsageGrid()
        {
            // Get API Usage list for API Usage
            DataSet   dsDataAPIUsage    = new DataSet();
            DataTable dtCurrentMonthCnt = new DataTable();
            List <APIUsagesCurntMonthCntChart> lstAPIUsagesCurntMonthCnt = new List <APIUsagesCurntMonthCntChart>();

            if (!string.IsNullOrEmpty(SessionHelper.dsDataAPIUsage))
            {
                dsDataAPIUsage = JsonConvert.DeserializeObject <DataSet>(SessionHelper.dsDataAPIUsage);
            }
            else
            {
                CompanyFacade fac = new CompanyFacade(this.CurrentClient.ApplicationDBConnectionString, Helper.UserName);
                dsDataAPIUsage = fac.GetdtAPIReport();
            }
            SessionHelper.dsDataAPIUsage = JsonConvert.SerializeObject(dsDataAPIUsage);
            dtCurrentMonthCnt            = dsDataAPIUsage.Tables[0];
            return(PartialView("APIusageGrid", dtCurrentMonthCnt));
        }
Esempio n. 17
0
        public ActionResult AddFamilyTreeNode(string Parameters)
        {
            int    FamilyTreeId;
            string DetailId, NodeName, NodeDisplayDetail, NodeType;
            int?   ParentFamilyTreeDetailId = null;

            try
            {
                if (!string.IsNullOrEmpty(Parameters))
                {
                    Parameters        = StringCipher.Decrypt(Parameters.Replace(Utility.Utility.urlseparator, "+"), General.passPhrase);
                    FamilyTreeId      = Convert.ToInt32(Utility.Utility.SplitParameters(Parameters, Utility.Utility.Colonseparator, 0, 1));
                    DetailId          = Utility.Utility.SplitParameters(Parameters, Utility.Utility.Colonseparator, 1, 1);
                    NodeName          = Utility.Utility.SplitParameters(Parameters, Utility.Utility.Colonseparator, 2, 1);
                    NodeDisplayDetail = Utility.Utility.SplitParameters(Parameters, Utility.Utility.Colonseparator, 3, 1);
                    NodeType          = Utility.Utility.SplitParameters(Parameters, Utility.Utility.Colonseparator, 4, 1);
                    if (!string.IsNullOrEmpty(Utility.Utility.SplitParameters(Parameters, Utility.Utility.Colonseparator, 5, 1)))
                    {
                        ParentFamilyTreeDetailId = Convert.ToInt32(Utility.Utility.SplitParameters(Parameters, Utility.Utility.Colonseparator, 5, 1));
                    }

                    CompanyFacade fac     = new CompanyFacade(this.CurrentClient.ApplicationDBConnectionString, Helper.UserName);
                    string        message = fac.AddFamilyTreeNode(FamilyTreeId, DetailId, NodeName, NodeDisplayDetail, NodeType, ParentFamilyTreeDetailId, Convert.ToInt32(User.Identity.GetUserId()));
                    if (message == string.Empty)
                    {
                        message = FamilyTreeLang.msgFamilyTreeCreated;
                    }
                    return(new JsonResult {
                        Data = new { Message = message, result = true }
                    });
                }
                else
                {
                    return(Json(false, JsonRequestBehavior.AllowGet));
                }
            }
            catch (Exception)
            {
                return(Json(false, JsonRequestBehavior.AllowGet));
            }
        }
Esempio n. 18
0
        public ActionResult popupCompanyAttribute(string Parameters)
        {
            // Get Query string in Encrypted mode and decrypt Query string and set Parameters
            if (!string.IsNullOrEmpty(Parameters))
            {
                Parameters = StringCipher.Decrypt(Parameters.Replace(Utility.Utility.urlseparator, "+"), General.passPhrase);
            }
            string SrcRecordId = Parameters;
            //find custom attribute like tax id, Revenue etc.. by the id.
            DataTable dtAttributes = new DataTable();

            if (!string.IsNullOrEmpty(SrcRecordId))
            {
                CompanyFacade fac = new CompanyFacade(this.CurrentClient.ApplicationDBConnectionString, Helper.UserName);
                dtAttributes = fac.GetComanyAttribute(SrcRecordId);
            }
            IPagedList <dynamic> pagedAttribute = new StaticPagedList <dynamic>(dtAttributes.AsDynamicEnumerable(), 1, 100000, 0);

            ViewBag.SrcRecordId = SrcRecordId;
            return(View(pagedAttribute));
        }
Esempio n. 19
0
        public ActionResult Index(string FileType = null, string ImportProcess = null)
        {
            FileType         = string.IsNullOrEmpty(FileType) ? CommonMessagesLang.lblMyFiles : FileType;
            ViewBag.FileType = FileType;
            if (!string.IsNullOrEmpty(ImportProcess))
            {
                ImportProcess = StringCipher.Decrypt(ImportProcess, General.passPhrase);
            }

            CompanyFacade fac = new CompanyFacade(this.CurrentClient.ApplicationDBConnectionString, Helper.oUser.UserName);
            int?          UserId;

            if (FileType == CommonMessagesLang.lblMyFiles)
            {
                UserId = Helper.oUser.UserId;
            }
            else
            {
                UserId = null;
            }
            ExportJobSettingsFacade efac = new ExportJobSettingsFacade(StringCipher.Decrypt(ConfigurationManager.ConnectionStrings["SolidQMasterWeb"].ConnectionString, General.passPhrase));

            efac.UpdateExportJobSettingNotificationsStatus(this.CurrentClient.ApplicationId, Helper.oUser.UserId, ProviderType.DandB.ToString());
            List <ExportJobSettingsEntity> lstExportJobs = efac.GetExportJobSettingsByUserId(ProviderType.DandB.ToString(), UserId, this.CurrentClient.ApplicationId);

            //set helper for display un-flag export button
            DataTable dtActiveDataStatistics = fac.GetDashboardGetDataQueueStatistics(Helper.oUser != null ? Helper.oUser.LOBTag : null, Helper.oUser != null ? Helper.oUser.Tags : null, Helper.oUser.UserId);

            if (dtActiveDataStatistics.Rows.Count != 0)
            {
                Helper.ArchivalQueueCount = dtActiveDataStatistics.Rows[0]["ArchivalQueueCount"] is DBNull ? 0 : Convert.ToInt32(dtActiveDataStatistics.Rows[0]["ArchivalQueueCount"]);
            }
            ViewBag.ImportProcess = ImportProcess;
            ViewBag.SelectedTab   = "CompanyData";
            if (Request.IsAjaxRequest())
            {
                return(PartialView("CompanyData", lstExportJobs));
            }
            return(View(lstExportJobs));
        }
Esempio n. 20
0
        public void AcceptLCMMatches(string id, string MatchSeqence)
        {
            CompanyFacade          fac   = new CompanyFacade(this.CurrentClient.ApplicationDBConnectionString, Helper.UserName);
            StewardshipPortalModel model = new StewardshipPortalModel();

            if (TempData["TempCompanies"] != null)
            {
                model.Companies = (TempData["TempCompanies"] as List <CompanyEntity>).Copy();
            }
            if (model.Companies.Any() && !string.IsNullOrEmpty(id))
            {
                foreach (var company in model.Companies)
                {
                    if (company.InputId == Convert.ToInt32(id))
                    {
                        if (Convert.ToString(MatchSeqence).ToLower() == "rejectall")
                        {
                            company.Matches.ForEach(x => x.IsSelected = false);
                            company.SelectedMatchCount = 0;
                            company.RejectCompany      = true;
                        }
                        else if (Convert.ToString(MatchSeqence).ToLower() == "unrejectall")
                        {
                            company.RejectCompany = false;
                        }
                        else
                        {
                            company.Matches.ForEach(x => x.IsSelected = false);
                            company.Matches[Convert.ToInt32(MatchSeqence) - 1].IsSelected = true;
                            company.SelectedMatchCount = 1;
                            company.RejectCompany      = false;
                        }
                    }
                }
            }
            TempData["TempCompanies"] = model.Companies;
            Helper.IsDirty            = true;
            TempData.Keep();
        }
Esempio n. 21
0
        public JsonResult GetDataQueue()
        {
            DataTable             dtDataQueue  = new DataTable();
            List <DataQueueChart> lstDataQueue = new List <DataQueueChart>();

            if (Session["lstDataQueue"] != null)
            {
                dtDataQueue = Session["lstDataQueue"] as DataTable;
            }
            else
            {
                CompanyFacade fac = new CompanyFacade(this.CurrentClient.ApplicationDBConnectionString, Helper.UserName);
                dtDataQueue = fac.GetDataQueueDashboardReport();
            }
            for (int i = 0; i < dtDataQueue.Rows.Count; i++)
            {
                DataQueueChart objDataQueue = new DataQueueChart();
                objDataQueue.x = dtDataQueue.Rows[i]["Type"].ToString();
                objDataQueue.y = Convert.ToInt32(dtDataQueue.Rows[i]["Number of Records"].ToString());
                lstDataQueue.Add(objDataQueue);
            }
            return(Json(lstDataQueue, JsonRequestBehavior.AllowGet));
        }
        private bool BulkInsert(DataTable dt, out string msg)
        {
            bool          DataInsert = false;
            CompanyFacade fac        = new CompanyFacade(this.CurrentClient.ApplicationDBConnectionString, Helper.UserName);

            using (SqlConnection connection = new SqlConnection(this.CurrentClient.ApplicationDBConnectionString))
            {
                if (connection.State == ConnectionState.Closed)
                {
                    connection.Open();
                }
                //Creating Transaction so that it can rollback if got any error while uploading
                SqlTransaction trans = connection.BeginTransaction();
                //Start bulkCopy
                using (SqlBulkCopy bulkCopy = new SqlBulkCopy(connection, SqlBulkCopyOptions.TableLock | SqlBulkCopyOptions.FireTriggers, trans))
                {
                    //Setting timeout to 0 means no time out for this command will not timeout until upload complete.
                    //Change as per you
                    bulkCopy.BulkCopyTimeout = 0;
                    bulkCopy.ColumnMappings.Add("", "");
                    bulkCopy.DestinationTableName = "cmpl.ScreeningQueue";
                    try
                    {
                        bulkCopy.WriteToServer(dt);
                        trans.Commit();
                        DataInsert = true;
                        msg        = DandBSettingLang.msgInsertUser;
                    }
                    catch (Exception ex)
                    {
                        msg        = ex.Message;
                        DataInsert = false;
                    }
                }
            }
            return(DataInsert);
        }
Esempio n. 23
0
        public override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            // if request was came from the outside or the other site at that time we redirect to the 404 page and we are not allow the reuest.
            // Get connection string.
            //string GetConnctionstring = Convert.ToString(GetClientConnectionString());// StringCipher.Encrypt(SBISCompanyCleanseMatchBusiness.Objects.General.databaseConnectionString, General.passPhrase);
            //CompanyFacade cfac = new CompanyFacade(GetConnctionstring,Helper.UserName);
            //var oUser = new UsersEntity();
            //if (!string.IsNullOrEmpty(Helper.TempEmailAddress))
            //{
            //    oUser = (Helper.oUser as UsersEntity).Copy();
            //            (Helper.oUser as UsersEntity).Copy();
            //    oUser = cfac.GetUserByLoginId(Helper.TempEmailAddress);
            //}
            //else { oUser = null; }


            string UserStatusCode = "101003";//Convert.ToString(fac.GetUserStatus().Where(x => x.Value.ToLower() == "account locked").Select(x => x.Code).FirstOrDefault());

            if (Helper.oUser == null)
            {
                string        GetConnctionstring = Convert.ToString(GetClientConnectionString());// StringCipher.Encrypt(SBISCompanyCleanseMatchBusiness.Objects.General.databaseConnectionString, General.passPhrase);
                CompanyFacade cfac = new CompanyFacade(GetConnctionstring, Helper.UserName);
                if (!string.IsNullOrEmpty(Helper.TempEmailAddress))
                {
                    Helper.oUser = cfac.GetUserByLoginId(Helper.TempEmailAddress);
                }
            }
            if (Helper.oUser != null && Helper.oUser.UserStatusCode == UserStatusCode)
            {
                filterContext.Result = new ViewResult
                {
                    ViewName = "~/Account/Login",
                    ViewData = filterContext.Controller.ViewData,
                    TempData = filterContext.Controller.TempData
                };
            }
        }
Esempio n. 24
0
        public ActionResult DuplicateFamilyTree(string Parameters)
        {
            int FamilyTreeId; string FamilyTreeName, FamilyTreeType;

            try
            {
                if (!string.IsNullOrEmpty(Parameters))
                {
                    Parameters     = StringCipher.Decrypt(Parameters.Replace(Utility.Utility.urlseparator, "+"), General.passPhrase);
                    FamilyTreeId   = Convert.ToInt32(Utility.Utility.SplitParameters(Parameters, Utility.Utility.Colonseparator, 0, 1));
                    FamilyTreeName = Utility.Utility.SplitParameters(Parameters, Utility.Utility.Colonseparator, 1, 1);
                    FamilyTreeType = Utility.Utility.SplitParameters(Parameters, Utility.Utility.Colonseparator, 2, 1);

                    CompanyFacade fac     = new CompanyFacade(this.CurrentClient.ApplicationDBConnectionString, Helper.UserName);
                    string        message = fac.DuplicaeFamilyTree(FamilyTreeId, FamilyTreeName, FamilyTreeType, Convert.ToInt32(User.Identity.GetUserId()));
                    if (message == string.Empty)
                    {
                        message = FamilyTreeLang.msgDuplicateFamilyTreeCreated;
                    }
                    return(new JsonResult {
                        Data = new { Message = message, result = true }
                    });
                }
                else
                {
                    return(new JsonResult {
                        Data = new { Message = CommonMessagesLang.msgCommanErrorMessage, result = false }
                    });
                }
            }
            catch (Exception)
            {
                return(new JsonResult {
                    Data = new { Message = CommonMessagesLang.msgCommanErrorMessage, result = false }
                });
            }
        }
Esempio n. 25
0
        public async Task <ActionResult> Index(string FileType = null)
        {
            FileType         = string.IsNullOrEmpty(FileType) ? "My Files" : FileType;
            ViewBag.FileType = FileType;

            string ApplicationId = Convert.ToString(this.CurrentClient.ApplicationId);

            CompanyFacade fac = new CompanyFacade(this.CurrentClient.ApplicationDBConnectionString, Helper.oUser.UserName);
            int?          UserId;

            if (FileType == "My Files")
            {
                UserId = Helper.oUser.UserId;
            }
            else
            {
                UserId = null;
            }
            OIExportJobSettingsFacade efac = new OIExportJobSettingsFacade(StringCipher.Decrypt(ConfigurationManager.ConnectionStrings["SolidQMasterWeb"].ConnectionString, General.passPhrase));

            efac.UpdateExportOIJobSettingNotificationsStatus(this.CurrentClient.ApplicationId, Helper.oUser.UserId, ProviderType.OI.ToString());
            List <OIExportJobSettingsEntity> lstExportJobs = efac.GetExportJobSettingsByUserId(ProviderType.OI.ToString(), UserId, this.CurrentClient.ApplicationId);

            //set helper for display un-flag export button
            DataTable dtActiveDataStatistics = fac.GetDashboardGetDataQueueStatistics(Helper.oUser != null ? Helper.oUser.LOBTag : null, Helper.oUser != null ? Helper.oUser.Tags : null, Helper.oUser.UserId);

            if (dtActiveDataStatistics.Rows.Count != 0)
            {
                Helper.ArchivalQueueCount = dtActiveDataStatistics.Rows[0]["ArchivalQueueCount"] is DBNull ? 0 : Convert.ToInt32(dtActiveDataStatistics.Rows[0]["ArchivalQueueCount"]);
            }
            if (Request.IsAjaxRequest())
            {
                return(PartialView("~/Views/OI/OIExportView/_index.cshtml", lstExportJobs));
            }
            return(View("~/Views/OI/OIExportView/Index.cshtml", lstExportJobs));
        }
Esempio n. 26
0
        public async Task <ActionResult> Register(NewCustomerDto customer)
        {
            var isIcoAlreadyRegistered   = (await CompanyFacade.GetAsyncByIco(customer.Ico)) != null;
            var isEmailAlreadyRegistered = (await EmployeeFacade.GetAsyncByEmail(customer.Email)) != null;

            if (isIcoAlreadyRegistered)
            {
                ModelState.AddModelError("Ico", "Ico is already registered");
                return(View());
            }

            if (isEmailAlreadyRegistered)
            {
                ModelState.AddModelError("Email", "Account with that email already exists!");
                return(View());
            }


            await CompanyFacade.RegisterCompanyWithOwner(customer);

            AddAuthTicket(customer.Email, Role.Owner.ToString());

            return(RedirectToAction("Index", "Home"));
        }
Esempio n. 27
0
        public JsonResult Search(BuildListSearchModel model, int?page, int?sortby, int?sortorder, int?pagevalue)
        {
            Response response = new Response();

            try
            {
                #region  pagination
                if (!(sortby.HasValue && sortby.Value > 0))
                {
                    sortby = 1;
                }

                if (!(sortorder.HasValue && sortorder.Value > 0))
                {
                    sortorder = 2;
                }

                int currentPageIndex = page.HasValue ? page.Value : 1;
                int pageSize         = pagevalue.HasValue ? pagevalue.Value : 20;
                #endregion

                #region Set Viewbag
                ViewBag.SortBy    = sortby;
                ViewBag.SortOrder = sortorder;
                ViewBag.pageno    = currentPageIndex;
                ViewBag.pagevalue = pageSize;
                SessionHelper.BuildList_pageno = Convert.ToString(currentPageIndex);
                #endregion

                Utility.Utility api = new Utility.Utility();
                model.Request.pageSize   = ViewBag.pagevalue;
                model.Request.pageNumber = ViewBag.pageno;
                if (model.Request.usSicV4.Any())
                {
                    model.Request.usSicV4 = null;
                }

                if (model.Request.registrationNumbers.Any())
                {
                    model.Request.registrationNumbers = null;
                }
                model.Request.businessEntityType    = null;
                model.Request.familytreeRolesPlayed = null;

                if (model.Request.locationRadius.lat == 0 && model.Request.locationRadius.lon == 0 && model.Request.locationRadius.radius == 0 && string.IsNullOrEmpty(model.Request.locationRadius.unit))
                {
                    model.Request.locationRadius = null;
                }

                if (!model.Request.yearlyRevenue.maximumValue.HasValue && !model.Request.yearlyRevenue.minimumValue.HasValue)
                {
                    model.Request.yearlyRevenue = null;
                }

                if (model.Request.globalUltimateFamilyTreeMembersCount.maximumValue == 0 && model.Request.globalUltimateFamilyTreeMembersCount.minimumValue == 0)
                {
                    model.Request.globalUltimateFamilyTreeMembersCount = null;
                }

                if (model.Request.numberOfEmployees.informationScope == 0 && model.Request.numberOfEmployees.maximumValue == null && model.Request.numberOfEmployees.minimumValue == null)
                {
                    model.Request.numberOfEmployees = null;
                }
                if (model.Request.registrationNumbers.Count == 0)
                {
                    model.Request.registrationNumbers = null;
                }
                if (model.Request.usSicV4.Count == 0)
                {
                    model.Request.usSicV4 = null;
                }
                DateTime dtRequestedTime           = DateTime.Now;
                DateTime?dtResponseTime            = null;
                bool     IsFetchData               = true;
                List <SearchCandidate> lstsesstion = new List <SearchCandidate>();
                // Checking APIType is there or not
                string APItype = CommonMethod.GetThirdPartyProperty(ThirdPartyCode.DNB_BUILD_A_LIST.ToString(), ThirdPartyProperties.APIType.ToString());
                if (APItype != "")
                {
                    for (int i = 1; i <= (model.NoOfRecored / 20); i++)
                    {
                        if (IsFetchData)
                        {
                            model.Request.pageNumber = i;
                            model.Request.pageSize   = 20;

                            SearchCriteriaResponse objResponse = api.BuildAList(model.Request);
                            if (objResponse.searchCandidates != null)
                            {
                                lstsesstion.AddRange(objResponse.searchCandidates);
                                if ((i * 20) >= objResponse.candidatesMatchedQuantity)
                                {
                                    IsFetchData = false;
                                }
                            }
                            else
                            {
                                if (i == 1)
                                {
                                    response.Success        = false;
                                    response.ResponseString = objResponse.error != null ? objResponse.error.errorMessage : string.Empty;
                                }
                                IsFetchData = false;
                            }
                        }
                    }
                }

                dtResponseTime = DateTime.Now;

                if (lstsesstion.Any())
                {
                    SessionHelper.BuildList_Data = JsonConvert.SerializeObject(lstsesstion);
                    CompanyFacade fac          = new CompanyFacade(this.CurrentClient.ApplicationDBConnectionString, Helper.UserName);
                    var           RequestJson  = new JavaScriptSerializer().Serialize(model);
                    var           ResponseJson = new JavaScriptSerializer().Serialize(lstsesstion);
                    object        obj          = fac.InsertBuildSearch(Helper.oUser.UserId, RequestJson, ResponseJson, dtRequestedTime, dtResponseTime);
                    Session["Id"] = Convert.ToInt64(obj);
                }

                if (lstsesstion.Any())
                {
                    var skip = pageSize * (currentPageIndex - 1);
                    IPagedList <SearchCandidate> pglstpagedMonitorProfile = new StaticPagedList <SearchCandidate>(lstsesstion.Skip(skip).Take(pageSize).ToList(), currentPageIndex, pageSize, lstsesstion.Count);
                    dtResponseTime          = DateTime.Now;
                    response.Success        = true;
                    response.ResponseString = RenderViewAsString.RenderPartialViewToString(this, "~/Views/BuildList/SearchGrid.cshtml", pglstpagedMonitorProfile);
                }
                else
                {
                    if (APItype == "")
                    {
                        response.Success        = false;
                        response.ResponseString = CommonMessagesLang.msgNoDefaultKeyForSearch;
                    }
                }
                return(Json(response));
            }
            catch (Exception ex)
            {
                response.Success        = false;
                response.ResponseString = ex.Message;
                return(Json(response));
            }
        }
Esempio n. 28
0
 public CompanyController(CompanyFacade companyFacade, UserFacade userFacade)
 {
     this.companyFacade = companyFacade;
     this.userFacade    = userFacade;
 }
Esempio n. 29
0
        // GET: Stock
        public async Task <ActionResult> MenuItems()
        {
            List <MenuItemDto> menuItems = await CompanyFacade.GetAllMenuItems(User.Identity.Name);

            return(View("MenuItems", menuItems));
        }
 public async Task <CompanyDto> GetCompany(int id)
 {
     return(await CompanyFacade.GetAsync(id));
 }