コード例 #1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int itemGet = 0;

        if (Request.QueryString["itemNo"] != null)
        {
            itemGet = int.Parse(Request.QueryString["itemNo"]);
        }
        else
        {
            Response.Redirect("default.aspx");
        }

        tblInformationPicCollection infPicTbl = new tblInformationPicCollection();

        infPicTbl.ReadList(Criteria.NewCriteria(tblInformationPic.Columns.infId, CriteriaOperators.Equal, Convert.ToInt32(itemGet)));

        tblInformationDetailCollection infTbl = new tblInformationDetailCollection();

        infTbl.ReadList(Criteria.NewCriteria(tblInformationDetail.Columns.id, CriteriaOperators.Equal, Convert.ToInt32(itemGet)));

        newsDetHtml.InnerHtml = "<h4>" + infTbl[0].infDetailInsertDate + "</h4>" +
                                "<h2>" + infTbl[0].infDetailTitle + "</h2>" +
                                "<p>" + infTbl[0].infDetailDescription + "</p>";

        if (infTbl[0].frontFile.Length > 0)
        {
            newsImgHtml.InnerHtml = "<img src='images/info/" + infTbl[0].frontFile + "' alt='bondelectric " + infTbl[0].frontFile + "' class='img-responsive img-rounded'>";
        }
        else
        {
            newsImgHtml.InnerHtml = "<img src='images/info/default.jpg' alt='Bond Electric' class='img-responsive img-rounded'>";
        }
    }
コード例 #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            #region News
            tblNewsDetailsCollection newsTbl = new tblNewsDetailsCollection();
            newsTbl.ReadList();

            string newsStr = string.Empty;

            for (int i = newsTbl.Count - 1; i >= 0; i--)
            {
                newsStr += "<div class='span3 module_cont module_iconboxes'><div class='shortcode_iconbox'>" +
                           "<img src='" + newsTbl[i].topPageFileAddr + "' alt='' />" +
                           "<h4>" + newsTbl[i].newsDetTitle + "</h4>" +
                           "<p style='width: 100%;'>" + newsTbl[i].newsDetGist + "</p>" +
                           "</div></div>";
            }

            newsHTML.InnerHtml = newsStr;
            #endregion


            //if save fact
            string code_s;
            if ((Request.QueryString["code"] != null))
            {
                code_s            = Request.QueryString["code"];
                fact_no.InnerText = "شماره سفارش شما :" + code_s;
            }

            #region information
            tblInformationDetailCollection infoTbl = new tblInformationDetailCollection();
            infoTbl.ReadList();

            string infoStr = string.Empty;

            for (int i = infoTbl.Count - 1; i >= 0; i--)
            {
                infoStr += "<li><div class='item'>" +
                           "<div class='img_block'><img class='img_footer' style='width:260px;' src='" + infoTbl[i].frontFile + "' alt='عسل شهد فروش' />" +
                           "</div><div class='carousel_title'>" +
                           "<h4 class='featured_ico_video'>" + infoTbl[i].infDetailTitle + "</h4>" +
                           "</div><div class='carousel_desc'>" +
                           "<div class='exc common_font' style='font-size:10pt;line-height: 20px;font-weight: bold;overflow: hidden;'>" + infoTbl[i].infDetailsGist + "</div>" +
                           "</div></div></li>";
            }

            infoHtml.InnerHtml = infoStr;
            #endregion
        }
        catch (Exception)
        {
            newsHTML.InnerText = "روال انجام کار با شکست مواجه شد.";
        }
    }
コード例 #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        string infStr  = "<div class='row'>";
        int    counter = 0;
        tblInformationPicCollection    infPicTbl = new tblInformationPicCollection();
        tblInformationDetailCollection infTbl    = new tblInformationDetailCollection();

        infTbl.ReadList();

        for (int i = 0; i < infTbl.Count; i++)
        {
            if (counter == 4)
            {
                infStr  = "</div><hr class='hr3'><div class='row'>";
                counter = 0;
            }
            infPicTbl.ReadList(Criteria.NewCriteria(tblInformationPic.Columns.infId, CriteriaOperators.Equal, infTbl[i].id));
            infStr += "<div class='col-md-4 col-sm-6 col-xs-12'><div class='icon-wrapper-portfolio wow fadeIn' data-wow-duration='1s' data-wow-delay='0.2s'>";
            if (infTbl[i].frontFile.Length > 0)
            {
                infStr += "<img class='portfolio-img' src='images/info/" + infTbl[i].frontFile + "' alt='bondelectric " + infTbl[i].frontFile + "' />";
            }

            infStr += "<h3>" + infTbl[i].infDetailTitle + "</h3>" +
                      "<p class='portfolio-para'>" + infTbl[i].infDetailDescription + "<small class='readmore'><a href='information-details.aspx?itemNo=" + infTbl[i].id + "'>Read more</a></small></p></div></div>";
            counter++;
        }

        infStr += "</div>";

        infHtml.InnerHtml = infStr;

        #region header top picture
        tblLogsCollection picTopTbl = new tblLogsCollection();
        picTopTbl.ReadList();
        if (picTopTbl.Count > 0)
        {
            headerPicHtml.Attributes["style"] = "background: url(" + picTopTbl[0].logDetail + ")no-repeat;background-size: cover;background-position: center;";
        }
        #endregion
    }
