Inheritance: System.Web.UI.MasterPage
Ejemplo n.º 1
0
        public bool Edit_web_info(site e, int id)
        {
            SqlDbDataAccess da = new SqlDbDataAccess();

            SqlCommand cmd = da.GetCommand("update dbo.site set url=@url,description=@description where dbo.site.id=@id;");

            SqlParameter p = new SqlParameter("@url", SqlDbType.VarChar, 50);

            p.Value = e.url;

            SqlParameter p1 = new SqlParameter("@description", SqlDbType.VarChar, 500);

            p1.Value = e.description;

            SqlParameter p2 = new SqlParameter("@id", SqlDbType.Int);

            p2.Value = id;

            cmd.Parameters.Add(p);
            cmd.Parameters.Add(p1);
            cmd.Parameters.Add(p2);;

            cmd.Connection.Open();

            cmd.ExecuteNonQuery();

            cmd.Connection.Close();

            return(true);
        }
Ejemplo n.º 2
0
        /// <summary> </summary>
        public void get_index()
        {
            CancelLayout();
            CancelView();

            HttpRequest      httpRequest = HttpContext.Current.Request;
            site             site        = siteService.getCurrentSite();
            FileSystemDriver driver      = new FileSystemDriver();

            driver.AddRoot(new Root(new DirectoryInfo(HttpContext.Current.Server.MapPath("~/" + file_info.relative_site_uploads_path().Trim('/'))), "http://" + httpRequest.Url.Authority + "/" + file_info.relative_site_cache_path().Trim('/') + "/uploads/")
            {
                IsReadOnly = false, Alias = site.name
            });
            //driver.AddRoot(new Root(new DirectoryInfo(@"C:\Program Files"), "http://" + httpRequest.Url.Authority + "/") { IsReadOnly = true });
            var connector = new Connector(driver);


            var jsonResult = connector.Process(new HttpRequestWrapper(httpRequest));

            var data = jsonResult.Data;

            string json = new JavaScriptSerializer().Serialize(data);

            RenderText(json);
        }
Ejemplo n.º 3
0
        private void metroButton2_Click(object sender, EventArgs e)
        {
            try
            {
                if (metroTextBox1.Text == "" || metroGrid1.Rows[0].Cells["Tag Name"].Value.ToString() == "" || metroGrid1.Rows[0].Cells["Tag Value"].Value.ToString() == "")
                {
                    CheckEmpty();
                }
                else
                {
                    DialogResult f = MetroMessageBox.Show(this, "Are you sure to save?", "WSH notify", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
                    if (f == DialogResult.OK)
                    {
                        access_data d = new access_data();
                        site        s = new site();

                        s.url         = metroTextBox1.Text;
                        s.description = textBox1.Text;

                        int site_id = d.InsertNweUrlData(s);
                        int i       = metroGrid1.Rows.Count;

                        SqlDbDataAccess dr = new SqlDbDataAccess();
                        for (int j = 0; j < i; j++)
                        {
                            using (SqlCommand cmd = dr.GetCommand("insert into dbo.site_details (site_id,tag_name,tag_value) values(@site_id,@tag_name,@tag_value);"))
                            {
                                SqlParameter p = new SqlParameter("@site_id", SqlDbType.Int);
                                p.Value = site_id;

                                SqlParameter p1 = new SqlParameter("@tag_name", SqlDbType.VarChar, 200);
                                p1.Value = metroGrid1.Rows[j].Cells["Tag Name"].Value.ToString();

                                SqlParameter p2 = new SqlParameter("@tag_value", SqlDbType.VarChar, 500);
                                p2.Value = metroGrid1.Rows[j].Cells["Tag Value"].Value.ToString();

                                cmd.Parameters.Add(p);
                                cmd.Parameters.Add(p1);
                                cmd.Parameters.Add(p2);

                                cmd.Connection.Open();
                                cmd.ExecuteNonQuery();
                                cmd.Connection.Close();
                            }
                        }

                        MetroMessageBox.Show(this, "Data successfully Saved", "", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        metroTextBox1.Text    = "";
                        metroTextBox2.Text    = "";
                        textBox1.Text         = "";
                        textBox2.Text         = "";
                        metroGrid1.DataSource = null;
                    }
                }
            }
            catch (System.ArgumentOutOfRangeException)
            {
                CheckEmpty();
            }
        }
Ejemplo n.º 4
0
        /*
         * having issues with the lazy load when setting  Controllers.BaseController.localsite so ..
         * skipping at the moment.
         *
         * public static site setCurrentSite() {
         *  site current = new site();
         *  if(is_localhost()){
         *      current = getDefaultSite();
         *  }else{
         *      current = getSiteFromURL();
         *  }
         *  Controllers.BaseController.localsite = current;
         *  return current;
         * }*/
        /// <summary> </summary>
        public static site getCurrentSite()
        {
            site current = new site();

            if (is_localhost() || !Controllers.installController.is_installed())
            {
                current = getDefaultSite();
            }
            else
            {
                current = getSiteFromURL();
            }
            if (current == null || current.local_path == null || String.IsNullOrWhiteSpace(current.local_path))
            {
                Uri    uri        = HttpContext.Current.Request.Url;
                String getBaseURL = uri.Scheme + Uri.SchemeDelimiter + uri.Host;
                current = new site()
                {
                    local_path = file_info.root_path(),
                    base_url   = getBaseURL
                };
            }
            log.Info(current.local_path);
            return(current);
        }
Ejemplo n.º 5
0
        public IHttpActionResult Putsite(int id, site site)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            if (id != site.Id)
            {
                return BadRequest();
            }

            db.Entry(site).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!siteExists(id))
                {
                    return NotFound();
                }
                else
                {
                    throw;
                }
            }

            return StatusCode(HttpStatusCode.NoContent);
        }
