示例#1
0
        public Results AddWebsite(WebsiteModel model)
        {
            try
            {
                //Id increaments
                model.Id = _websiteRepo.GetWebsites().ToList().Count + 1;
                var result = _websiteRepo.AddWebsite(model);

                if (result == 1)
                {
                    return(new Results()
                    {
                        Message = "Successfully Created A Website",
                        ResultDate = DateTime.Now.Date,
                        GlobalKey = Guid.NewGuid().ToString().Substring(3, 10).ToUpper()
                    });
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
            return(null);
        }