public async Task <dynamic> Post_Login(FJC_LoginRequest _fjc_login) { var get_url1 = await CommanUrl.Login().PostJsonAsync(_fjc_login).ReceiveString(); dynamic _obj = JsonConvert.DeserializeObject <ExpandoObject>(get_url1, new ExpandoObjectConverter()); token = _obj.data.Token; return(_obj); }
//////////////////////////////////////////////////////company ////////////////////////////////////////////////////////////////// public static async Task <dynamic> Post_Login1(FJC_LoginRequest _fjc_login) { string default_link = "http://bigshareonline.com:6001"; var _url1 = default_link.AppendPathSegment("api").AppendPathSegment("Login");//commonurl.login var get_url1 = await _url1.PostJsonAsync(_fjc_login).ReceiveString(); return(JsonConvert.DeserializeObject <ExpandoObject>(get_url1, new ExpandoObjectConverter())); //var opt_check = _return_obj.data.EmailID; //string token = _return_obj.data.Token; //Console.WriteLine(opt_check); //Console.WriteLine(token); }
public async Task <DataTable> LoginDataUser(FJC_LoginRequest fJC_Login) { Dictionary <string, object> dictLogin = new Dictionary <string, object>(); dictLogin.Add("@DPIIDCLID", fJC_Login.UserID); dictLogin.Add("@Password", fJC_Login.encrypt_Password); dictLogin.Add("@IP_Address", fJC_Login.system_ip); DataSet ds = new DataSet(); ds = await AppDBCalls.GetDataSet("Evote_LoginSession_Details", dictLogin); return(ds.Tables[0]); }
public async Task <IActionResult> LoginUser(FJC_LoginRequest fJC_Login) { try { await ManageRecaptcha.ValidateUser(fJC_Login.captcha); var result = await _loginService.LoginDataUser(fJC_Login); BSC_LoginResponse loginResponse = new BSC_LoginResponse() { Error = result.Rows[0]["Error"].ToString(), Audience = result.Rows[0]["Audience"].ToString(), EmailID = result.Rows[0]["EmailID"].ToString(), Name = result.Rows[0]["Name"].ToString(), Token = result.Rows[0]["Token"].ToString() }; if (loginResponse.Error.Trim() == string.Empty) { loginResponse.Token = Token_Handling.Generate_token(loginResponse); return(Ok(new { message = "User logged in successfully", data = loginResponse })); } else { switch (loginResponse.Error) { case "Multiple login requests": throw new CustomException.MultipleRequests(); case "Invalid User ID OR Password": throw new CustomException.InvalidPassword(); case "Invalid User ID": throw new CustomException.InvalidUserID(); default: throw new CustomException.InvalidAttempt(); } } } catch (Exception ex) { return((new HandleCatches()).ManageExceptions(ex)); } }