Ejemplo n.º 6
0
        public ResultHelper AddSite(SiteDto siteDto)
        {
            try
            {
                if (IsThere(siteDto))
                {
                    return(new ResultHelper(false, siteDto.SiteID, ResultHelper.IsThereItem));
                }

                site item = new site();
                item.SiteID      = siteDto.SiteID;
                item.Name        = siteDto.Name;
                item.Description = siteDto.Description;
                item.Gps         = siteDto.Gps;

                using (UnitOfWork unitofWork = new UnitOfWork())
                {
                    unitofWork.GetRepository <site>().Insert(item);
                    unitofWork.saveChanges();

                    return(new ResultHelper(true, item.SiteID, ResultHelper.SuccessMessage));
                }
            }
            catch (Exception ex)
            {
                return(new ResultHelper(false, siteDto.SiteID, ResultHelper.UnSuccessMessage));
            }
        }
Ejemplo n.º 7
0
        public SiteDto GetSite(int siteID)
        {
            try
            {
                using (UnitOfWork unitofWork = new UnitOfWork())
                {
                    site    item    = unitofWork.GetRepository <site>().GetById(x => x.SiteID == siteID);
                    SiteDto siteDto = new SiteDto();
                    siteDto.SiteID      = item.SiteID;
                    siteDto.Description = item.Description;
                    siteDto.Gps         = item.Gps;
                    siteDto.Name        = item.Name;

                    campussite campussite = unitofWork.GetRepository <campussite>().GetById(x => x.SiteID == item.SiteID);
                    siteDto.CampusSiteDto              = new CampusSiteDto();
                    siteDto.CampusSiteDto.CampusID     = campussite.CampusID;
                    siteDto.CampusSiteDto.CampusSiteID = campussite.CampusSiteID;
                    siteDto.CampusSiteDto.SiteID       = campussite.SiteID;
                    siteDto.CampusID     = campussite.CampusID;
                    siteDto.CampusSiteID = campussite.CampusSiteID;
                    return(siteDto);
                }
            }
            catch (Exception ex)
            {
                return(null);
            }
        }
Ejemplo n.º 8
0
        /// <summary> </summary>
        public void configuration(int siteid)
        {
            PropertyBag["frontend_themelist"] = themeService.list_themes();

            PropertyBag["posting_types"] = ActiveRecordBase <posting_type> .FindAll();

            PropertyBag["posting_type_actions"] = ActiveRecordBase <posting_type_action> .FindAll();

            site site_obj = new site();

            if (siteid > 0)
            {
                site_obj = ActiveRecordBase <site> .Find(siteid);
            }
            else
            {
                List <AbstractCriterion> filtering = new List <AbstractCriterion>();
                filtering.Add(Expression.Eq("is_default", true));
                site_obj = ActiveRecordBase <site> .FindFirst(filtering.ToArray());
            }
            PropertyBag["site"] = site_obj;

            foreach (options option in site_obj.options)
            {
                if (!String.IsNullOrWhiteSpace(option.option_key))
                {
                    PropertyBag[option.option_key.ToUpper()] = option.value;//ie: post.get_meta("title");
                }
            }

            RenderView("../admin/configuration");
        }