コード例 #4
0
    protected void btnDel_Click(object sender, EventArgs e)
    {
        int itemGet = 0;

        if (Request.QueryString["item"] != null)
        {
            itemGet = int.Parse(Request.QueryString["item"]);
        }
        else
        {
            Response.Redirect("information-details.aspx");
        }

        tblInformationDetailCollection detTbl = new tblInformationDetailCollection();

        detTbl.ReadList(Criteria.NewCriteria(tblInformationDetail.Columns.id, CriteriaOperators.Equal, itemGet));

        detTbl[0].Delete();

        Response.Redirect("information-add.aspx");
    }
コード例 #5
0
    protected void Page_Load(object sender, EventArgs e)
    {
        int itemGet = 0;

        if (Request.QueryString["item"] != null)
        {
            itemGet = int.Parse(Request.QueryString["item"]);
        }
        else
        {
            Response.Redirect("information-add.aspx");
        }

        //fill data

        tblInformationDetailCollection DetailsTbl = new tblInformationDetailCollection();

        DetailsTbl.ReadList(Criteria.NewCriteria(tblInformationDetail.Columns.id, CriteriaOperators.Equal, itemGet));

        if (DetailsTbl.Count > 0)
        {
            setPicHtml.InnerHtml = "<img src='../images/inf/" + DetailsTbl[0].frontFile + "' class='img-responsive' draggable='false'>";
        }

        string             writerStr      = string.Empty;
        tblStaffCollection NewsCreatorTbl = new tblStaffCollection();

        NewsCreatorTbl.ReadList(Criteria.NewCriteria(tblStaff.Columns.id, CriteriaOperators.Equal, DetailsTbl[0].infWriter));

        if (NewsCreatorTbl.Count > 0)
        {
            writerStr = NewsCreatorTbl[0].StaffName + " " + NewsCreatorTbl[0].StaffFamily;
        }

        string addDataString = string.Empty;

        addDataString += "<h3>" + DetailsTbl[0].infDetailTitle + "</h3><br>" +
                         "<span class='code'>Writer: <a>" + writerStr + "</a></span>" +
                         "<p>Information Details: " + DetailsTbl[0].infDetailDescription + "</p>" +
                         "<div class='price'>" +
                         "<span class='text'></span>";

        addDataString += "<span class='price-new'></span>";


        addDataString += "<span class='price-tax'><label class='checkbox'></label></span><br>";


        addDataString += "<span class='points'><small>Insert Date: " + DetailsTbl[0].infDetailInsertDate + "</small></span><br>";

        addDataString += "</div>";

        addDetailHtml.InnerHtml = addDataString;

        //fill data in change part
        //Groups
        tblInformationGroupCollection GroupTbl = new tblInformationGroupCollection();

        GroupTbl.ReadList();


        //Select old items
        if (!IsPostBack)
        {
            if (DetailsTbl[0].infDetailTitle.Length > 0)
            {
                txtTitle.Text = DetailsTbl[0].infDetailTitle;
            }

            if (DetailsTbl[0].infDetailDescription.Length > 0)
            {
                txtDetail.Text = DetailsTbl[0].infDetailDescription;
            }

            for (int i = 0; i < GroupTbl.Count; i++)
            {
                ddlNewsGroup.Items.Add(new ListItem(GroupTbl[i].infGroupTitle, GroupTbl[i].id.ToString()));
            }
            ddlNewsGroup.SelectedValue = DetailsTbl[0].idInfoGroup.ToString();
        }
    }
