protected void Page_Load(object sender, EventArgs e) { tblCompanyCollection coDetails = new tblCompanyCollection(); coDetails.ReadList(); if (!IsPostBack) { if (coDetails.Count > 0) { txtCoName.Text = coDetails[0].CoName; txtCoOwner.Text = coDetails[0].CoOwner; txtCoOwnerWords.Text = coDetails[0].CoOwnerWord; txtLat.Text = coDetails[0].CoLocA; txtLong.Text = coDetails[0].CoLocB; txtAddr.Text = coDetails[0].CoAddr; txtPhone.Text = coDetails[0].Tel; txtFax.Text = coDetails[0].Phone; txtInstagram.Text = coDetails[0].Instagram; txtTwitter.Text = coDetails[0].Twitter; txtLinkedin.Text = coDetails[0].Linkedin; txtFabook.Text = coDetails[0].Facebook; txtYoutube.Text = coDetails[0].youtube; txtEmail.Text = coDetails[0].Email; txtWebsite.Text = coDetails[0].website; txtDetails.Text = coDetails[0].CoDetail; } } }
protected void Page_Load(object sender, EventArgs e) { #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 #region company details tblCompanyCollection coDetTbl = new tblCompanyCollection(); coDetTbl.ReadList(); ownerWordHtml.InnerHtml = coDetTbl[0].CoOwnerWord; coDetHtml.InnerHtml = coDetTbl[0].CoDetail; #endregion string portfolioStr = string.Empty; int counter = 0; tblPortfolioCompanyCollection companyPortfolioTbl = new tblPortfolioCompanyCollection(); companyPortfolioTbl.ReadList(); tblCompanyHonorsCollection companyHonorTbl = new tblCompanyHonorsCollection(); companyHonorTbl.ReadList(); portfolioStr += "<div class='row'>"; for (int i = 0; i < companyPortfolioTbl.Count; i++) { if (counter == 4) { portfolioStr += "</div><div class='row'>"; counter = 0; portfolioStr += "<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'>" + "<img class='portfolio-img' src='images/portfolio/" + companyPortfolioTbl[i].picName + "' alt='" + companyPortfolioTbl[i].picName + "' /><h3>" + companyPortfolioTbl[i].title + "</h3>" + "<p class='portfolio-para'>" + companyPortfolioTbl[i].details + "<small class='readmore'><a href='#'>Read more</a></small></p></div></div>"; } counter++; } portfolioStr += "</div>"; portfolioHtml.InnerHtml = portfolioStr; }
protected void ASPxGridView1_RowUpdating(object sender, DevExpress.Web.Data.ASPxDataUpdatingEventArgs e) { tblCompanyCollection lists = new tblCompanyCollection(); lists.ReadList(Cruder.Core.Criteria.NewCriteria(tblService.Columns.id, Cruder.Core.CriteriaOperators.Equal, e.Keys["id"])); lists[0].manager = e.NewValues["manager"].ToString(); lists[0].name_co = e.NewValues["name_co"].ToString(); lists[0].tel_co = e.NewValues["tel_co"].ToString(); lists[0].addr = e.NewValues["addr"].ToString(); lists.UpdateList(true); e.Cancel = true; ASPxGridView1.CancelEdit(); }
protected void Page_Load(object sender, EventArgs e) { try { tblCompanyCollection companyTbl = new tblCompanyCollection(); companyTbl.ReadList(); //aboutCoHtml.InnerHtml = "<h4 class='headInModule'>مرکز پخش عسل حکیم باشی</h4>"; //aboutCoHtml.InnerHtml += companyTbl[0].aboutPage; } catch (Exception) { } }
protected void Page_Load(object sender, EventArgs e) { string socialStr = string.Empty; string googleMapStr = ""; string coDetailsStr = ""; string coOwnerWord = ""; tblCompanyCollection coTbl = new tblCompanyCollection(); coTbl.ReadList(); if (coTbl.Count > 0) { #region social links if (coTbl[0].Facebook.Trim().Length > 0) { socialStr += "<a href='" + coTbl[0].Facebook + "' class='facebook'><i class='fa fa-facebook'></i></a>"; } if (coTbl[0].Twitter.Trim().Length > 0) { socialStr += "<a href='" + coTbl[0].Twitter + "' class='twitter'><i class='fa fa-twitter'></i></a>"; } if (coTbl[0].youtube.Trim().Length > 0) { socialStr += "<a href='" + coTbl[0].youtube + "' class='google'><i class='fa fa-youtube'></i></a>"; } #endregion #region google map googleMapStr = coTbl[0].CoLocA; #endregion #region company details coDetailsStr = "<h1 class='article-title'>" + coTbl[0].CoName + "</h1>"; coDetailsStr += coTbl[0].CoDetail; coOwnerWord = coTbl[0].CoOwnerWord; #endregion } socialLinksHtml.InnerHtml = socialStr; googleMapHtml.InnerHtml = googleMapStr; aboutCoHtml.InnerHtml = coDetailsStr; aboutCoHtml.InnerHtml += "<h2>سخن صاحب امتیاز</h2>"; aboutCoHtml.InnerHtml += coOwnerWord; }
protected void Page_Load(object sender, EventArgs e) { try { tblCompanyCollection companyTbl = new tblCompanyCollection(); companyTbl.ReadList(); string coDetStr = string.Empty; if (companyTbl.Count > 0) { aboutHtml.InnerText = companyTbl[0].CoDetail; if (companyTbl[0].CoAddr.Length > 0) { coDetStr += "<li><p><span>آدرس:</span>" + companyTbl[0].CoAddr + "</p></li>"; } if (companyTbl[0].Tel.Length > 0) { coDetStr += "<li><p><span>تلفن:</span>" + companyTbl[0].Tel + "</p></li>"; } if (companyTbl[0].Phone.Length > 0) { coDetStr += "<li><p><span>فکس:</span>" + companyTbl[0].Phone + "</p></li>"; } if (companyTbl[0].Email.Length > 0) { coDetStr += "<li><p><span>ایمیل:</span>" + companyTbl[0].Email + "</p></li>"; } if (companyTbl[0].Instagram.Length > 0) { coDetStr += "<li><p><span>Instagram:</span>" + companyTbl[0].Instagram + "</p></li>"; } if (companyTbl[0].Telegram.Length > 0) { coDetStr += "<li><p><span>Telegram:</span>" + companyTbl[0].Telegram + "</p></li>"; } } contactDetHtml.InnerHtml = coDetStr; } catch (Exception) { } }
protected void Page_Load(object sender, EventArgs e) { #region social links string socialStr = string.Empty; tblCompanyCollection coDetailsTbl = new tblCompanyCollection(); coDetailsTbl.ReadList(); if (coDetailsTbl[0].Facebook.Length > 0) { socialStr += "<a href='" + coDetailsTbl[0].Facebook + "' class='facebook'><i class='fa fa-facebook'></i></a>"; } if (coDetailsTbl[0].Twitter.Length > 0) { socialStr += "<a href='" + coDetailsTbl[0].Twitter + "' class='twitter'><i class='fa fa-twitter'></i></a>"; } if (coDetailsTbl[0].Telegram.Length > 0) { socialStr += "<a href='" + coDetailsTbl[0].Telegram + "' class='google'><i class='fa fa-google'></i></a>"; } if (coDetailsTbl[0].Linkedin.Length > 0) { socialStr += "<a href='" + coDetailsTbl[0].Linkedin + "' class='linkedin'><i class='fa fa-linkedin'></i></a>"; } if (coDetailsTbl[0].youtube.Length > 0) { socialStr += "<a href='" + coDetailsTbl[0].youtube + "' class='youtube'><i class='fa fa-youtube'></i></a> "; } if (coDetailsTbl[0].Instagram.Length > 0) { socialStr += "<a href='" + coDetailsTbl[0].Instagram + "' class='instagram'><i class='fa fa-instagram'></i></a> "; } socialsHtml.InnerHtml = socialStr; #endregion }
protected void Page_Load(object sender, EventArgs e) { tblCompanyCollection coDetTbl = new tblCompanyCollection(); coDetTbl.ReadList(); if (coDetTbl.Count > 0) { if (coDetTbl[0].CoAddr.Trim().Length > 0) { coDetHtml.InnerHtml = "<li><i class='add'></i>" + coDetTbl[0].CoAddr + "</li>"; } if (coDetTbl[0].Tel.Trim().Length > 0) { coDetHtml.InnerHtml += "<li><i class='phone'></i>" + coDetTbl[0].Tel + "</li>"; } if (coDetTbl[0].Email.Trim().Length > 0) { coDetHtml.InnerHtml += "<li><a href='mailto:[email protected]'><i class='mail'> </i>" + coDetTbl[0].Email + "</a></li>"; } } }
protected void Page_Load(object sender, EventArgs e) { string companyDetStr = string.Empty; tblCompanyCollection companyTbl = new tblCompanyCollection(); companyTbl.ReadList(); #region contact details if (companyTbl[0].Tel.Length > 0) { companyDetStr += "<small>Phone: " + companyTbl[0].Tel + "</small>"; } if (companyTbl[0].Phone.Length > 0) { companyDetStr += "<small>Fax: " + companyTbl[0].Phone + "</small>"; } if (companyTbl[0].Email.Length > 0) { companyDetStr += "<p><a href='mail:" + companyTbl[0].Email + "'>" + companyTbl[0].Email + "</a></p>"; } if (companyTbl[0].website.Length > 0) { companyDetStr += "<p><a href='" + companyTbl[0].website + "'>" + companyTbl[0].website + "</a></p>"; } contactDetHtml.InnerHtml = ""; #endregion #region contact address contactAddrHtml.InnerHtml = "<small>" + companyTbl[0].CoAddr + "</small>"; #endregion #region social links companyDetStr = ""; if (companyTbl[0].Facebook.Length > 0) { companyDetStr += "<small><a href='" + companyTbl[0].Facebook + "'><i class='font-awsome-icon fa fa-facebook-official' aria-hidden='true' style='font-size:17px;color:#3b5999;display: inline-block;'></i>Facebook</a></small>"; } if (companyTbl[0].Twitter.Length > 0) { companyDetStr += "<small><a href='" + companyTbl[0].Twitter + "'><i class='font-awsome-icon fa fa-twitter-square' aria-hidden='true' style='font-size:17px;color:#00aced;display: inline-block;'></i>Twitter</a></small>"; } if (companyTbl[0].Instagram.Length > 0) { companyDetStr += "<small><a href='" + companyTbl[0].Instagram + "'><i class='font-awsome-icon fa fa-instagram' aria-hidden='true' style='font-size:17px;color:#d44332;display: inline-block;'></i>Instagram</a></small>"; } if (companyTbl[0].SocialNumber.Length > 0) { companyDetStr += "<small><a href='" + companyTbl[0].SocialNumber + "'><i class='font-awsome-icon fa fa-whatsapp' aria-hidden='true' style='font-size:17px;color:#1cb39b;display: inline-block;'></i>WhatsApp</a></small>"; } if (companyTbl[0].GooglePlus.Length > 0) { companyDetStr += "<small><a href='" + companyTbl[0].GooglePlus + "'><i class='font-awsome-icon fa fa-telegram' aria-hidden='true' style='font-size:17px;color#179cde;display: inline-block;'></i>Telegram</a></small>"; } if (companyTbl[0].Linkedin.Length > 0) { companyDetStr += "<small><a href='" + companyTbl[0].Linkedin + "'><i class='font-awsome-icon fa fa-linkedin-square' aria-hidden='true' style='font-size:17px;color:#2977c9;display: inline-block;'></i>LinkedIn</a></small>"; } if (companyTbl[0].youtube.Length > 0) { companyDetStr += "<small><a href='" + companyTbl[0].youtube + "'><i class='font-awsome-icon fa fa-youtube-square' aria-hidden='true' style='font-size:17px;color:#f00;display: inline-block;'></i>YouTube</a></small>"; } socialLinkHtml.InnerHtml = companyDetStr; #endregion }
protected void btnSave_Click(object sender, EventArgs e) { string errorMsg = string.Empty; tblCompany companyNewTbl = new tblCompany(); tblCompanyCollection compDetailsTbl = new tblCompanyCollection(); compDetailsTbl.ReadList(); try { if (compDetailsTbl.Count > 0) { if (txtCoName.Text.Length > 0) { compDetailsTbl[0].CoName = txtCoName.Text; } else { errorMsg = "* Please fill out the company name <br />"; } if (txtAddr.Text.Length > 0) { compDetailsTbl[0].CoAddr = txtAddr.Text; } else { errorMsg += "* Please fill out the address <br />"; } compDetailsTbl[0].CoOwner = txtCoOwner.Text; compDetailsTbl[0].CoOwnerWord = txtCoOwnerWords.Text; compDetailsTbl[0].CoLocA = txtLat.Text; compDetailsTbl[0].CoLocB = txtLong.Text; compDetailsTbl[0].Tel = txtPhone.Text; compDetailsTbl[0].Phone = txtFax.Text; compDetailsTbl[0].SocialNumber = txtSocialNo.Text; compDetailsTbl[0].Email = txtEmail.Text; compDetailsTbl[0].Instagram = txtInstagram.Text; compDetailsTbl[0].youtube = txtYoutube.Text; compDetailsTbl[0].Twitter = txtTwitter.Text; compDetailsTbl[0].Linkedin = txtLinkedin.Text; compDetailsTbl[0].Facebook = txtFabook.Text; compDetailsTbl[0].GooglePlus = txtGoogle.Text; compDetailsTbl[0].website = txtWebsite.Text; compDetailsTbl[0].CoDetail = txtDetails.Text; //compDetailsTbl.UpdateList(true); if (errorMsg.Length <= 0) { compDetailsTbl[0].Update(); } else { errorMsg = "Please fill out requred filds"; } } else { if (txtCoName.Text.Length > 0) { companyNewTbl.CoName = txtCoName.Text; } else { errorMsg = "* Please fill out the company name <br />"; } if (txtAddr.Text.Length > 0) { companyNewTbl.CoAddr = txtAddr.Text; } else { errorMsg += "* Please fill out the address <br />"; } companyNewTbl.CoOwner = txtCoOwner.Text; companyNewTbl.CoLocA = txtLat.Text; companyNewTbl.CoLocB = txtLong.Text; companyNewTbl.Tel = txtPhone.Text; companyNewTbl.Phone = txtFax.Text; companyNewTbl.SocialNumber = txtSocialNo.Text; companyNewTbl.Email = txtEmail.Text; companyNewTbl.Instagram = txtInstagram.Text; companyNewTbl.youtube = txtYoutube.Text; companyNewTbl.Twitter = txtTwitter.Text; companyNewTbl.Linkedin = txtLinkedin.Text; companyNewTbl.Facebook = txtFabook.Text; companyNewTbl.GooglePlus = txtGoogle.Text; companyNewTbl.website = txtWebsite.Text; companyNewTbl.CoDetail = txtDetails.Text; //compDetailsTbl.UpdateList(true); if (errorMsg.Length <= 0) { companyNewTbl.Create(); } else { errorMsg = "Please fill out requred filds"; } } ErrorMassage.InnerHtml = "Update is successfully done"; } catch (Exception ex) { ErrorMassage.InnerHtml = errorMsg + " (" + ex + " )"; //throw; } }
protected void Page_Load(object sender, EventArgs e) { //Menu string menuString = string.Empty; tblMenuCollection menuTbl = new tblMenuCollection(); menuTbl.ReadList(); string subMenuString = string.Empty; tblSubMenuCollection subMenuTbl = new tblSubMenuCollection(); for (int i = 0; i < menuTbl.Count; i++) { //get sub menu subMenuTbl.ReadList(Criteria.NewCriteria(tblSubMenu.Columns.MenuId, CriteriaOperators.Equal, menuTbl[i].id)); menuString += "<li><a href='#'>" + menuTbl[i].menuItem + "</a></li>"; //subMenuString += "<li><a href='#'>" + subMenuTbl[0].SubMenuTitle + "</a></li>"; } //menuHtml.InnerHtml = menuString; //subMenuHtml.InnerHtml = subMenuString; #region footer details // ---------------- footer ----------------- string socialFooterStr = ""; tblCompanyCollection companyDetailTbl = new tblCompanyCollection(); companyDetailTbl.ReadList(); if (companyDetailTbl.Count > 0) { coDetailHtml.InnerHtml = companyDetailTbl[0].CoDetail; if (companyDetailTbl[0].Facebook.Trim().Length > 0) { socialFooterStr += "<li><a href='" + companyDetailTbl[0].Facebook + "' class='facebook'><i class='fa fa-facebook'></i></a></li>"; } if (companyDetailTbl[0].Twitter.Trim().Length > 0) { socialFooterStr += "<li><a href='" + companyDetailTbl[0].Twitter + "' class='twitter'><i class='fa fa-twitter'></i></a></li>"; } if (companyDetailTbl[0].GooglePlus.Trim().Length > 0) { socialFooterStr += "<li><a href='" + companyDetailTbl[0].GooglePlus + "' class='google'><i class='fa fa-google'></i></a></li>"; } if (companyDetailTbl[0].Instagram.Trim().Length > 0) { socialFooterStr += "<li><a href='" + companyDetailTbl[0].Instagram + "' class='instagram'><i class='fa fa-instagram'></i></a></li>"; } if (companyDetailTbl[0].youtube.Trim().Length > 0) { socialFooterStr += "<li><a href='" + companyDetailTbl[0].youtube + "' class='youtube'><i class='fa fa-youtube'></i></a></li>"; } if (companyDetailTbl[0].Linkedin.Trim().Length > 0) { socialFooterStr += "<li><a href='" + companyDetailTbl[0].Linkedin + "' class='rss'><i class='fa fa-linkedin-square'></i></a></li>"; } } socialFooterHtml.InnerHtml = socialFooterStr; #endregion #region Ad string ret = "none"; tblAdStyleCollection adStyleTbl = new tblAdStyleCollection(); adStyleTbl.ReadList(); for (int i = 0; i < adStyleTbl.Count; i++) { // ----------------- FOR POSITION OF 980*120 -------------------- if (adStyleTbl[i].styleWidth > 600 && adStyleTbl[i].styleHeight > 105) { } // ----------------- FOR POSITION OF 980*90 -------------------- else if (adStyleTbl[i].styleWidth > 600 && adStyleTbl[i].styleHeight <= 105) { ret = giveMeAd(adStyleTbl[i].id); if (ret != "none") { adHeaderHtml.Src = ret; } } // ----------------- FOR POSITION OF 300*250 -------------------- else if (adStyleTbl[i].styleWidth <= 600 && adStyleTbl[i].styleHeight >= 250) { ret = giveMeAd(adStyleTbl[i].id); if (ret != "none") { adSquareHtml.Src = ret; } } } #endregion tblGalleryPicturesCollection galleryTbl = new tblGalleryPicturesCollection(); galleryTbl.ReadList(); #region footer gallery string pictureGalleriesStr = ""; int minLengthGallery = 0; if (galleryTbl.Count > 12) { minLengthGallery = galleryTbl.Count - 13; } for (int i = galleryTbl.Count - 1; i > minLengthGallery; i--) { pictureGalleriesStr += "<li><a href='picture-gallery.aspx'><img src='" + galleryTbl[i].GalleryPicAddr + galleryTbl[i].GalleryPicName + "' alt=''></a></li>"; } gallery1Html.InnerHtml = pictureGalleriesStr; #endregion tblNewsHitCollection hitNewsTbl = new tblNewsHitCollection(); hitNewsTbl.ReadList(); tblNewsDetailsCollection newsDetailsTbl = new tblNewsDetailsCollection(); #region hit news footer string hitNewsFooterStr = ""; int minLength = 0; if (hitNewsTbl.Count > 5) { minLength = hitNewsTbl.Count - 6; } for (int i = hitNewsTbl.Count - 1; i >= minLength; i--) { newsDetailsTbl.ReadList(Criteria.NewCriteria(tblNewsDetails.Columns.id, CriteriaOperators.Equal, hitNewsTbl[i].newsId)); hitNewsFooterStr += "<article class='article widget-article'><div class='farsi-float article4-img'><a href='donyaye-varzeshi-news-details.aspx?newsId=" + newsDetailsTbl[0].id + "'>" + "<img src='images/news/" + newsDetailsTbl[0].topPageFileAddr + "' alt='" + newsDetailsTbl[0].topPageFileAddr + "'>" + "</a></div><div class='article-body'>" + "<h4 class='farsi-position farsi-font article-title'><a href='donyaye-varzeshi-news-details.aspx?newsId=" + newsDetailsTbl[0].id + "'>" + newsDetailsTbl[0].newsDetTitle + "</a></h4>" + "<ul class='article-meta'><li><i class='fa fa-clock-o'></i>" + newsDetailsTbl[0].newsDetInsertDate + "</li><li><i class='fa fa-comments'></i>" + newsDetailsTbl[0].incReview + "</li></ul>" + "</div></article>"; } hitNewsFooterHtml.InnerHtml += hitNewsFooterStr; #endregion }
protected void btnAdd_Click(object sender, EventArgs e) { int dateInsert = Convert.ToInt32(DateTime.Now.ToString("yyyyMMdd")); tblCompanyCollection idCompanyTbl = new tblCompanyCollection(); idCompanyTbl.ReadList(); tblPortfolioCompany detTbl = new tblPortfolioCompany(); if (txtTitle.Text.Trim().Length > 0) { detTbl.title = txtTitle.Text; string str = ckDetails.Text; detTbl.details = Server.HtmlDecode(str); detTbl.idCompany = idCompanyTbl[0].id; detTbl.implimentationDate = Convert.ToInt32(txtImplementDate.Text); detTbl.idGroup = Int32.Parse(ddlPortfolioGroup.SelectedValue); detTbl.allow = "1"; // file upload start string filename = string.Empty; Boolean fileOK = false; String path = Server.MapPath("~/images/portfolio/"); if (IsPostBack) { 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 with uplouding picture"; } } else { lblError.Text = "Not valid picture"; } } //file upload end if (filename.Trim().Length > 0) { detTbl.picName = filename; } else { detTbl.picName = "default.jpg"; } detTbl.picAddr = "images/portfolio/"; detTbl.Create(); Response.Redirect("portfolio-company-add.aspx"); } else { lblError.Text = "* please enter title frist."; } }