Ejemplo n.º 9
0
 public void Execute(GrabConfiguration grabConfiguration)
 {
     try
     {
         ReportStatus("Updating siteini.user", "");
         Log.Debug(string.Format("Updating siteini.user for {0}", grabConfiguration.Name));
         var siteIniUserDir    = new DirectoryInfo(Path.Combine(grabConfiguration.Path.FullName, Settings.Default.SiteIniUser));
         var listUserCountries = new ListCountries(siteIniUserDir);
         var userCountries     = listUserCountries.Execute();
         var sitePackDir       = new DirectoryInfo(Path.Combine(Locations.WorkingDirectory.FullName, Settings.Default.SiteIniPack));
         var listAllCountries  = new ListCountries(sitePackDir);
         var allCountries      = listAllCountries.Execute();
         var selectedSites     = userCountries.SelectMany(x => x.Sites).ToList();
         var allSites          = allCountries.SelectMany(x => x.Sites).ToList();
         for (int i = 0; i < selectedSites.Count; i++)
         {
             ReportStatus("Updating siteini.user", string.Format("{0} / {1}", i + 1, selectedSites.Count));
             site item        = selectedSites[i];
             var  siteXmlPack = allSites.SingleOrDefault(x => x.Path.Name == item.Path.Name);
             if (siteXmlPack != null)
             {
                 File.Copy(siteXmlPack.Path.FullName, item.Path.FullName, true);
                 if (siteXmlPack.IniPath.Exists)
                 {
                     File.Copy(siteXmlPack.IniPath.FullName, item.IniPath.FullName, true);
                 }
             }
         }
     }
     catch (Exception ex)
     {
         Log.Error(string.Format("Search for configurations failed.{0}{1}", Environment.NewLine, ex.Message), ex);
         throw;
     }
 }
Ejemplo n.º 10
0
        public HttpResponseMessage insertSite(DTOsite request)
        {
            var user = KOCAuthorizeAttribute.getCurrentUser();

            using (var db = new CRMEntities())
            {
                var errormessage = new DTOResponseError();
                var dsite        = new site
                {
                    sitename       = request.sitename,
                    sitedistrict   = request.sitedistrict,
                    siteaddress    = request.siteaddress,
                    description    = request.description,
                    creationdate   = DateTime.Now,
                    lastupdated    = DateTime.Now,
                    deleted        = false,
                    updatedby      = user.userId,
                    siteregioncode = request.siteregioncode,
                    region         = request.region
                };
                db.site.Add(dsite);
                db.SaveChanges();
                errormessage.errorMessage = "İşlem Başarılı";
                errormessage.errorCode    = 1;

                return(Request.CreateResponse(HttpStatusCode.OK, errormessage, "application/json"));
            }
        }
Ejemplo n.º 11
0
        /// <summary> </summary>
        public static String site_path(string site_alias)
        {
            site site = ActiveRecordBase <site> .FindOne(new List <AbstractCriterion>() {
                Expression.Eq("alias", site_alias)
            }.ToArray());

            return(site.local_path);
        }
