public GeneralResponse CheckDetails(string password) { GeneralResponse gr = new GeneralResponse(); gr.IsSuccess = false; if (password == "truby") { Common.GetCollections gc = new GetCollections(); gr = gc.GetDetails(password); } else { gr.Message = "Password is incorrect!!!"; } return gr; }
public GeneralResponse GetDetails(string password) { var gr = new GeneralResponse(); gr.IsSuccess = false; try { var mongoConnectionString = ConfigurationManager.AppSettings["MONGOLAB_URI"].ToString(); var login = ConfigurationManager.AppSettings["login"].ToString(); var passWord = ConfigurationManager.AppSettings["password"].ToString(); gr.Message = string.Format("MONGOLAB_URI: {0}{1}login: {2}{1}", mongoConnectionString, Environment.NewLine, login); gr.IsSuccess = true; } catch (Exception ex) { gr.Message = ex.Message; gr.IsSuccess = false; } return gr; }