public async Task <bool> CrawlerExcute() { Console.WriteLine("get full socials info"); InfoPeople infoPeople = new InfoPeople(); return(await infoPeople.CrawlFull(_context)); }
public void Run() { var infoPeople = new InfoPeople(); var optionsBuilder = new DbContextOptionsBuilder <UserDbContext>(); optionsBuilder.UseSqlServer(Configuration.GetConnectionString("AmazonVirtualMachineConnection")); var dbContext = new UserDbContext(optionsBuilder.Options); var res = infoPeople.CrawlFull(dbContext).Result; }
public async Task <IActionResult> GetDataFromFacebook([FromBody] PeopleSocials p) { var isSignedIn = _signInManager.IsSignedIn(User); var message = new MessageModel { IsSignedIn = isSignedIn }; InfoPeople info = new InfoPeople(); if (isSignedIn) { try { var item = await info.UpdateUser(_context, p); if (item != null) { return(Ok(new { like = item.Like, view = item.View, share = item.Share, follow = item.Follow })); } message.Succeeded = false; message.Message = "Data or Url is invalid"; return(BadRequest(message)); } catch (Exception ex) { message.Message += ex.Message; return(BadRequest(message)); } } else { message.Message += "you need login to excute this function"; return(BadRequest(message)); } }
public void UpdateInfoPeople(InfoPeople IP) { FRD.UpdateInfoPeople(IP); }
public void UpdateInfoPeople(InfoPeople IP) { SqlCommand cmd = new SqlCommand(); cmd.CommandText = "[HR].[SP_UpdateInfoPeo]"; cmd.Connection = HR_con; cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("ID", IP.ID); cmd.Parameters.AddWithValue("@name", IP.Name); cmd.Parameters.AddWithValue("@family", IP.Family); cmd.Parameters.AddWithValue("@name_ep", IP.Fathers_Name); cmd.Parameters.AddWithValue("@idd", IP.Idd); cmd.Parameters.AddWithValue("@idd_meli", IP.Idd_Meli); cmd.Parameters.AddWithValue("@sex", IP.Sex); cmd.Parameters.AddWithValue("@sal_tav", IP.Sal_Tav); cmd.Parameters.AddWithValue("@mahal_tav", IP.Mahal_Tav); cmd.Parameters.AddWithValue("@mahal_sodor", IP.Mahal_Sodor); cmd.Parameters.AddWithValue("@id_madrak", IP.Madrak); cmd.Parameters.AddWithValue("@idresh", IP.Field); cmd.Parameters.AddWithValue("@sal_madrak", IP.Sal_Madrak); cmd.Parameters.AddWithValue("@university", IP.Uni); cmd.Parameters.AddWithValue("@martabe", IP.Martabe); cmd.Parameters.AddWithValue("@payeh", IP.Payeh); cmd.Parameters.AddWithValue("@sanavat_tadris", IP.Sanavat_tadris); cmd.Parameters.AddWithValue("@type_estekhdam", IP.type_estekhdam); cmd.Parameters.AddWithValue("@nahveh_hamk", IP.base_nahveh_hamkari); cmd.Parameters.AddWithValue("@uni_khedmat", IP.Uni_Khedmat); cmd.Parameters.AddWithValue("@date_hokm", IP.Date_Hokm); cmd.Parameters.AddWithValue("@date_runhokm", IP.Date_RunHokm); cmd.Parameters.AddWithValue("@number_hokm", IP.Number_Hokm); cmd.Parameters.AddWithValue("@marital_status", IP.Marital_Status); cmd.Parameters.AddWithValue("@status_nezam", IP.Status_Nezam); cmd.Parameters.AddWithValue("@num_bime", IP.Number_Bime); cmd.Parameters.AddWithValue("@siba", IP.Siba); cmd.Parameters.AddWithValue("@tel_home", IP.Tel_Home); cmd.Parameters.AddWithValue("@tel_kar", IP.Tel_Kar); cmd.Parameters.AddWithValue("@mobile", IP.Mobile); cmd.Parameters.AddWithValue("@add_home", IP.Add_Home); cmd.Parameters.AddWithValue("@add_kar", IP.Add_Kar); cmd.Parameters.AddWithValue("@code_posti", IP.Code_Posti); cmd.Parameters.AddWithValue("@code_ostan_home", IP.Code_Ostan_Home); cmd.Parameters.AddWithValue("@code_city_home", IP.Code_City_Home); cmd.Parameters.AddWithValue("@code_city_work", IP.Code_City_Work); cmd.Parameters.AddWithValue("@code_ostan_work", IP.Code_Ostan_Work); cmd.Parameters.AddWithValue("@add_email", IP.Email); cmd.Parameters.AddWithValue("@country", IP.Country); cmd.Parameters.AddWithValue("@Status", IP.status); cmd.Parameters.AddWithValue("@IsRetired", IP.ISRetired); cmd.Parameters.AddWithValue("@BoundHour", IP.BoundHour); cmd.Parameters.AddWithValue("@textMessage", IP.TextMessage); cmd.Parameters.AddWithValue("@Cooperation", IP.Cooperation); cmd.Parameters.AddWithValue("@bimeType", IP.Bime_Type); cmd.Parameters.AddWithValue("@MablaghHokm", IP.MablaghHokm); cmd.Parameters.AddWithValue("@uni_khedmatType", IP.TypeUniKhedmat); cmd.Parameters.AddWithValue("@MadrakUniType", IP.TypeUniMadrak); try { HR_con.Open(); cmd.ExecuteNonQuery(); HR_con.Close(); } catch { throw; } }