Ejemplo n.º 12
0
        public ActionResult DeleteConfirmed(int id)
        {
            site site = db.site.Find(id);

            db.site.Remove(site);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 13
0
        /// <summary> </summary>
        public static site getSiteFromURL()
        {
            site site = ActiveRecordBase <site> .FindOne(new List <AbstractCriterion>() {
                Expression.Eq("base_url", httpService.getCurrentBaseURL())
            }.ToArray());

            return(site);
        }
Ejemplo n.º 14
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            site site = await db.sites.FindAsync(id);

            db.sites.Remove(site);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
Ejemplo n.º 15
0
        Result iTool.Execute(Job job)
        {
            Result result = new Result(job.Id);

            config siteConfig = new config();

            siteConfig.ReadConfig(job.DownloadAttachment());

            List <site> sites = new List <site>();

            foreach (subsite subSite in siteConfig.subSites)
            {
                Console.WriteLine(subSite.source);
                using (SPWeb web = new SPSite(subSite.source).OpenWeb())
                {
                    site site = new site(subSite.source, subSite.target);
                    structure.sites.Add(site);
                    SPWebCollection subsites = siteConfig.allWebs ? web.Site.AllWebs : web.Webs;

                    foreach (SPWeb spWeb in subsites)
                    {
                        string oldUrl          = spWeb.Url;
                        string siteRelativeUrl = oldUrl.Replace(subSite.source, string.Empty);

                        siteRelativeUrl = siteRelativeUrl.StartsWith("/") ? siteRelativeUrl : (string.IsNullOrEmpty(siteRelativeUrl) ? siteRelativeUrl : siteRelativeUrl.Substring(1));
                        string newUrl = subSite.target + siteRelativeUrl;

                        site newSite = new site(oldUrl, newUrl);
                        structure.sites.Add(newSite);
                        RecursiveWebCheck(spWeb, subSite.source, subSite.target);

                        spWeb.Dispose();
                    }
                }
            }

            XmlSerializer serializer = new XmlSerializer(typeof(sitestructure));
            string        tmpFile    = Scheduler.Instance.CreateTmpFile();

            using (TextWriter stream = new StreamWriter(tmpFile))
            {
                using (XmlWriter writer = XmlWriter.Create(stream, new XmlWriterSettings {
                    Indent = true
                }))
                {
                    writer.WriteStartDocument();
                    serializer.Serialize(writer, structure);
                    writer.WriteEndDocument();
                    writer.Flush();
                }
            }

            result.AddFile(tmpFile);

            return(result);
        }
Ejemplo n.º 16
0
        /// <summary>
        /// Handles the ItemDataBound event of the dlCatalog control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="T:System.Web.UI.WebControls.DataListItemEventArgs"/> instance containing the event data.</param>
        void dlCatalog_ItemDataBound(object sender, DataListItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                Product product = e.Item.DataItem as Product;
                if (product == null)
                {
                    return;
                }
                HyperLink imageLink  = e.Item.FindControl("hlImageLink") as HyperLink;
                site      masterPage = this.Page.Master as site;
                if (imageLink != null && !string.IsNullOrEmpty(product.DefaultImagePath))
                {
                    imageLink.ImageUrl = ImageProcess.GetProductThumbnailUrl(product.DefaultImagePath);
                }

                Label retailPrice = e.Item.FindControl("lblRetailPrice") as Label;
                if (masterPage != null)
                {
                    if (masterPage.SiteSettings.DisplayRetailPrice && product.RetailPrice != 0)
                    {
                        if (retailPrice != null)
                        {
                            retailPrice.Text = StoreUtility.GetFormattedAmount(product.RetailPrice, true);
                        }
                    }
                    else
                    {
                        retailPrice.Visible = false;
                    }
                }
                Label ourPrice = e.Item.FindControl("lblOurPrice") as Label;
                if (ourPrice != null)
                {
                    ourPrice.Text = StoreUtility.GetFormattedAmount(product.DisplayPrice, true);
                }
                if (masterPage.SiteSettings.AddTaxToPrice && TaxService.GetDefaultTaxProvider().IsProductLevelTaxProvider)
                {
                    Label taxApplied = e.Item.FindControl("lblTaxApplied") as Label;
                    if (taxApplied != null)
                    {
                        taxApplied.Visible = true;
                    }
                }
                AjaxControlToolkit.Rating ajaxRating = e.Item.FindControl("ajaxRating") as AjaxControlToolkit.Rating;
                if (ajaxRating != null && masterPage.SiteSettings.DisplayRatings)
                {
                    ajaxRating.GroupingText  = LocalizationUtility.GetText("lblAverageRating");
                    ajaxRating.CurrentRating = product.Rating;
                }
                else
                {
                    ajaxRating.Visible = false;
                }
            }
        }
Ejemplo n.º 17
0
 private bool CheckSiteIniExists(DirectoryInfo countryDirectory, site site)
 {
     if (!site.IniPath.Exists)
     {
         Log.Error(string.Format("Missing ini file for site {0}", site.site1));
         throw new FileNotFoundException(string.Format("Site ini {0} is missing.", site.IniPath.FullName));
         return(false);
     }
     return(true);
 }
