public string enterNewCompanyInRDb(string company, string owner, string type, string location, string mail, string pass) { CompaniesR c = new CompaniesR() { CompanyName = company, Owner = owner, Type = type, Location = location, Email = mail, Password = pass }; var ret = raven.CreateCompany(c); //mongo Companies cm = new Companies() { CompanyName = company, Owner = owner, Type = type, Location = location, Email = mail, Password = pass }; var retm = mongor.CreateCompany(cm); DBCheck dbc = new DBCheck() { Collection = "company", DbName = "raven", Mail = mail, Password = pass, MongoId = retm.Id.ToString(), RavenId = c.Id.ToString() }; var dbcRet = raven.setDB(dbc); Changes ch = new Changes() { Actor1 = ret.Id, Actor1Name = ret.CompanyName, Actor1Collection = "CompaniesR", Type = " is new company that has joined our network!", Time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") }; var change = raven.addFriendChange(ch); if (ret != null && change != null && retm != null && dbcRet != null) { HttpContext.Current.Session.Add("companyR", ret); HttpContext.Current.Session.Add("database", dbc.DbName); return(succ); } return(fail); }
public string enterNewCompanyInDb(string company, string owner, string type, string location, string mail, string pass) { Companies c = new Companies(); c.CompanyName = company; c.Owner = owner; c.Type = type; c.Location = location; c.Email = mail; c.Password = pass; var ret = mongoDbase.CreateCompany(c); if (ret != null) { HttpContext.Current.Session.Add("company", ret); return(succ); } return(fail); }