コード例 #6
0
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        int itemGet = 0; string fileNameUpdate = string.Empty;

        if (Request.QueryString["item"] != null)
        {
            itemGet = int.Parse(Request.QueryString["item"]);
        }
        else
        {
            Response.Redirect("information-add.aspx");
        }

        tblInformationDetailCollection detTbl = new tblInformationDetailCollection();

        detTbl.ReadList(Criteria.NewCriteria(tblInformationDetail.Columns.id, CriteriaOperators.Equal, itemGet));

        //tblNewsPicCollection newsPicTbl = new tblNewsPicCollection();
        //newsPicTbl.ReadList(Criteria.NewCriteria(tblNewsPic.Columns.newsId, CriteriaOperators.Equal, itemGet));

        string             writerStr = string.Empty;
        tblStaffCollection infWriterTbl = new tblStaffCollection();

        infWriterTbl.ReadList(Criteria.NewCriteria(tblStaff.Columns.id, CriteriaOperators.Equal, detTbl[0].infWriter));

        if (infWriterTbl.Count > 0)
        {
            writerStr = infWriterTbl[0].StaffName + " " + infWriterTbl[0].StaffFamily;
        }
        else
        {
            writerStr = "Unknown";
        }



        //if (newsPicTbl.Count > 0)
        //    fileNameUpdate = newsPicTbl[0].picName;


        if (txtTitle.Text.Trim().Length > 0 && txtDetail.Text.Trim().Length > 0)
        {
            detTbl[0].infDetailTitle       = txtTitle.Text;
            detTbl[0].infDetailDescription = txtDetail.Text;

            detTbl[0].idInfoGroup = Int32.Parse(ddlNewsGroup.SelectedValue);



            // file upload start
            string filename = string.Empty;
            if (IsPostBack)
            {
                Boolean fileOK = false;
                String  path   = Server.MapPath("~/images/inf/");
                if (fuGallery.HasFile)
                {
                    String   fileExtension     = System.IO.Path.GetExtension(fuGallery.FileName).ToLower();
                    String[] allowedExtensions = { ".jpg", ".png", ".bmp", ".gif" };
                    for (int i = 0; i < allowedExtensions.Length; i++)
                    {
                        if (fileExtension == allowedExtensions[i])
                        {
                            fileOK = true;
                        }
                    }
                }

                if (fileOK)
                {
                    try
                    {
                        fuGallery.PostedFile.SaveAs(path + fuGallery.FileName);
                        filename = fuGallery.FileName;
                    }
                    catch (Exception ex)
                    {
                        lblError.Text = "A problem accurred while uplouding picture";
                    }
                }
                else
                {
                    lblError.Text = "Not valid picture file";
                }
            }

            // file upload end
            if (filename.Trim().Length > 0)
            {
                detTbl[0].frontFile = filename;
            }
            else
            {
                detTbl[0].frontFile = fileNameUpdate;
            }

            detTbl[0].Update();
        }

        Response.Redirect("information-details.aspx?item=" + itemGet);
    }
コード例 #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        //Add ddl
        tblInformationGroupCollection GroupTbl = new tblInformationGroupCollection();

        GroupTbl.ReadList();

        //tblNewsPicArtCollection newsPicTbl = new tblNewsPicArtCollection();

        if (!IsPostBack)
        {
            for (int i = 0; i < GroupTbl.Count; i++)
            {
                ddlNewsGroup.Items.Add(new ListItem(GroupTbl[i].infGroupTitle, GroupTbl[i].id.ToString()));
            }
        }
        //place data
        string infoString = string.Empty;
        tblInformationDetailCollection detTbl = new tblInformationDetailCollection();

        detTbl.ReadList();

        string addRow     = "<div class='row'>";
        int    countSteps = 0;

        for (int i = 0; i < detTbl.Count; i++)
        {
            GroupTbl.ReadList(Criteria.NewCriteria(tblInformationGroup.Columns.id, CriteriaOperators.Equal, detTbl[i].idInfoGroup));
            //newsPicTbl.ReadList(Criteria.NewCriteria(tblNewsPicArt.Columns.newsId, CriteriaOperators.Equal, newsTbl[i].id));

            if (countSteps == 0)
            {
                infoString += addRow;
            }

            infoString += "<div class='col-md-6 graph-2'>" +
                          "<h3 class='inner-tittle'>Information " + (i + 1) + " </h3>" +
                          "<div class='panel panel-primary two'>" +
                          "<div class='panel-heading'>" + detTbl[i].infDetailTitle + "(" + GroupTbl[0].infGroupTitle + ")" + "</div><div class='panel-body ont two'>";
            if (detTbl[i].frontFileType == 0)
            {
                infoString += "<div><img src='../images/inf/" + detTbl[i].frontFile + "' alt='" + detTbl[i].frontFile + "' style='width: 100%;' /></div>";
            }
            else if (detTbl[i].frontFileType == 1)
            {
                infoString += "<div><video id='video1'><source src='../movie/inf/" + detTbl[i].frontFile + "' type='video/mp4'>Your browser does not support HTML5 video.</video></div>";
            }
            else
            {
                infoString += "<div>" + detTbl[i].frontFile + "</div>";
            }

            infoString += "<p>" + detTbl[i].infDetailDescription + "</p></div>" +
                          "<div class='panel-footer'><a href='information-details.aspx?item=" + detTbl[i].id + "'>edit</a></div></div></div>";
            countSteps++;
            if (countSteps == 2)
            {
                countSteps  = 0;
                infoString += "</div>";
            }
        }

        infHtml.InnerHtml = infoString;
    }