Ejemplo n.º 18
0
        public ActionResult SupprimmerSite(FormCollection collection)
        {
            string id = collection["NumSiteSupp"];

            site siteEditer = db.site.Find(id);

            db.site.Remove(siteEditer);
            db.SaveChanges();
            return(RedirectToAction("Listsite"));
        }
Ejemplo n.º 19
0
        //editer site
        public ActionResult EditerSite(string id)
        {
            if (id == null)
            {
                return(RedirectToAction("Listsite"));
            }
            site siteEditer = db.site.Find(id);

            return(View(siteEditer));
        }
Ejemplo n.º 20
0
 public ActionResult Edit([Bind(Include = "Id,Nom,Lieu,Tarif")] site site)
 {
     if (ModelState.IsValid)
     {
         db.Entry(site).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(site));
 }
Ejemplo n.º 21
0
        public IHttpActionResult AddData(site siteobj)
        {
            AuthDetails authdet = LoginUserDetails();

            siteobj.UpdatedBy = authdet.UserId;
            siteobj.CreatedBy = authdet.UserId;
            var result = service.Add(siteobj);

            return(Ok(result));
        }
Ejemplo n.º 22
0
        public string returnMainSite(string sub_site)
        {
            site result = mst_site.Where(x => x.sub_site == sub_site).FirstOrDefault();

            if (result == null)
            {
                return(sub_site);
            }
            return(result.main_site);
        }
Ejemplo n.º 23
0
        public IHttpActionResult Getsite(int id)
        {
            site site = db.sites.Find(id);
            if (site == null)
            {
                return NotFound();
            }

            return Ok(site);
        }
