public Company AddCompany(Company comp, User user) { var paramu = new { Title = comp.Title, Description = comp.Description, Country = comp.Country, Province = comp.Province, SubProvince = comp.SubProvince, Address = comp.Address, Phone = comp.Phone, Fax = comp.Fax, WebsiteURL = comp.WebsiteURL, Mail = comp.Mail }; using (IDbConnection cnn = new SqlConnection(Helper.GetConnectionString())) { string sql = "dbo.SP_CompanySET"; Company us = cnn.QuerySingle <Company>(sql, paramu, commandType: CommandType.StoredProcedure); UserDE usde = new UserDE(); User sonucuser = usde.AddUser(user, null, us); if (sonucuser != null) { return(us); } else { return(null); } } }
public Candidate AddCandidate(Candidate cand, User user) { var paramu = new { Name = cand.Name, Phone = cand.Phone, Country = cand.Country, Province = cand.Province, SubProvince = cand.SubProvince, DateOfBirth = cand.DateOfBirth, PhotoPath = cand.PhotoPath }; using (IDbConnection cnn = new SqlConnection(Helper.GetConnectionString())) { string sql = "dbo.SP_CandidateSET"; Candidate us = cnn.QuerySingle <Candidate>(sql, paramu, commandType: CommandType.StoredProcedure); UserDE usde = new UserDE(); User sonucuser = usde.AddUser(user, us, null); if (sonucuser != null) { return(us); } else { return(null); } } }