protected void ChangeFileRelative_OnClick(object sender, EventArgs e) { TempService tsService = new TempService(this); Button b = (Button)sender; this.txtRelative.Text = tsService.GetContentFromFile(TypeTemp.Relative, b.CommandArgument); }
static void Main(string[] args) { Server server = null; try { server = new Server() { Services = { TempService.BindService(new TempServiceImpl()) }, Ports = { new ServerPort("localhost", Port, ServerCredentials.Insecure) } }; server.Start(); Console.WriteLine("The server is listening on the port: " + Port); Console.ReadKey(); } catch (IOException e) { Console.WriteLine("The server failed to start: " + e.Message); throw; } finally { if (server != null) { server.ShutdownAsync().Wait(); } } }
public async Task RenderUpdate() { NewCompanies = TempService.NewCompanies; QualifiedCompanies = TempService.QualifiedCompanies; NotQualifiedCompanies = TempService.NotQualifiedCompanies; countries = TempService.Countries; SelectedId = TempService.GetSelectedId(); if (SelectedId != 0) { SelectedCompany = TempService.CompanyModels.Where(p => p.Id == SelectedId).FirstOrDefault(); await InvokeAsync(StateHasChanged); contacts = await TempService.GetCompanyContacts(SelectedId); } else { SelectedCompany = null; } if (TempService.CurrentUser != null) { currentUser = TempService.CurrentUser; var logTemp = TempService.logs; if (logTemp != null) { logs = TempService.logs.Where(p => p.UserId == currentUser.Id); } } SelectedCompany = TempService.CompanyModels.Where(p => p.Id == SelectedId).FirstOrDefault(); Linkedins = TempService.Linkedins; }
public async Task SelectCompanyElement(int id) { TempService.SetId(id); SelectedId = id; SelectedCompany = TempService.CompanyModels.Where(p => p.Id == SelectedId).FirstOrDefault(); await AddLog(id); }
public AccountController(UserManager <User> userManager, TempService tempService, SignInManager <User> signInManager, IUserRegistrationService userRegistrationService) { _userManager = userManager; _signInManager = signInManager; _tempService = tempService; _userRegistrationService = userRegistrationService; }
protected void Page_Load(object sender, EventArgs e) { tempService = new TempService(this); if (!IsPostBack) { if (ProductID == -1) { var products = from nw in Data.CV_Products join cat_ in Data.CV_CatProducts on nw.CatID equals cat_.CatID where (nw.CatID == CatID || CatID == -1) && (cat_.PortalID == PortalId) orderby nw.ProductID descending select new ProductInfo { Content = nw.Content, CreateDate = nw.CreatedDate.Value, Id = nw.ProductID, ImageThumUrl = GetWebImgOf(LocationImage.Product, nw.ImageName), Price = ConvertPrice(nw.Price), ShortContent = nw.ShortContent, Title = nw.Title, Url = WriteUrl(TabId.ToString(), "detailproduct", nw.ProductID.ToString(), nw.Title) }; //1 . chuyen truy van thanh list PagedList <ProductInfo> pl = new PagedList <ProductInfo>(products, PageCurr - 1, PageSize); if (pl.Count > 0) { //2 . gan vao repeater rptproducts.DataSource = pl; rptproducts.DataBind(); //3 . chuyen thanh thanh phan trang Pager pg = new Pager(PageSize, PageCurr, pl.TotalItemCount, TabId); //4. tao thanh phan trang pnPaging.Text = pg.RenderHtml(); } mv.SetActiveView(vList); } else { ProductDetail c = (ProductDetail)Page.LoadControl(ControlPath + "/ProductDetail.ascx"); c.ListProduct = this; c.TempService = this.tempService; c.DataBinding(); plhDetail.Controls.Add(c); mv.SetActiveView(vDetail); } } }
protected void Page_Load(object sender, EventArgs e) { tempService = new TempService(this); if (!IsPostBack) { if (ProductID == -1) { var products = from nw in Data.CV_Products join cat_ in Data.CV_CatProducts on nw.CatID equals cat_.CatID where (nw.CatID == CatID || CatID == -1) && (cat_.PortalID == PortalId) orderby nw.ProductID descending select new ProductInfo { Content = nw.Content, CreateDate = nw.CreatedDate.Value, Id = nw.ProductID, ImageThumUrl = GetWebImgOf(LocationImage.Product,nw.ImageName), Price = ConvertPrice(nw.Price), ShortContent = nw.ShortContent, Title = nw.Title, Url = WriteUrl(TabId.ToString(), "detailproduct", nw.ProductID.ToString(), nw.Title) }; //1 . chuyen truy van thanh list PagedList<ProductInfo> pl = new PagedList<ProductInfo>(products, PageCurr - 1, PageSize); if (pl.Count > 0) { //2 . gan vao repeater rptproducts.DataSource = pl; rptproducts.DataBind(); //3 . chuyen thanh thanh phan trang Pager pg = new Pager(PageSize, PageCurr, pl.TotalItemCount, TabId); //4. tao thanh phan trang pnPaging.Text = pg.RenderHtml(); } mv.SetActiveView(vList); } else { ProductDetail c = (ProductDetail)Page.LoadControl(ControlPath + "/ProductDetail.ascx"); c.ListProduct = this; c.TempService = this.tempService; c.DataBinding(); plhDetail.Controls.Add(c); mv.SetActiveView(vDetail); } } }
public async Task FindHunter() { if (SelectedCompany != null && SelectedCompany.Website != null) { List <Contact> FoundContacts = (await HunterIntegrationService.FindDomainContacts(SelectedCompany.Website)).ToList(); MessageForModal = "Найдены " + FoundContacts.Count + " новых контактов"; MessageModalDisplay = "block"; await TempService.UpdateCompanies(); await InvokeAsync(StateHasChanged); } }
protected void Page_Load(object sender, EventArgs e) { tempService = new TempService(this); if (!IsPostBack) { if (NewsID == -1) { var Data = IB.Common.Base.V_Base.Data; var news = from nw in Data.CV_News join cat_ in Data.CV_CatNews on nw.CatNewsID equals cat_.CatID where (nw.CatNewsID == CatID || CatID == -1) && cat_.PortalID == PortalId orderby nw.NewsID descending select new NewsInfo { Content = nw.Content, CreatedDate = nw.CreatedDate.Value, ImageName = nw.ImageName, NewsId = nw.NewsID, ShortContent = nw.ShortContent, Title = nw.Title, Url = WriteUrl(TabId.ToString(), "detailnews", nw.NewsID.ToString(), nw.Title) }; //1 . chuyen truy van thanh list IB.Paging.PagedList <NewsInfo> pl = new IB.Paging.PagedList <NewsInfo>(news, PageCurr - 1, PageSize); //2 . gan vao repeater if (pl.Count > 0) { rptnews.DataSource = pl; rptnews.DataBind(); //3 . chuyen thanh thanh phan trang IB.Paging.Pager pg = new IB.Paging.Pager(PageSize, PageCurr, pl.TotalItemCount, TabId); //4. tao thanh phan trang pnPaging.Text = pg.RenderHtml(); } mv.SetActiveView(vList); } else { NewsDetail c = (NewsDetail)Page.LoadControl(ControlPath + "/NewsDetail.ascx"); c.ListNews = this; c.TempService = this.tempService; c.DataBinding(); plhDetail.Controls.Add(c); mv.SetActiveView(vDetail); } } }
protected void Page_Load(object sender, EventArgs e) { tempService=new TempService(this); if (!IsPostBack) { if (NewsID == -1) { var Data = IB.Common.Base.V_Base.Data; var news = from nw in Data.CV_News join cat_ in Data.CV_CatNews on nw.CatNewsID equals cat_.CatID where (nw.CatNewsID == CatID || CatID == -1) && cat_.PortalID == PortalId orderby nw.NewsID descending select new NewsInfo{ Content = nw.Content, CreatedDate = nw.CreatedDate.Value, ImageName = nw.ImageName, NewsId = nw.NewsID, ShortContent = nw.ShortContent, Title = nw.Title, Url = WriteUrl(TabId.ToString(), "detailnews",nw.NewsID.ToString(),nw.Title) }; //1 . chuyen truy van thanh list IB.Paging.PagedList<NewsInfo> pl = new IB.Paging.PagedList<NewsInfo>(news, PageCurr - 1, PageSize); //2 . gan vao repeater if (pl.Count > 0) { rptnews.DataSource = pl; rptnews.DataBind(); //3 . chuyen thanh thanh phan trang IB.Paging.Pager pg = new IB.Paging.Pager(PageSize, PageCurr, pl.TotalItemCount, TabId); //4. tao thanh phan trang pnPaging.Text = pg.RenderHtml(); } mv.SetActiveView(vList); } else { NewsDetail c = (NewsDetail)Page.LoadControl(ControlPath + "/NewsDetail.ascx"); c.ListNews = this; c.TempService = this.tempService; c.DataBinding(); plhDetail.Controls.Add(c); mv.SetActiveView(vDetail); } } }
/// controls END #endregion #region BASE_METHODS protected override async Task OnInitializedAsync() { NewCompany = new CompanyRegistrationDTO(); AddLemlistStatistic = new AddLemlistStatistic(); checkedContacts = new List <int>(); await TempService.UpdateCompanies(); await RenderUpdate(); authState = await AuthenticationStateProvider.GetAuthenticationStateAsync(); user = authState.User; if (user.Identity.IsAuthenticated) { TempService.CurrentUser = await UserRegistrationService.GetCurrent(user.Identity.Name); } await StartCountdown(); }
public async void SetNotQualify() { if (SelectedId != 0) { await CompanyService.SetNotQualified(SelectedId); var company = await CompanyService.GetCompany(SelectedId); QualifyCompanyModel notQualified = new QualifyCompanyModel { IsQualify = false, CompanyTradingName = company.TradingName }; await AddLog(qualifyCompany : notQualified); } await TempService.UpdateCompanies(); TempService.SetId(0); Pause(); }
/// controls div END public async Task AddCompany() { if (NewCompany != null) { try { Validator.ValidateObject(NewCompany, new ValidationContext(NewCompany)); await CompanyService.CreateCompany(NewCompany); await AddLog(ActionMesage : ActionMessage + ": " + NewCompany.TradingName); await TempService.UpdateCompanies(); await Close(); } catch (Exception ex) { ExceptionLabel = ex.Message; ExceptionLabelDisplay = "block"; } await InvokeAsync(StateHasChanged); } }
public void DataBinding() { var product = (from p in V_Base.Data.CV_Products where p.ProductID == ProductID select new ProductInfo { Content = p.Content, CreateDate = p.CreatedDate.Value, Id = p.ProductID, ImageOrgUrl = GetWebImgOf(LocationImage.Product, p.ImageName), ImageThumUrl = GetWebImageOfThumb(LocationImage.Product, p.ImageName), Price = ConvertPrice(p.Price), ShortContent = p.ShortContent, Title = p.Title, Url = ListProduct.WriteUrl(ListProduct.TabId.ToString(), "detailproduct", p.ProductID.ToString(), p.Title) } ).FirstOrDefault(); if (product != null) { // hien thi chi tiet san pham ProductTokenReplace newsTokenReplace = new ProductTokenReplace(product); string str = newsTokenReplace.ReplaceProductInfo(TempService.GetContentTempFromDB(TypeTemp.Detail)); Literal lt = new Literal(); lt.Text = str; plhDetail.Controls.Add(lt); // hien thi cac anh gioi thieu san pham var imgs = from im in V_Base.Data.CV_ImageProducts where im.ProductID == ProductID select new ImageInfo { ImageOrgUrl = GetWebImgOf(LocationImage.Product, im.FileName), ImageThumUrl = GetWebImageOfThumb(LocationImage.Product, im.FileName) }; rptImgProduct.DataSource = imgs; rptImgProduct.DataBind(); //lay cac san pham lien quan var pronewer = (from pr in V_Base.Data.CV_Products join cat_ in V_Base.Data.CV_CatProducts on pr.CatID equals cat_.CatID where pr.ProductID > ProductID && (cat_.PortalID == PortalId) orderby pr.ProductID ascending select new ProductInfo { Content = pr.Content, CreateDate = pr.CreatedDate.Value, Id = pr.ProductID, ImageOrgUrl = GetWebImgOf(LocationImage.Product, pr.ImageName), ImageThumUrl = GetWebImageOfThumb(LocationImage.Product, pr.ImageName), Price = ConvertPrice(pr.Price), ShortContent = pr.ShortContent, Title = pr.Title, Url = ListProduct.WriteUrl(ListProduct.TabId.ToString(), "detailproduct", pr.ProductID.ToString(), pr.Title) } ).Take(10); var proolder = (from pr in V_Base.Data.CV_Products join cat_ in V_Base.Data.CV_CatProducts on pr.CatID equals cat_.CatID where pr.ProductID < ProductID && (cat_.PortalID == PortalId) orderby pr.ProductID descending select new ProductInfo { Content = pr.Content, CreateDate = pr.CreatedDate.Value, Id = pr.ProductID, ImageOrgUrl = GetWebImgOf(LocationImage.Product, pr.ImageName), ImageThumUrl = GetWebImageOfThumb(LocationImage.Product, pr.ImageName), Price = ConvertPrice(pr.Price), ShortContent = pr.ShortContent, Title = pr.Title, Url = ListProduct.WriteUrl(ListProduct.TabId.ToString(), "detailproduct", pr.ProductID.ToString(), pr.Title) }).Take(10); List <ProductInfo> p = pronewer.ToList(); p.AddRange(proolder.ToList()); rptRelative.DataSource = p; rptRelative.DataBind(); } }
public override void LoadSettings() { base.LoadSettings(); int _tabfw = TabId; if (Settings["TabForward"] != null) { if (!int.TryParse(Settings["TabForward"].ToString(), out _tabfw)) { _tabfw = TabId; } } int _size = new V_Base().PageSize; if (Settings["PageSize"] != null) { if (!int.TryParse(Settings["PageSize"].ToString(), out _size) || _size < 1) { _size = new V_Base().PageSize; } } int _cat = -1; if (Settings["CatProduct"] != null) { if (!int.TryParse(Settings["CatProduct"].ToString(), out _cat)) { _cat = -1; } } if (Settings["NoPrice"] != null) { txtNoPrice.Text = Settings["NoPrice"].ToString(); } else { txtNoPrice.Text = "Call"; } //string _listType = Settings["filenamelist"] == null ? "default" : Settings["filenamelist"].ToString(); TempService tsService = new TempService(this); //List List<string> lt = tsService.GetFileLists(TypeTemp.List, "gif"); List<ItemTemp> itemTemps = new List<ItemTemp>(); for (int i = 0; i < lt.Count; i++) { itemTemps.Add(new ItemTemp { NameImage = lt[i], NameTemp = lt[i].Replace(".gif", ".htm") }); } rptList.DataSource = itemTemps; rptList.DataBind(); txtList.Text = tsService.GetContentTempFromDB(TypeTemp.List); //detail lt = tsService.GetFileLists(TypeTemp.Detail, "gif"); itemTemps.Clear(); for (int i = 0; i < lt.Count; i++) { itemTemps.Add(new ItemTemp { NameImage = lt[i], NameTemp = lt[i].Replace(".gif", ".htm") }); } rptDetail.DataSource = itemTemps; rptDetail.DataBind(); txtDetail.Text = tsService.GetContentTempFromDB(TypeTemp.Detail); //Relative lt = tsService.GetFileLists(TypeTemp.Relative, "gif"); itemTemps.Clear(); for (int i = 0; i < lt.Count; i++) { itemTemps.Add(new ItemTemp { NameImage = lt[i], NameTemp = lt[i].Replace(".gif", ".htm") }); } rptRelative.DataSource = itemTemps; rptRelative.DataBind(); txtRelative.Text = tsService.GetContentTempFromDB(TypeTemp.Relative); //tao cat LoadCat(_cat); this.txtSize.Text = _size.ToString(); LoadTab(_tabfw); }
protected void SaveRelativeTemp_OnClick(object sender, EventArgs e) { TempService tsService = new TempService(this); tsService.SaveContentFileTempToDB(TypeTemp.Relative, this.txtRelative.Text); }
protected void SaveListTemp_OnClick(object sender, EventArgs e) { TempService tsService = new TempService(this); tsService.SaveContentFileTempToDB(TypeTemp.List, this.txtList.Text); }
protected void SaveDetailTemp_OnClick(object sender, EventArgs e) { TempService tsService = new TempService(this); tsService.SaveContentFileTempToDB(TypeTemp.Detail, this.txtDetail.Text); }
public override void LoadSettings() { base.LoadSettings(); int _tabfw = TabId; if (Settings["TabForward"] != null) { if (!int.TryParse(Settings["TabForward"].ToString(), out _tabfw)) { _tabfw = TabId; } } int _size = new V_Base().PageSize; if (Settings["PageSize"] != null) { if (!int.TryParse(Settings["PageSize"].ToString(), out _size) || _size < 1) { _size = new V_Base().PageSize; } } int _cat = -1; if (Settings["CatProduct"] != null) { if (!int.TryParse(Settings["CatProduct"].ToString(), out _cat)) { _cat = -1; } } if (Settings["NoPrice"] != null) { txtNoPrice.Text = Settings["NoPrice"].ToString(); } else { txtNoPrice.Text = "Call"; } //string _listType = Settings["filenamelist"] == null ? "default" : Settings["filenamelist"].ToString(); TempService tsService = new TempService(this); //List List <string> lt = tsService.GetFileLists(TypeTemp.List, "gif"); List <ItemTemp> itemTemps = new List <ItemTemp>(); for (int i = 0; i < lt.Count; i++) { itemTemps.Add(new ItemTemp { NameImage = lt[i], NameTemp = lt[i].Replace(".gif", ".htm") }); } rptList.DataSource = itemTemps; rptList.DataBind(); txtList.Text = tsService.GetContentTempFromDB(TypeTemp.List); //detail lt = tsService.GetFileLists(TypeTemp.Detail, "gif"); itemTemps.Clear(); for (int i = 0; i < lt.Count; i++) { itemTemps.Add(new ItemTemp { NameImage = lt[i], NameTemp = lt[i].Replace(".gif", ".htm") }); } rptDetail.DataSource = itemTemps; rptDetail.DataBind(); txtDetail.Text = tsService.GetContentTempFromDB(TypeTemp.Detail); //Relative lt = tsService.GetFileLists(TypeTemp.Relative, "gif"); itemTemps.Clear(); for (int i = 0; i < lt.Count; i++) { itemTemps.Add(new ItemTemp { NameImage = lt[i], NameTemp = lt[i].Replace(".gif", ".htm") }); } rptRelative.DataSource = itemTemps; rptRelative.DataBind(); txtRelative.Text = tsService.GetContentTempFromDB(TypeTemp.Relative); //tao cat LoadCat(_cat); this.txtSize.Text = _size.ToString(); LoadTab(_tabfw); }
public async Task AddLog(int CompanyId = 0, string WebSite = null, string LinkedinOfTradingName = null, QualifyCompanyModel qualifyCompany = null, int count = 0, string LinkedinOfUser = null, string ActionMesage = null) { if (WebSite != null) { LogDTO logDTO = new LogDTO { Action = "Перешел на сайт " + WebSite, UserId = TempService.CurrentUser.Id }; await LogService.AddLog(logDTO); //Thread.Sleep(3000); } else if (WebSite == null && CompanyId != 0) { LogDTO logDTO = new LogDTO { Action = "Просмотрел компанию " + TempService.AllCompanies.Where(p => p.Id == SelectedId).FirstOrDefault().TradingName, UserId = TempService.CurrentUser.Id }; await LogService.AddLog(logDTO); } else if (LinkedinOfTradingName != null) { LogDTO logDTO = new LogDTO { Action = "Просмотрел аккаунт LinkedIn компании " + LinkedinOfTradingName, UserId = TempService.CurrentUser.Id }; await LogService.AddLog(logDTO); } else if (qualifyCompany != null) { LogDTO logDTO; if (qualifyCompany.IsQualify) { logDTO = new LogDTO { Action = "Изменил статус компании " + qualifyCompany.CompanyTradingName + " на Квалифицированный", UserId = TempService.CurrentUser.Id }; } else { logDTO = new LogDTO { Action = "Изменил статус компании " + qualifyCompany.CompanyTradingName + " на НЕ квалифицированный", UserId = TempService.CurrentUser.Id }; } await LogService.AddLog(logDTO); } else if (count != 0) { LogDTO logDTO = new LogDTO { Action = "Добавил " + count + " контактов в lemmlist", UserId = TempService.CurrentUser.Id }; await LogService.AddLog(logDTO); } else if (LinkedinOfUser != null) { LogDTO logDTO = new LogDTO { Action = "Просмотрел аккаунт LinkedIn пользователя " + LinkedinOfUser, UserId = TempService.CurrentUser.Id }; await LogService.AddLog(logDTO); } else if (ActionMesage != null) { LogDTO logDTO = new LogDTO { Action = ActionMesage, UserId = TempService.CurrentUser.Id }; await LogService.AddLog(logDTO); } await TempService.UpdateLogs(); await RenderUpdate(); }
public HomeController(TempService tempService, IUserRegistrationService userRegistrationService) { tempServ = tempService; userRegistrationServ = userRegistrationService; }
public TempController(TempService tempService) { _tempService = tempService; }
public string HelloWorld() { TempService ts = new TempService(); return(ts.GetDelbertTest("Hello World")); }
public IActionResult TempChecker(int temperature) { ViewBag.TempResult = TempService.CheckTemperature(temperature); return(View()); }
public MainForm() { InitializeComponent(); this.service = new TempService(cbSerialPorts, this.sender, this.e, tbRegisterCount); }