Ejemplo n.º 24
0
        public static DisplayViewModel Parse(site results)
        {
            if (results == null) return null;

            var viewModel = new DisplayViewModel();
            viewModel.DataObtainedAt = DateTime.Now;
            var test = results.observed.OrderByDescending(x => x.valid.Value).First();

            viewModel.WaterLevel = test.primary.Value;
            viewModel.WaterLevelUnit = test.primary.units;
            viewModel.WaterLevelWhen = TimeZoneInfo.ConvertTime(test.valid.Value, TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time"));
            viewModel.WaterLevelWhenUtc = test.valid.Value;

            if (viewModel.WaterLevel >= 5 && viewModel.WaterLevel < 9)
            {
                viewModel.ActionLevel = WaterLevelAction.LifeJacket;
            }
            else if (viewModel.WaterLevel >= 9)
            {
                viewModel.ActionLevel = WaterLevelAction.Permit;
            }

            viewModel.Future = results.forecast.datum.ToDictionary(x => x.valid.Value, x => x.primary.Value);
            viewModel.Observed = results.observed.OrderBy(x => x.valid.Value).Where(x => x.valid.Value > DateTime.UtcNow.AddHours(-24)).ToDictionary(x => TimeZoneInfo.ConvertTime(x.valid.Value, TimeZoneInfo.FindSystemTimeZoneById("Eastern Standard Time")), x => x.primary.Value);

            if (results.forecast.datum.Any(x => results.sigstages.record.Value <= x.primary.Value))
                viewModel.FloodingCategoryForecast = FloodingCategoryForecast.Record;

            else if (results.forecast.datum.Any(x => results.sigstages.major.Value <= x.primary.Value))
                viewModel.FloodingCategoryForecast = FloodingCategoryForecast.Major;

            else if (results.forecast.datum.Any(x => results.sigstages.moderate.Value <= x.primary.Value))
                viewModel.FloodingCategoryForecast = FloodingCategoryForecast.Moderate;

            else if (results.forecast.datum.Any(x => results.sigstages.flood.Value <= x.primary.Value))
                viewModel.FloodingCategoryForecast = FloodingCategoryForecast.Flood;

            else if (results.forecast.datum.Any(x => results.sigstages.bankfull.Value <= x.primary.Value))
                viewModel.FloodingCategoryForecast = FloodingCategoryForecast.Bankful;

            else if (results.forecast.datum.Any(x => results.sigstages.action.Value <= x.primary.Value))
                viewModel.FloodingCategoryForecast = FloodingCategoryForecast.Action;

            //var p = Fit.Line(Array.ConvertAll(Enumerable.Range(0, results.observed.Count()).ToArray(), x => (double)x), results.observed.Select(x => (double)x.primary.Value).ToArray());

            var f = new Statistics().CalculateLinearRegression(results.observed.OrderBy(x => x.valid.Value).Where(x => x.valid.Value > DateTime.UtcNow.AddHours(-15)).Select(x => x.primary.Value).ToArray());
            if (f.Slope > .25)
                viewModel.Trend = WaterTrend.Rising;
            else if (f.Slope < -.25)
                viewModel.Trend = WaterTrend.Falling;
            else
                viewModel.Trend = WaterTrend.Steady;

            return viewModel;
        }
Ejemplo n.º 25
0
        public ActionResult Create([Bind(Include = "Id,Nom,Lieu,Tarif")] site site)
        {
            if (ModelState.IsValid)
            {
                db.site.Add(site);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(site));
        }
Ejemplo n.º 26
0
        //effacer site

        public ActionResult SupprimmerSite(string id)
        {
            if (id == null)
            {
                return(RedirectToAction("Listsite"));
            }
            site siteEditer = db.site.Find(id);

            ViewBag.Message = id;
            return(View(siteEditer));
        }
Ejemplo n.º 27
0
        public ActionResult EditerSite(site siteEditer)
        {
            if (ModelState.IsValid)
            {
                db.Entry(siteEditer).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Listsite"));
            }

            return(View(siteEditer));
        }
Ejemplo n.º 28
0
        /// <summary> </summary>
        public static String Css(String files, String mode, Boolean debug)
        {
            String name = helperService.CalculateMD5Hash(files);
            String path = file_info.virtual_site_cache_path().Trim('/') + "/scripts/css/";

            path = file_info.normalize_path(path);
            String dir = Path.GetDirectoryName(path);

            try {
                if (!Directory.Exists(dir))
                {
                    DirectoryInfo di = Directory.CreateDirectory(dir);
                }
            } catch { }//let it pass

            String FilePath = file_info.normalize_path(path + name + ".css");

            if (!file_info.dir_exists(path))
            {
                System.IO.Directory.CreateDirectory(path);
            }
            site      site  = siteService.getCurrentSite();
            String    theme = themeService.current_theme_alias();
            CSSBundle css   = new CSSBundle();

            foreach (string fl in files.Split(','))
            {
                String filepath = themeService.virtual_theme_skin_path(site, theme, mode, "css").Trim('/') + "/" + fl.Trim('/'); // this is terrible..
                if (!file_info.file_exists(filepath))
                {
                    filepath = themeService.virtual_theme_skin_path(site, "base", mode, "css").Trim('/') + "/" + fl.Trim('/');
                }
                if (file_info.file_exists(filepath))
                {
                    css.Add(filepath);
                }
            }
            String output = "";

            debug = true;
            if (debug)
            {
                output = css.ForceRelease().ForceDebug().Render(FilePath);
            }
            else
            {
                try{
                    output = css.ForceRelease().Render(FilePath);
                }catch {
                    return(css.ForceRelease().ForceDebug().Render(FilePath) + "<!-- there is something wrong with your css and can't be parsed -->");
                }
            }
            return(output);
        }
Ejemplo n.º 29
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            var userId = User.Identity.GetUserId();

            site site = await db.Sites.FindAsync(id);

            db.Sites.Remove(site);
            await db.SaveChangesAsync();

            return(RedirectToAction("Edit", "Account", new { id = userId }));
        }
Ejemplo n.º 30
0
        public async Task <ActionResult> Edit([Bind(Include = "id,url")] site site)
        {
            if (ModelState.IsValid)
            {
                db.Entry(site).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(site));
        }
Ejemplo n.º 31
0
        public async Task <ActionResult> Edit([Bind(Include = "id,name,phone,address,city,province,postal_code")] site site)
        {
            if (ModelState.IsValid)
            {
                db.Entry(site).State = EntityState.Modified;
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(site));
        }
Ejemplo n.º 32
0
        public JsonResult AddFavorite(site.Classes.UI.Module module)
        {
            JsonResult jResult = new JsonResult();

            return jResult;
        }