Example #1
0
    protected void btnSend_Click(object sender, EventArgs e)
    {
        pnlMessage.Visible = true;

        try
        {
            if (!RadCaptcha1.IsValid)
            {
                msgBox.Text            = "کد امنیتی اشتباه است";
                msgBox.MessageTextMode = AKP.Web.Controls.Common.MessageMode.Error;
                return;
            }

            SitesDataContext dc = new SitesDataContext();

            string Title       = txtTitle.Text;
            string Description = txtDescription.Text;
            string SenderEmail = txtEmail.Text;
            string SenderName  = txtSenderName.Text;
            string CatID       = hfCatID.Value;
            string Url         = txtUrl.Text.Replace("http://", "");

            if (CatID == "")
            {
                lblMessage.Text = "لطفا گروه سایت را انتخاب کنید";
                return;
            }

            AllSites PreSite = dc.AllSites.SingleOrDefault(p => p.Url.Equals(Url));
            if (PreSite != null)
            {
                lblMessage.Text = "این سایت قبلا وارد شده است";
                return;
            }
            AllSites NewSite = new AllSites();
            NewSite.SiteName    = Title;
            NewSite.Description = Description;
            NewSite.Cat         = Convert.ToInt32(CatID);
            NewSite.ID          = GenNewID();
            NewSite.Active      = 0;
            NewSite.VisitCount  = 0;
            NewSite.Rating      = 0;
            NewSite.ViewerCount = 0;
            NewSite.SumAll      = 0;
            NewSite.SenderName  = SenderName;
            NewSite.SenderEmail = SenderEmail;
            NewSite.Url         = Url;
            dc.AllSites.InsertOnSubmit(NewSite);
            dc.SubmitChanges();

            lblMessage.Text = "درخواست شما برای افزودن سایت جدید ثبت شد. پس از تایید مدیر سایت ، لینک درخواستی شما ظاهر میشود.";
            btnSend.Visible = false;
        }
        catch
        {
            lblMessage.Text = "خطا در ثبت سایت";
        }
    }
Example #2
0
    protected void HandleRepeater(object source, RepeaterCommandEventArgs e)
    {
        LinkButton       btnEditLink = (LinkButton)e.Item.FindControl("btnEditLink");
        string           SiteID      = Convert.ToString(btnEditLink.Attributes["SiteID"]);
        SitesDataContext dc          = new SitesDataContext();
        AllSites         CurSite     = dc.AllSites.SingleOrDefault(p => p.ID.Equals(SiteID));

        if (CurSite != null)
        {
            txtTitle.Text        = CurSite.SiteName;
            txtDescription.Text  = CurSite.Description;
            pnlEditLink.CssClass = "EditLinkArea";
            //string JSCommand = "pageScroll();";
            //ScriptManager.RegisterStartupScript(this.UpdatePanel1, typeof(string), "AdjustScript", JSCommand, true);
            hfSiteID.Value = SiteID;
        }
    }
Example #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        return;

        string SiteID = Request["SiteID"];

        if (SiteID != null)
        {
            SitesDataContext dc      = new SitesDataContext();
            AllSites         CurSite = dc.AllSites.SingleOrDefault(p => p.ID.Equals(SiteID));
            if (CurSite != null)
            {
                CurSite.VisitCount++;
                dc.SubmitChanges();
                Response.Redirect("http://" + CurSite.Url);
            }
        }
    }
        private void UpdateFilter()
        {
            _filter.DuplicateSelectMode  = _duplicateSelectMode;
            _filter.DuplicateJudgeMode   = _judgeMode;
            _filter.ifmaskDuplicateChips = ifmaskDuplicateChips;
            _filter.ifMaskOrEnableIds    = MaskOrEnableIds;
            _filter.ifMaskOrEnableCords  = MaskOrEnableCords;

            _filter.maskSites    = AllSites.Except(EnabledSites).ToList();
            _filter.maskHardBins = AllHBins.Except(EnabledHBins).ToList();
            _filter.maskSoftBins = AllSBins.Except(EnabledSBins).ToList();
            _filter.maskChips    = ParseMaskEnableIds();
            _filter.maskCords    = ParseMaskEnableCords();
            _dataAcquire.UpdateFilter(_filterId, _filter);

            CountPerPage     = DefaultPerPageCount;
            TotalCount       = _dataAcquire.GetFilteredChipSummary(_filterId).TotalCount;
            TotalPages       = TotalCount / CountPerPage + 1;
            CurrentPageIndex = 1;
            RaisePropertyChanged("TotalPages");
            RaisePropertyChanged("TotalCount");

            UpdateDataToStartPage();
        }