protected void lvSOPhotoList_ItemDataBound(Object sender, RadListViewItemEventArgs e) { LinkButton _btnPhoto = (LinkButton)e.Item.FindControl("lnkDeleteImage"); (e.Item as RadListViewDataItem).GetDataKeyValue("PhotoID").ToString(); _btnPhoto.Attributes.Add("PhotoID", (e.Item as RadListViewDataItem).GetDataKeyValue("PhotoID").ToString()); if (e.Item is RadListViewItem) { RadListViewDataItem item = e.Item as RadListViewDataItem; object _dataItem = ((System.Data.DataRowView)(((RadListViewDataItem)e.Item).DataItem)).Row["photo"].ToString(); string _photoFilePath = Convert.ToString(_dataItem); RadBinaryImage _imgPhoto = (RadBinaryImage)e.Item.FindControl("RadBinaryImage1"); byte[] _photo = new byte[0] { }; if (File.Exists(Server.MapPath(_photoFilePath))) { System.Drawing.Image image = System.Drawing.Image.FromFile(Server.MapPath(_photoFilePath)); using (var memoryStream = new MemoryStream()) { image.Save(memoryStream, ImageFormat.Png); _photo = memoryStream.ToArray(); } } _imgPhoto.DataValue = _photo; } }
protected void rdGaleryCntrl_ItemDataBound(object sender, RadListViewItemEventArgs e) { blnOfertaExit = false; string sNombre = string.Empty; if (e.Item is RadListViewDataItem) { if (sType == "USR") { LinkButton oLinkButton = e.Item.FindControl("idLnkButton") as LinkButton; oLinkButton.Attributes["CodUsuario"] = ((e.Item as RadListViewDataItem).DataItem as DataRowView)["cod_usuario"].ToString(); oLinkButton.Click += new EventHandler(oLinkButton_Click); sNombre = ((e.Item as RadListViewDataItem).DataItem as DataRowView)["nom_usuario"].ToString() + " " + ((e.Item as RadListViewDataItem).DataItem as DataRowView)["ape_usuario"].ToString(); RadBinaryImage oImge = e.Item.FindControl("idImgUser") as RadBinaryImage; oImge.AlternateText = sNombre.Trim() + " Escort de Chile - Santiago."; oImge.ImageUrl = oWeb.getImageProfileUser(((e.Item as RadListViewDataItem).DataItem as DataRowView)["cod_usuario"].ToString(), string.Empty); //oImge.Height = 150; //oImge.DataValue = oWeb.getImageProfileUser(((e.Item as RadListViewDataItem).DataItem as DataRowView)["cod_usuario"].ToString(), 150, 150); Label oLabel = e.Item.FindControl("idLblNomUser") as Label; oLabel.Text = ((e.Item as RadListViewDataItem).DataItem as DataRowView)["nom_usuario"].ToString() + " " + ((e.Item as RadListViewDataItem).DataItem as DataRowView)["ape_usuario"].ToString(); } } }
/// <summary> ///چنانچه کلید تایید اعمال تغییرات فشرده شود، نتیجه درخواست های ویرایش مبنی بر تایید یا رد شدن آنها، اعمال می گردد /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param> protected void conf_Click(object sender, EventArgs e) { CommonBusiness cmnb = new CommonBusiness(); foreach (RadListViewDataItem lvperspic in rdl_PersPic.Items) { RadioButton rdb_ConfPic = (RadioButton)lvperspic.FindControl("rdb_ConfPic"); RadioButton rdb_FailedPic = (RadioButton)lvperspic.FindControl("rdb_FailedPic"); RadBinaryImage img_PersonalPic = (RadBinaryImage)lvperspic.FindControl("img_PersonalPic"); TextBox txt_RadPic = (TextBox)lvperspic.FindControl("txt_RadPic"); rdbpic(); if (picstatus == true) { EditBusiness.UpdateIsOk(Session["stcode"].ToString(), 10, 7, ""); dtn = EditBusiness.GetEditedIdOfStcode(Session["stcode"].ToString()); EditBusiness.updateEditedStuImage(Session["stcode"].ToString(), (byte[])(dtn.Rows[0]["PersonalImage"])); EditBusiness.UpdateStudentEditeRequestLogID(Session["stcode"].ToString(), 7, 10); cmnb.InsertIntoUserLog(int.Parse(Session[sessionNames.userID_Karbar].ToString()), DateTime.Now.ToShortTimeString(), int.Parse(Session[sessionNames.appID_Karbar].ToString()), 12, Session["stcode"].ToString()); } if (picstatus == false) { EditBusiness.UpdateIsOk(Session["stcode"].ToString(), 10, 5, txt_RadPic.Text); cmnb.InsertIntoUserLog(int.Parse(Session[sessionNames.userID_Karbar].ToString()), DateTime.Now.ToShortTimeString(), int.Parse(Session[sessionNames.appID_Karbar].ToString()), 13, Session["stcode"].ToString()); } } Response.Redirect("ConfirmEditPersonalInformationUI.aspx?id=" + generaterandomstr(11) + "@A" + Session[sessionNames.menuID].ToString() + "-" + generaterandomstr(2)); }
protected void grvDaoTao_ItemCommand(object sender, GridCommandEventArgs e) { if (e.CommandName == "RowClick" && e.Item is GridDataItem) { e.Item.Selected = true; idDaoTao = Convert.ToInt32(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["IDDaoTao"]); var daoTao = _entities.DaoTaos.Where(d => d.IDDaoTao == idDaoTao).FirstOrDefault(); cboTrinhDo.SelectedValue = daoTao.IDTrinhDo.ToString(); cboLoaiHinh.SelectedValue = daoTao.IDLoaiHinh.ToString(); cboNoiDT.SelectedValue = daoTao.IDNoiCapBang.ToString(); cboChuyenNganh.SelectedValue = daoTao.IDChuyenNganh.ToString(); txtTuNgay.SelectedDate = daoTao.TuNgay; txtDenNgay.SelectedDate = daoTao.DenNgay; cboLoaiBang.SelectedValue = daoTao.IDLoaiBangDT.ToString(); AnhScan.Height = Unit.Pixel(160); AnhScan.Width = Unit.Pixel(160); if (daoTao.Anh != null) { AnhScan.DataValue = imgdata = daoTao.Anh; } else { AnhScan.ImageUrl = "../Images/no_photo.jpg"; } RadBinaryImage imgl = (RadBinaryImage)e.Item.FindControl("largeImage"); HyperLink lnk = (HyperLink)e.Item.FindControl("Link1"); lnk.NavigateUrl = imgl.ImageUrl; } }
/// <summary> /// Verificar este metodo Ing. Carlo Hernandez ---Preguntar a Ditmar Estrada /// </summary> /// <param name="source"></param> /// <param name="e"></param> protected void gv_Foto_ItemCommand(object source, GridCommandEventArgs e) { try { //panelEdit.DataBind(); //RadBinaryImage_fotoBig.DataBind(); //RadBinaryImage_fotoBig.Visible = false; //GridItem item = gv_Foto.Items[e.Item.ItemIndex]; GridItem item = gv_Foto.Items[e.Item.ItemIndex]; Label lbl_id_reg_foto = (Label)item.FindControl("lbl_id_reg_foto"); if (e.CommandName == "VERFOTO") { Session["iidregft"] = Convert.ToInt32(lbl_id_reg_foto.Text); DataTable dt = null; Conexion Ocoon = new Conexion(); //string sidregft = ((LinkButton)sender).CommandArgument; int iidregft = Convert.ToInt32(lbl_id_reg_foto.Text); dt = Ocoon.ejecutarDataTable("UP_WEBXPLORA_OPE_CONSULTA_REG_FOTO", iidregft); byte[] byteArrayIn = (byte[])dt.Rows[0]["foto"]; Session["array"] = byteArrayIn; RadBinaryImage_viewFoto.DataValue = byteArrayIn; ModalPopupExtender_viewfoto.Show(); //Response.Redirect("verFoto.aspx?iidregft=" + iidregft, true); } else if (e.CommandName == "EDITFOTO") { //string sidregft = ((LinkButton)senser).CommandArgument; int iidregft = Convert.ToInt32(lbl_id_reg_foto.Text); //int Id_repft = Convert.ToInt32(lbl_Id_Reg_Fotogr.Text); if (Int32.Equals(iidregft, 0)) { Response.Redirect("/login.aspx"); } else { RadBinaryImage imageBinary = (RadBinaryImage)item.FindControl("RadBinaryImage_foto"); //RadBinaryImage_fotoBig.DataValue = imageBinary.DataValue; // RadBinaryImage_fotoBig.Visible = false; Session["iidregft"] = iidregft; //Session["Id_repft"] = Id_repft; } //ModalPopup_Edit.Show(); } } catch (Exception ex) { ex.ToString(); Response.Redirect("~/err_mensaje_seccion.aspx", true); } }
protected void Page_Load(object sender, EventArgs e) { StringBuilder sPath; StringBuilder sUrlImg; FileStream filestream; RadBinaryImage oImge; pContenido = this.Attributes["pContenido"]; string cPath = Server.MapPath("."); DataTable dContenido = oWeb.DeserializarTbl(cPath, "ContenidoArchivo_" + pContenido + ".bin"); if (dContenido != null) { if (dContenido.Rows.Count > 0) { DataRow[] oRows = dContenido.Select(" ext_archivo in ('.jpg','.bmp','.gif', '.tiff', '.png') "); if (oRows.Count() > 0) { foreach (DataRow oRow in oRows) { GalleryContent.Controls.Add(new LiteralControl("<li>")); sUrlImg = new StringBuilder(); sUrlImg.Append("<a href=\"rps_onlineservice/contenido/contenido_").Append(pContenido).Append("/").Append(oRow["nom_archivo"].ToString()).Append("\">"); GalleryContent.Controls.Add(new LiteralControl(sUrlImg.ToString())); sPath = new StringBuilder(); sPath.Append(HttpContext.Current.Server.MapPath(".")); sPath.Append(@"\rps_onlineservice\"); sPath.Append(@"\contenido\"); sPath.Append(@"\contenido_"); sPath.Append(pContenido); sPath.Append(@"\"); sPath.Append(oRow["nom_archivo"].ToString()); filestream = new FileStream(sPath.ToString(), FileMode.Open); oImge = new RadBinaryImage(); oImge.DataValue = oWeb.GetImageBytes(filestream, 70, 70); filestream.Close(); GalleryContent.Controls.Add(oImge); //sUrlImg = new StringBuilder(); //sUrlImg.Append("<img src=\"rps_onlineservice/contenido/contenido_").Append(pContenido).Append("/").Append(oRow["nom_archivo"].ToString()).Append("\">"); //GalleryContent.Controls.Add(new LiteralControl(sUrlImg.ToString())); GalleryContent.Controls.Add(new LiteralControl("</a>")); GalleryContent.Controls.Add(new LiteralControl("</li>")); } } oRows = null; } } dContenido = null; }
protected void Page_Init(object sender, EventArgs e) { string uname = Request.QueryString["uname"].ToString(); string getall = @"select [ID] from [User] where [uname] = '" + uname + "'"; dt = new DataTable(); dt = profile.ReturnDT(getall); string vid = dt.Rows[0]["ID"].ToString(); string inhisbox = @"SELECT Box.SID, Propic.Image, [User].uname FROM Box INNER JOIN Propic ON Box.SID = Propic.UID INNER JOIN [User] ON Box.SID = [User].ID WHERE (Box.MyID = " + vid + ") AND (Propic.[Current] = 1)"; DataTable dt2 = new DataTable(); dt2 = profile.ReturnDT(inhisbox); foreach (DataRow m in dt2.Rows) { RadBinaryImage rbg = new RadBinaryImage(); rbg.ResizeMode = BinaryImageResizeMode.Crop; rbg.Width = 85; rbg.Height = 85; rbg.CssClass = "mageaa"; rbg.DataValue = (byte[])m["Image"]; HyperLink hyper = new HyperLink(); hyper.NavigateUrl = "~/Menu/profile.aspx?uname=" + m["uname"] + ""; hyper.Controls.Add(rbg); inbox.Controls.Add(hyper); } string isboxedby = @"SELECT Propic.Image, [User].uname, Box.MyID FROM Box INNER JOIN Propic ON Box.MyID = Propic.UID INNER JOIN [User] ON Box.MyID = [User].ID WHERE (Propic.[Current] = 1) AND (Box.SID = " + vid + ")"; DataTable dt3 = new DataTable(); dt3 = profile.ReturnDT(isboxedby); foreach (DataRow m in dt3.Rows) { RadBinaryImage rbg = new RadBinaryImage(); rbg.ResizeMode = BinaryImageResizeMode.Crop; rbg.Width = 85; rbg.Height = 85; rbg.CssClass = "mageaa"; rbg.DataValue = (byte[])m["Image"]; HyperLink hyper = new HyperLink(); hyper.NavigateUrl = "~/Menu/profile.aspx?uname=" + m["uname"] + ""; hyper.Controls.Add(rbg); boxed.Controls.Add(hyper); } }
private RadBinaryImage GetPlayerImage(v_Team_Draft_RosterDomainModel item) { RadBinaryImage rBIPlayer = new RadBinaryImage(); rBIPlayer.DataValue = item.PlayerImage; rBIPlayer.AutoAdjustImageControlSize = false; rBIPlayer.Width = 120; rBIPlayer.Height = 158; return(rBIPlayer); }
protected void rdFriendUser_ItemDataBound(object sender, RadListViewItemEventArgs e) { if (e.Item is RadListViewDataItem) { RadBinaryImage oBinaryImage = e.Item.FindControl("idImgFriendUser") as RadBinaryImage; oBinaryImage.DataValue = oWeb.getImageProfileUser(((DataRow)(((e.Item as RadListViewDataItem).DataItem))).ItemArray[1].ToString(), 150, 150); Label oLblNomUser = e.Item.FindControl("idLblNomUser") as Label; oLblNomUser.Text = ((DataRow)(((e.Item as RadListViewDataItem).DataItem))).ItemArray[3].ToString(); } }
protected void rdUserImage_ItemDataBound(object sender, RadListViewItemEventArgs e) { if (e.Item is RadListViewDataItem) { StringBuilder sPath; sPath = new StringBuilder(); sPath.Append(HttpContext.Current.Server.MapPath(".")); sPath.Append(@"\rps_onlineservice\"); sPath.Append(@"\escorts\"); sPath.Append(@"\escort_"); sPath.Append(((e.Item as RadListViewDataItem).DataItem as DataRowView)["cod_usuario"].ToString()); sPath.Append(@"\"); sPath.Append(((e.Item as RadListViewDataItem).DataItem as DataRowView)["nom_archivo"].ToString()); FileStream fileStream = new FileStream(sPath.ToString(), FileMode.Open); RadBinaryImage oBinaryImage = e.Item.FindControl("oBinaryImage") as RadBinaryImage; oBinaryImage.DataValue = oWeb.GetImageBytes(fileStream, 300, 300); oBinaryImage.Width = Unit.Pixel(200); oBinaryImage.AutoAdjustImageControlSize = false; //oBinaryImage.ImageUrl = string.Format("{0}", sPath.ToString()); fileStream.Close(); sPath = new StringBuilder(); sPath.Append("../rps_onlineservice").Append("/escorts").Append("/escort_"); sPath.Append(((e.Item as RadListViewDataItem).DataItem as DataRowView)["cod_usuario"].ToString()); sPath.Append("/"); sPath.Append(((e.Item as RadListViewDataItem).DataItem as DataRowView)["nom_archivo"].ToString()); HyperLink oHyperLink = e.Item.FindControl("idLnkButton") as HyperLink; oHyperLink.NavigateUrl = string.Format("{0}", sPath.ToString()); //oHyperLink.NavigateUrl = string.Format("{0}", oBinaryImage.ImageUrl.ToString()); oHyperLink.Attributes["rel"] = "ImgFotoUser"; } if ((Session["CodUsuarioPerfil"] != null) && (Session["CodUsuarioPerfil"].ToString() == oIsUsuario.CodUsuario)) { if (e.Item is RadListViewDataItem) { if (((e.Item as RadListViewDataItem).DataItem as DataRowView)["tip_archivo"].ToString() == "P") { Button btnImgPrincipal = e.Item.FindControl("btnImgPrincipal") as Button; btnImgPrincipal.Visible = false; } } } else { Button btnImgPrincipal = e.Item.FindControl("btnImgPrincipal") as Button; btnImgPrincipal.Visible = false; Button btnEliminar = e.Item.FindControl("btnEliminar") as Button; btnEliminar.Visible = false; } }
protected void Page_Init(object sender, EventArgs e) { string uname = Request.QueryString["uname"].ToString(); string getall = @"select [ID] from [User] where [uname] = '" + uname + "'"; dt = new DataTable(); dt = profile.ReturnDT(getall); string vid = dt.Rows[0]["ID"].ToString(); string inhisbox = @"SELECT Box.SID, Propic.Image, [User].uname FROM Box INNER JOIN Propic ON Box.SID = Propic.UID INNER JOIN [User] ON Box.SID = [User].ID WHERE (Box.MyID = " +vid+") AND (Propic.[Current] = 1)"; DataTable dt2 = new DataTable(); dt2 = profile.ReturnDT(inhisbox); foreach (DataRow m in dt2.Rows) { RadBinaryImage rbg = new RadBinaryImage(); rbg.ResizeMode = BinaryImageResizeMode.Crop; rbg.Width = 85; rbg.Height = 85; rbg.CssClass = "mageaa"; rbg.DataValue = (byte[])m["Image"]; HyperLink hyper = new HyperLink(); hyper.NavigateUrl = "~/Menu/profile.aspx?uname="+m["uname"]+""; hyper.Controls.Add(rbg); inbox.Controls.Add(hyper); } string isboxedby = @"SELECT Propic.Image, [User].uname, Box.MyID FROM Box INNER JOIN Propic ON Box.MyID = Propic.UID INNER JOIN [User] ON Box.MyID = [User].ID WHERE (Propic.[Current] = 1) AND (Box.SID = "+vid+")"; DataTable dt3 = new DataTable(); dt3 = profile.ReturnDT(isboxedby); foreach (DataRow m in dt3.Rows) { RadBinaryImage rbg = new RadBinaryImage(); rbg.ResizeMode = BinaryImageResizeMode.Crop; rbg.Width = 85; rbg.Height = 85; rbg.CssClass = "mageaa"; rbg.DataValue = (byte[])m["Image"]; HyperLink hyper = new HyperLink(); hyper.NavigateUrl = "~/Menu/profile.aspx?uname=" + m["uname"] + ""; hyper.Controls.Add(rbg); boxed.Controls.Add(hyper); } }
protected void QRCodeOlustur() { EFDal ed = new EFDal(); string BaseUrl = ConfigurationManager.AppSettings["BaseUrl"].ToString(); //Burada daha önce bu IstId için bir kapak oluşturulmuş mu ona bakmak gerekli.. string DahaOnceVerilmisDosyaAdi = ed.KapakSayfasiDosyaAdiniDon(Convert.ToInt32(Request["IstId"].ToString())); Guid KapakDosyaAdi = Guid.Empty; if (DahaOnceVerilmisDosyaAdi != string.Empty) { KapakDosyaAdi = Guid.Parse(DahaOnceVerilmisDosyaAdi.Replace(".pdf", "")); } else { KapakDosyaAdi = Guid.NewGuid(); } Session["SertifikaDosyaAdi"] = KapakDosyaAdi; try { string qrCodeImageFile = Guid.NewGuid().ToString(); //string qrCodeImagePath = Server.MapPath("~/DosyaSistemi/QRCode/" + qrCodeImageFile + ".png"); RadBarcode barcode = new RadBarcode(); //barcode.Text = "some text"; barcode.Text = BaseUrl + "DosyaSistemi/" + ed.kal_BolgeKoduDon(Context.User.Identity.Name).ToString() + "/" + DateTime.Now.Year.ToString() + "/" + KapakDosyaAdi.ToString() + ".pdf"; barcode.Type = BarcodeType.QRCode; Session["qrCodeURL"] = barcode.Text; barcode.LineWidth = 2; RadBinaryImage image = new RadBinaryImage(); System.IO.MemoryStream stream = new System.IO.MemoryStream(); // kaldırılabilir?-> barcode.GetImage().Save(stream, System.Drawing.Imaging.ImageFormat.Png); image.DataValue = stream.ToArray(); ed.InsertqrCodeImage(Convert.ToInt32(Request["IstId"].ToString()), image.DataValue); //System.Drawing.Image img = barcode.GetImage(); //img.Save(qrCodeImagePath, System.Drawing.Imaging.ImageFormat.Png); //return qrCodeImagePath; } catch (Exception e) { //return string.Empty; } }
protected override bool EvaluateIsValid() { try { Image rbi = (Image)_ctrl; return(rbi.ImageUrl != "~/images/noimages.jpg"); } catch { RadBinaryImage rbi = (RadBinaryImage)_ctrl; return(rbi.ImageUrl != "~/images/noimages.jpg"); } }
/// <summary> /// با لود شدن صفحه لیست هایی شامل اطلاعات جدید و قدیم دانشجو نمایش داده می شود /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param> protected void Page_Load(object sender, EventArgs e) { rdb_newinfos(); rdbpic(); Session["stcode"] = Request.QueryString["stcode"].ToString(); if (!IsPostBack) { dts = EditBusiness.GetStudentPic(Session["stcode"].ToString()); if (dts.Rows.Count > 0) { if (dts.Rows.Count > 0) { rdl_PersPic.DataSource = dts; rdl_PersPic.DataBind(); foreach (RadListViewDataItem lvperspic in rdl_PersPic.Items) { RadBinaryImage img_PersonalPic = (RadBinaryImage)lvperspic.FindControl("img_PersonalPic"); img_PersonalPic.DataValue = (byte[])(dts.Rows[0]["PersonalImage"]); rdl_PersPic.Visible = true; } } } dt = CartBusiness.GetStudentsInfo(Session["stcode"].ToString()); rdlv_previous.DataSource = dt; rdlv_previous.DataBind(); if (dt.Rows[0]["pic"].ToString() != "") { newimage = (byte[])(dt.Rows[0]["pic"]); } if (dt.Rows.Count > 0) { foreach (RadListViewDataItem lvid in rdlv_previous.Items) { Label lbl_PersonalImgPrev = (Label)lvid.FindControl("lbl_PersonalImgPrev"); RadBinaryImage img_PersonalPicPrev = (RadBinaryImage)lvid.FindControl("img_PersonalPicPrev"); if (dt.Rows[0]["pic"].ToString() != "") { byte[] array = (byte[])(dt.Rows[0]["pic"]); img_PersonalPicPrev.DataValue = array; img_PersonalPicPrev.Visible = true; lbl_PersonalImgPrev.Visible = true; } } } } }
protected void rlv_ItemDataBound1(object sender, Telerik.Web.UI.RadListViewItemEventArgs e) { RadListViewDataItem row = e.Item as RadListViewDataItem; if (DataBinder.Eval(row.DataItem, "scan_document") == DBNull.Value) { return; } //HiddenField HF = (HiddenField)e.Item.FindControl("HiddenField1"); Label lbl = (Label)e.Item.FindControl("lbl_Name"); object var = row.DataItem.ToString(); string myValue = DataBinder.Eval(row.DataItem, "ext").ToString(); string result = myValue.ToLower(); if (result.Contains("pdf")) { Button btn = (Button)e.Item.FindControl("btn_Madrak"); btn.Visible = true; //HF.Value = DataBinder.Eval(row.DataItem, "doc_type").ToString(); lbl.Text = DataBinder.Eval(row.DataItem, "document_name").ToString(); } else { Button btn = (Button)e.Item.FindControl("btn_ShowPicture"); btn.Visible = true; RadBinaryImage img = (RadBinaryImage)e.Item.FindControl("RadBinaryImage1"); img.Visible = true; byte[] binaryData = (byte[])(DataBinder.Eval(row.DataItem, "scan_document")); img.DataValue = binaryData; //HF.Value = DataBinder.Eval(row.DataItem, "doc_type").ToString(); lbl.Text = DataBinder.Eval(row.DataItem, "document_name").ToString(); } if (DataBinder.Eval(row.DataItem, "s1").ToString() != "0") { RadioButton rdbTaeed = (RadioButton)e.Item.FindControl("rdb_Taeed"); RadioButton rdbNaghs = (RadioButton)e.Item.FindControl("rdb_Naghs"); TextBox txt = (TextBox)e.Item.FindControl("txt_Sharh"); txt.Text = DataBinder.Eval(row.DataItem, "Description").ToString(); if (DataBinder.Eval(row.DataItem, "s1").ToString() == "1") { rdbTaeed.Checked = true; } else { rdbNaghs.Checked = true; } } }
protected void getImagenes(string sCodUsuario) { DBConn oConn = new DBConn(); if (oConn.Open()) { SysArchivosUsuarios ArchivosUsuarios = new SysArchivosUsuarios(ref oConn); ArchivosUsuarios.CodUsuario = sCodUsuario; DataTable dArchivos = ArchivosUsuarios.Get(); if (dArchivos != null) { if (dArchivos.Rows.Count > 0) { RadBinaryImage oBinaryImage; FileStream fileStream; StringBuilder sPath; loadImage.Controls.Add(new LiteralControl("<div id=\"bloqimgs\">")); foreach (DataRow oRow in dArchivos.Rows) { sPath = new StringBuilder(); sPath.Append(HttpContext.Current.Server.MapPath(".")); sPath.Append(@"\rps_onlineservice\"); sPath.Append(@"\escorts\"); sPath.Append(@"\escort_"); sPath.Append(sCodUsuario); sPath.Append(@"\"); sPath.Append(oRow["nom_archivo"].ToString()); fileStream = new FileStream(sPath.ToString(), FileMode.Open); oBinaryImage = new RadBinaryImage(); oBinaryImage.DataValue = oWeb.GetImageBytes(fileStream, 100, 100); oBinaryImage.Width = Unit.Pixel(50); oBinaryImage.AutoAdjustImageControlSize = false; fileStream.Close(); loadImage.Controls.Add(new LiteralControl("<div class=\"imgUsrList\">")); loadImage.Controls.Add(oBinaryImage); loadImage.Controls.Add(new LiteralControl("</div>")); } loadImage.Controls.Add(new LiteralControl("</div>")); } } dArchivos = null; oConn.Close(); } }
public void loadcomments(string mainid) { string getallmessages = @"SELECT Propic.Image, Message.Message, Message.UID FROM Message INNER JOIN Propic ON Message.UID = Propic.UID WHERE (Propic.[Current] = 1) AND (Message.CID = " + mainid + @") ORDER BY Message.ID ASC"; ccid.Text = mainid; dt = new DataTable(); dt = db.ReturnDT(getallmessages); for (int x = 0; x < dt.Rows.Count; x++) { Panel panel = new Panel(); RoundedCornersExtender rnd = new RoundedCornersExtender(); panel.ID = x.ToString(); rnd.TargetControlID = x.ToString(); rnd.Radius = 5; panel.BackColor = System.Drawing.Color.FromArgb(239, 239, 241); RadBinaryImage rbg = new RadBinaryImage(); rbg.Height = 35; rbg.Width = 35; rbg.DataValue = (byte[])dt.Rows[x]["Image"]; rbg.ResizeMode = BinaryImageResizeMode.Crop; rbg.CssClass = "sidemeyaaar"; panel.Controls.Add(rbg); Label lbl = new Label(); lbl.CssClass = "sidemeyaaarright"; lbl.Text = dt.Rows[x]["Message"].ToString(); panel.Controls.Add(lbl); messageloader.Controls.Add(rnd); messageloader.Controls.Add(panel); } ptb.Visible = true; send.Visible = true; }
protected void getEmailRel(string pCodEmailRel, string pCodUsuario, string pDateEmail, DataTable dEmlUsr) { RadBinaryImage oImage; Label oLabel; StringBuilder sSQL = new StringBuilder(); sSQL.Append(" cod_email_rel = ").Append(pCodEmailRel); DataRow[] oRowsEmailRel = dEmlUsr.Select(sSQL.ToString()); if (oRowsEmailRel != null) { if (oRowsEmailRel.Count() > 0) { foreach (DataRow oRow in oRowsEmailRel) { Controls.Add(new LiteralControl("<div>")); oImage = new RadBinaryImage(); oImage.DataValue = oWeb.getImageProfileUser(oRow["cod_usuario"].ToString(), 62, 62); Controls.Add(oImage); Controls.Add(new LiteralControl("</div>")); Controls.Add(new LiteralControl("<div>")); oLabel = new Label(); oLabel.ID = "lblComment_" + oRow["cod_email"].ToString(); oLabel.Text = oRow["cuerpo_email"].ToString(); Controls.Add(oLabel); Controls.Add(new LiteralControl("</div>")); Controls.Add(new LiteralControl("<div>")); oLabel = new Label(); oLabel.ID = "lblFecha_" + oRow["cod_email"].ToString(); oLabel.Text = oCulture.GetResource("Global", "Comentado") + " " + String.Format("{0:f}", DateTime.Parse(oRow["fecha_email"].ToString())); Controls.Add(oLabel); Controls.Add(new LiteralControl("</div>")); getEmailRel(oRow["cod_email"].ToString(), oRow["cod_usuario"].ToString(), oRow["fecha_email"].ToString(), dEmlUsr); } } } oRowsEmailRel = null; }
protected void Page_Load(object sender, EventArgs e) { if ((Session["CodUsuarioPerfil"] != null) && (!string.IsNullOrEmpty(Session["CodUsuarioPerfil"].ToString()))) { RadBinaryImage oBinaryImage = new RadBinaryImage(); oBinaryImage.CssClass = "imagenperfil"; oBinaryImage.DataValue = oWeb.getImageProfileUser(Session["CodUsuarioPerfil"].ToString(), 300, 300); oBinaryImage.Width = Unit.Pixel(225); oBinaryImage.Height = Unit.Pixel(225); oBinaryImage.AutoAdjustImageControlSize = false; Controls.Add(oBinaryImage); //string cPath = Server.MapPath("."); //DataTable dUserArchivo = oWeb.DeserializarTbl(cPath, "UserArchivo_" + Session["CodUsuarioPerfil"].ToString() + ".bin"); //if (dUserArchivo != null) // if (dUserArchivo.Rows.Count > 0) { // DataRow[] oRows = dUserArchivo.Select(" tip_archivo = 'P' "); // if (oRows != null) // if (oRows.Count() > 0) { // StringBuilder sPath = new StringBuilder(); // sPath.Append(Server.MapPath(".")); // sPath.Append(@"\rps_onlineservice\"); // sPath.Append(@"\usuarios\"); // sPath.Append(@"\usuario_"); // sPath.Append(Session["CodUsuarioPerfil"].ToString()); // sPath.Append(@"\"); // sPath.Append(oRows[0]["nom_archivo"].ToString()); // FileStream fileStream = new FileStream(sPath.ToString(), FileMode.Open); // RadBinaryImage oBinaryImage = new RadBinaryImage(); // oBinaryImage.CssClass = "imagenperfil"; // oBinaryImage.DataValue = oWeb.GetImageBytes(fileStream, 300, 300); // fileStream.Close(); // Controls.Add(oBinaryImage); // } // oRows = null; // } //dUserArchivo = null; } }
protected void rGridTeam_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e) { if (e.Item is GridDataItem) { //GridDataItem dataItem = e.Item as GridDataItem; int fieldValue = Convert.ToInt32(DataBinder.Eval(e.Item.DataItem, "Points").ToString()); totPointCount += fieldValue; RadBinaryImage rPrimPos = (RadBinaryImage)e.Item.FindControl("imgPrimPositon"); RadBinaryImage rSecPos = (RadBinaryImage)e.Item.FindControl("imgSecPositon"); rPrimPos.ImageUrl = "~/Content/images/" + DataBinder.Eval(e.Item.DataItem, "PrimPos").ToString().Trim() + ".jpg"; if (DataBinder.Eval(e.Item.DataItem, "SecPos") != null) { rSecPos.ImageUrl = "~/Content/images/" + DataBinder.Eval(e.Item.DataItem, "SecPos").ToString().Trim() + ".jpg"; } else { rSecPos.Visible = false; } } if (e.Item is GridFooterItem) { GridFooterItem footerItem = e.Item as GridFooterItem; footerItem["Points"].Text = "total: " + totPointCount.ToString(); } else if (e.Item is GridEditableItem && e.Item.IsInEditMode) { GridEditableItem edtItem = (GridEditableItem)e.Item; Label lblSeasonID = (Label)edtItem.FindControl("lblSeasonID"); Label lblTeamID = (Label)edtItem.FindControl("lblTeamID"); RadDropDownList rDDSeasonTeam = (RadDropDownList)edtItem.FindControl("rDDSeasonTeam"); rDDSeasonTeam.DataSource = SeasonTeamBLL.SeasonTeamOrder(Convert.ToInt32(lblSeasonID.Text)); rDDSeasonTeam.DataValueField = "TeamID"; rDDSeasonTeam.DataTextField = "TeamName"; rDDSeasonTeam.DataBind(); rDDSeasonTeam.SelectedValue = lblTeamID.Text.ToString(); } }
protected void Page_Load(object sender, EventArgs e) { string det = Request.QueryString["uid"].ToString(); string checkif = "SELECT * FROM Friends WHERE (MyId=" + Session["UserId"].ToString() + " and FriendId=" + det + " and FriendStatus =1) OR (MyId=" + det + " and FriendId=" + Session["UserId"].ToString() + " and FriendStatus =1)"; DataTable dt = new DataTable(); dt = phhotos.ReturnDT(checkif); if (dt.Rows.Count > 0) { string getalbums = @"SELECT Albums.Name, Albums.UID, Albums.ID, Albums.Random, [User].Name AS Uname FROM Albums INNER JOIN [User] ON Albums.UID = [User].ID WHERE (Albums.UID = " + det + ")"; DataTable dt2 = new DataTable(); dt2 = phhotos.ReturnDT(getalbums); uname.Text = dt2.Rows[0]["Uname"].ToString(); for (int x = 0; x < dt2.Rows.Count; x++) { RadBinaryImage img = new RadBinaryImage(); string getph = @"SELECT TOP (1) AlbumID, Photo, UID , ID FROM Photos WHERE (AlbumID = " + dt2.Rows[x]["ID"] + ")"; DataTable dynamica = new DataTable(); dynamica = phhotos.ReturnDT(getph); if (dynamica.Rows.Count > 0) { img.DataValue = (byte[])dynamica.Rows[0]["Photo"]; img.Width = Unit.Pixel(300); img.Height = Unit.Pixel(100); img.ResizeMode = BinaryImageResizeMode.Fit; img.CssClass = "alimg"; img.Attributes.Add("onclick", "goto('Viewer.aspx?determiner=album" + dt2.Rows[x]["ID"] + "')"); Panel1.Controls.Add(img); } } } }
protected void Page_Load(object sender, EventArgs e) { string det = Request.QueryString["uid"].ToString(); string checkif = "SELECT * FROM Friends WHERE (MyId=" + Session["UserId"].ToString() + " and FriendId=" + det + " and FriendStatus =1) OR (MyId=" + det + " and FriendId=" + Session["UserId"].ToString() + " and FriendStatus =1)"; DataTable dt = new DataTable(); dt = phhotos.ReturnDT(checkif); if (dt.Rows.Count > 0) { string getalbums = @"SELECT Albums.Name, Albums.UID, Albums.ID, Albums.Random, [User].Name AS Uname FROM Albums INNER JOIN [User] ON Albums.UID = [User].ID WHERE (Albums.UID = "+det+")"; DataTable dt2 = new DataTable(); dt2 = phhotos.ReturnDT(getalbums); uname.Text = dt2.Rows[0]["Uname"].ToString(); for(int x= 0;x<dt2.Rows.Count;x++) { RadBinaryImage img = new RadBinaryImage(); string getph = @"SELECT TOP (1) AlbumID, Photo, UID , ID FROM Photos WHERE (AlbumID = "+dt2.Rows[x]["ID"]+")"; DataTable dynamica = new DataTable(); dynamica = phhotos.ReturnDT(getph); if (dynamica.Rows.Count > 0) { img.DataValue = (byte[])dynamica.Rows[0]["Photo"]; img.Width = Unit.Pixel(300); img.Height = Unit.Pixel(100); img.ResizeMode = BinaryImageResizeMode.Fit; img.CssClass = "alimg"; img.Attributes.Add("onclick", "goto('Viewer.aspx?determiner=album" + dt2.Rows[x]["ID"] + "')"); Panel1.Controls.Add(img); } } } }
protected void QRCodeOlustur() { RadBarcode barcode = new RadBarcode(); //barcode.Text = "some text"; barcode.Text = ""; barcode.Type = BarcodeType.QRCode; barcode.LineWidth = 2; RadBinaryImage image = new RadBinaryImage(); //PlaceHolder1.Controls.Add(image); System.IO.MemoryStream stream = new System.IO.MemoryStream(); barcode.GetImage().Save(stream, System.Drawing.Imaging.ImageFormat.Png); image.DataValue = stream.ToArray(); System.Drawing.Image img = barcode.GetImage(); string qrCodeImageFile = Guid.NewGuid().ToString(); img.Save(Server.MapPath("~/DosyaSistemi/QRCode/" + qrCodeImageFile + ".png"), System.Drawing.Imaging.ImageFormat.Png); //FileStream file =new FileStream(Server.MapPath("~/DosyaSistemi/Oneri.docx")) }
private RadDock CreateRadDock(v_Team_Draft_RosterDomainModel item) { RadDock dock = new RadDock(); dock.DockMode = DockMode.Docked; // dock.ID = item.PlayerGuid.ToString(); dock.UniqueName = item.PlayerGuid.ToString(); dock.Title = item.PlayerName; dock.Width = Unit.Pixel(125); RadBinaryImage rBIPlayer = GetPlayerImage(item); dock.Controls.Add(rBIPlayer); dock.DefaultCommands = Telerik.Web.UI.Dock.DefaultCommands.None; RadLabel rLBL = new RadLabel(); rLBL.Text = "Trading from Team: " + item.TeamName.Trim(); dock.Controls.Add(rLBL); dock.ForbiddenZones = "rDZMyTeam".Split('|'); return(dock); }
public static void ResizeImage(int MaxSideSize, string ImagePath, RadBinaryImage radImage) { byte[] byteArray = null; // really make this an error gif if (ImagePath.Contains("http://") || ImagePath.Contains("www.")) { HttpWebRequest request = (HttpWebRequest)WebRequest.Create(ImagePath); request.Method = "GET"; request.Accept = "image/gif"; HttpWebResponse response = (HttpWebResponse)request.GetResponse(); Stream s = response.GetResponseStream(); byteArray = ImageResize.ResizeFromStream(MaxSideSize, s, "ProfilePic"); } else { byteArray = null; // really make this an error gif MemoryStream ms = new MemoryStream(System.IO.File.ReadAllBytes(System.Web.HttpContext.Current.Server.MapPath(ImagePath))); byteArray = ImageResize.ResizeFromStream(MaxSideSize, ms, "ProfilePic"); } radImage.DataValue = byteArray; radImage.ResizeMode = Telerik.Web.UI.BinaryImageResizeMode.Crop; }
protected void putConfirmFriendRequest() { OnlineServices.Method.Usuario oIsUsuario; oIsUsuario = oWeb.GetObjUsuario(); pCodUsuario = oIsUsuario.CodUsuario; Button oButton; StringBuilder cSQL = new StringBuilder(); cSQL.Append(" est_relacion = 'C' "); StringBuilder oFolder = new StringBuilder(); oFolder.Append(Server.MapPath(".")); string sFile = "RelacionUsuario_" + oIsUsuario.CodUsuario + ".bin"; DataTable dRelacionUsuarios = oWeb.DeserializarTbl(oFolder.ToString(), sFile); if (dRelacionUsuarios != null) { if (dRelacionUsuarios.Rows.Count > 0) { DataRow[] oRows = dRelacionUsuarios.Select(cSQL.ToString()); if (oRows != null) { if (oRows.Count() > 0) { Label oLabel; Controls.Add(new LiteralControl("<div>")); oLabel = new Label(); oLabel.Text = "Confirma Amistad"; oLabel.CssClass = "lblConfirmaAmistad"; Controls.Add(oLabel); Controls.Add(new LiteralControl("</div>")); RadBinaryImage oRadBinaryImage; foreach (DataRow oRow in oRows) { Controls.Add(new LiteralControl("<div>")); oRadBinaryImage = new RadBinaryImage(); oRadBinaryImage.DataValue = oWeb.getImageProfileUser(oRow["cod_usuario_rel"].ToString(), 150, 150); Controls.Add(oRadBinaryImage); Controls.Add(new LiteralControl("</div>")); Controls.Add(new LiteralControl("<div>")); oButton = new Button(); oButton.ID = "idBtc_" + pCodUsuario + "_" + oRow["cod_usuario_rel"].ToString(); oButton.Text = oCulture.GetResource("Usuario", "btnConfirmarSolicitudAmistad"); oButton.Attributes["sType"] = "C"; oButton.Attributes["CodUsuario"] = pCodUsuario; oButton.Attributes["CodUsuarioRel"] = oRow["cod_usuario_rel"].ToString(); oButton.Click += new EventHandler(oButton_Click); Controls.Add(oButton); Controls.Add(new LiteralControl("</div>")); Controls.Add(new LiteralControl("<div>")); oButton = new Button(); oButton.ID = "idBtd_" + pCodUsuario + "_" + oRow["cod_usuario_rel"].ToString(); oButton.Text = oCulture.GetResource("Usuario", "btnNoSolicitudAmistad"); oButton.Attributes["sType"] = "N"; oButton.Attributes["CodUsuario"] = pCodUsuario; oButton.Attributes["CodUsuarioRel"] = oRow["cod_usuario_rel"].ToString(); oButton.Click += new EventHandler(oButton_Click); Controls.Add(oButton); Controls.Add(new LiteralControl("</div>")); } } } oRows = null; } } dRelacionUsuarios = null; }
protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); string wtf = abcd; if (wtf.StartsWith("c")) { ptb.Visible = true; Post.Visible = true; DataTable dt = new DataTable(); if (wtf.StartsWith("calbum")) { int detid = int.Parse(wtf.Substring(6)); string getcomments = @"SELECT [User].Name, [User].ID, AlbumComments.ID AS CID, AlbumComments.Comment, AlbumComments.AID, AlbumComments.UID, Propic.Image, Propic.[Current] FROM [User] INNER JOIN AlbumComments ON [User].ID = AlbumComments.UID INNER JOIN Propic ON AlbumComments.UID = Propic.UID WHERE (AlbumComments.AID = " + detid + @") AND (Propic.[Current] = 1) ORDER BY CID"; dt = dbclass.ReturnDT(getcomments); } else if (wtf.StartsWith("cphoto")) { int detid = int.Parse(wtf.Substring(6)); string getcomments = @"SELECT [User].Name, [User].ID, PhotoComments.ID AS CID, PhotoComments.Comment, PhotoComments.PID, PhotoComments.UID, Propic.Image, Propic.[Current] FROM [User] INNER JOIN PhotoComments ON [User].ID = PhotoComments.UID INNER JOIN Propic ON PhotoComments.UID = Propic.UID WHERE (Propic.[Current] = 1) AND (PhotoComments.PID = " + detid + @") ORDER BY CID"; dt = dbclass.ReturnDT(getcomments); } else { int detid = int.Parse(wtf.Substring(8)); string getcomments = @"SELECT [User].Name, [User].ID, Comments.ID AS CID, Comments.Comment, Comments.ItemID, Comments.UID, Propic.Image, Propic.[Current] FROM [User] INNER JOIN Comments ON [User].ID = Comments.UID INNER JOIN Propic ON Comments.UID = Propic.UID WHERE (Comments.ItemID = " + detid + @") AND (Propic.[Current] = 1) ORDER BY CID"; dt = dbclass.ReturnDT(getcomments); } foreach (DataRow m in dt.Rows) { RadBinaryImage img = new RadBinaryImage(); img.DataValue = (byte[])m["Image"]; img.Width = 35; img.Height = 35; img.ResizeMode = BinaryImageResizeMode.Crop; img.CssClass = "magea"; Label name = new Label(); name.Text = "~" + m["Name"].ToString() + "<br>"; name.ForeColor = System.Drawing.Color.Black; Label cmnnt = new Label(); cmnnt.Text = "<b>" + m["Comment"].ToString() + "</b>"; cmnnt.ForeColor = System.Drawing.Color.Black; Table tb = new Table(); TableRow tr = new TableRow(); TableCell cell = new TableCell(); cell.Controls.Add(img); cell.VerticalAlign = System.Web.UI.WebControls.VerticalAlign.Top; tr.Cells.Add(cell); TableCell cmnt = new TableCell(); cmnt.Controls.Add(name); cmnt.Controls.Add(cmnnt); cell.VerticalAlign = System.Web.UI.WebControls.VerticalAlign.Top; tr.Cells.Add(cmnt); tb.Rows.Add(tr); emptypanel.Controls.Add(tb); } } else if (wtf.StartsWith("phewnlike")) { ptb.Visible = false; Post.Visible = false; DataTable dt2 = new DataTable(); DataTable dt3 = new DataTable(); string m = wtf.Substring(9); if (m.StartsWith("album")) { int detid = int.Parse(m.Substring(5)); string getphew = @"SELECT Propic.Image FROM PhewAlbums INNER JOIN Propic ON PhewAlbums.UID = Propic.UID WHERE (PhewAlbums.AID = " + detid + ") AND (Propic.[Current] = 1)"; string getlike = @"SELECT Propic.Image FROM LikeAlbums INNER JOIN Propic ON LikeAlbums.UID = Propic.UID WHERE (LikeAlbums.AID = " + detid + ") AND (Propic.[Current] = 1)"; dt3 = dbclass.ReturnDT(getlike); dt2 = dbclass.ReturnDT(getphew); } else if (m.StartsWith("photo")) { int detid = int.Parse(m.Substring(5)); string getphew = @"SELECT Propic.Image FROM PhewPhotos INNER JOIN Propic ON PhewPhotos.UID = Propic.UID WHERE (PhewPhotos.PID = " + detid + ") AND (Propic.[Current] = 1)"; string getlike = @"SELECT Propic.Image FROM LikePhotos INNER JOIN Propic ON LikePhotos.UID = Propic.UID WHERE (LikePhotos.PID = " + detid + ") AND (Propic.[Current] = 1)"; dt3 = dbclass.ReturnDT(getlike); dt2 = dbclass.ReturnDT(getphew); } else { int detid = int.Parse(m.Substring(7)); string getphew = @"SELECT Propic.Image FROM Phew INNER JOIN Propic ON Phew.UID = Propic.UID WHERE (Phew.NID = " + detid + ") AND (Propic.[Current] = 1)"; string getlike = @"SELECT Propic.Image FROM [Like] INNER JOIN Propic ON [Like].UID = Propic.UID WHERE ([Like].NID = " + detid + ") AND (Propic.[Current] = 1)"; dt3 = dbclass.ReturnDT(getlike); dt2 = dbclass.ReturnDT(getphew); } if (dt3.Rows.Count > 0) { Label likedby = new Label(); likedby.Text = "post is likd by :-" + "<br>"; likedby.CssClass = "alitbig"; emptypanel.Controls.Add(likedby); if (dt3.Rows.Count > 0) { foreach (DataRow a in dt3.Rows) { RadBinaryImage img = new RadBinaryImage(); img.DataValue = (byte[])a["Image"]; img.Width = 50; img.Height = 50; img.CssClass = "magea"; img.ResizeMode = BinaryImageResizeMode.Crop; //img.ID = x.ToString(); emptypanel.Controls.Add(img); } Label br = new Label(); br.Text = "<br>"; emptypanel.Controls.Add(br); } } if (dt2.Rows.Count > 0) { Label phewdby = new Label(); phewdby.Text = "post is phewd by :-" + "<br>"; phewdby.CssClass = "alitbig"; emptypanel.Controls.Add(phewdby); foreach (DataRow a in dt2.Rows) { RadBinaryImage img = new RadBinaryImage(); img.DataValue = (byte[])a["Image"]; img.Width = 50; img.Height = 50; img.CssClass = "magea"; img.ResizeMode = BinaryImageResizeMode.Crop; //img.ID = x.ToString(); emptypanel.Controls.Add(img); } } } else if (wtf.StartsWith("aalbum")) { ptb.Visible = false; Post.Visible = false; int detid = int.Parse(wtf.Substring(6)); string selectallph = @"SELECT newsfeed.AlID, newsfeed.Message, Photos.Photo FROM newsfeed INNER JOIN Photos ON newsfeed.AlID = Photos.AlbumID WHERE (Photos.AlbumID = " + detid + ")"; DataTable dt = new DataTable(); dt = dbclass.ReturnDT(selectallph); Label lbl = new Label(); lbl.Text = dt.Rows[0]["Message"].ToString() + "<br/>"; lbl.CssClass = "alitbig"; emptypanel.Controls.Add(lbl); for (int x = 0; x < dt.Rows.Count; x++) { RadBinaryImage img = new RadBinaryImage(); img.DataValue = (byte[])dt.Rows[x]["Photo"]; img.Width = 115; img.Height = 117; img.ResizeMode = BinaryImageResizeMode.Crop; img.ID = x.ToString(); emptypanel.Controls.Add(img); } //text above photo //loads albumid 117 * 117 //3 photos in one time.. } else if (wtf.StartsWith("aphoto")) { ptb.Visible = false; Post.Visible = false; int detid = int.Parse(wtf.Substring(6)); string getphotontext = @"SELECT newsfeed.Message, newsfeed.P , Photos.Photo FROM newsfeed INNER JOIN Photos ON newsfeed.P = Photos.ID WHERE (Photos.ID = " + detid + ")"; DataTable dt = new DataTable(); dt = dbclass.ReturnDT(getphotontext); Label lbl = new Label(); lbl.Text = dt.Rows[0]["Message"].ToString() + "<br/>"; RadBinaryImage img = new RadBinaryImage(); img.DataValue = (byte[])dt.Rows[0]["Photo"]; img.CssClass = "theimage"; img.ResizeMode = BinaryImageResizeMode.Fit; Random rnd = new Random(); int k = rnd.Next(); img.ID = k.ToString(); lbl.CssClass = "alitbig"; emptypanel.Controls.Add(img); img.Width = 370; img.Height = 480; //text above photo //loads photo id // loads phoos -- 350 * depends upon phptograph } else { ptb.Visible = false; Post.Visible = false; int detid = int.Parse(wtf.Substring(8)); string getnewsfeed = @"SELECT Message FROM newsfeed WHERE (ID = " + detid + ")"; DataTable dt = new DataTable(); dt = dbclass.ReturnDT(getnewsfeed); Label lbl = new Label(); lbl.Text = dt.Rows[0]["Message"].ToString() + "<br/>"; lbl.CssClass = "bigfont"; emptypanel.Controls.Add(lbl); } //this.SqlDataSource1.SelectParameters["NID"].DefaultValue = this.NID; //this.DataBind(); }
private static void HandleBinaryImageColumnsOnDataBound(RadGrid Grid, CodeTorch.Core.Grid GridConfig, GridItemEventArgs e) { if (e.Item is GridDataItem) { GridDataItem dataItem = (GridDataItem)e.Item; int gridColumnIndex = 0; foreach (CodeTorch.Core.GridColumn column in GridConfig.Columns) { if (column is BinaryImageGridColumn) { TableCell cell = null; RadBinaryImage img = null; BinaryImageGridColumn c = ((BinaryImageGridColumn)column); if (!String.IsNullOrEmpty(column.UniqueName)) { cell = dataItem[column.UniqueName]; img = (RadBinaryImage)cell.Controls[0]; } else { cell = dataItem[Grid.Columns[gridColumnIndex]]; img = (RadBinaryImage)cell.Controls[0]; } if (img != null) { if (!String.IsNullOrEmpty(c.DataNavigateUrlFields) || !String.IsNullOrEmpty(c.DataNavigateUrlFormatString)) { HyperLink link = new HyperLink(); string linkUrl = String.Empty; string urlFormatString = Common.CreateUrlWithQueryStringContext(c.DataNavigateUrlFormatString, c.Context); if (!String.IsNullOrEmpty(c.DataNavigateUrlFields)) { object[] fields = c.DataNavigateUrlFields.Split(','); object[] fieldValues = new object[fields.Length]; for (int i = 0; i < fields.Length; i++) { string fieldName = fields[i].ToString(); object value = ((DataRowView)e.Item.DataItem)[fieldName]; fieldValues[i] = value; } linkUrl = String.Format(urlFormatString, fieldValues); } link.NavigateUrl = linkUrl; link.Target = Common.CoalesceStr(link.Target, c.Target); cell.Controls.Remove(img); link.Controls.Add(img); cell.Controls.AddAt(0, link); } if (((DataRowView)e.Item.DataItem)[c.DataField] is DBNull) { string imageUrl = c.DefaultImageUrl; if (!String.IsNullOrEmpty(c.DefaultImageUrlField)) { if (String.IsNullOrEmpty(c.DefaultImageUrlFieldFormat)) { imageUrl = ((DataRowView)e.Item.DataItem)[c.DefaultImageUrlField].ToString(); if (!imageUrl.ToLower().Contains("//")) { imageUrl = "//" + imageUrl; } } else { imageUrl = String.Format(c.DefaultImageUrlFieldFormat, ((DataRowView)e.Item.DataItem)[c.DataAlternateTextField]); } } if (!String.IsNullOrEmpty(imageUrl)) { img.ImageUrl = imageUrl; } } } } gridColumnIndex++; } } }
protected void XmlHttpPanel_ServiceRequest(object sender, RadXmlHttpPanelEventArgs e) { Session["LoadingUserValue"] = e.Value; string val = e.Value; string myid = Session["UserId"].ToString(); string getstatus = @"SELECT MyID, FriendID, FriendStatus FROM Friends WHERE (MyID = " + myid + @") AND (FriendID = " + val + @") OR (MyID = " + val + @") AND (FriendID = " + myid + @")"; DataTable dt2 = new DataTable(); dt2 = profile.ReturnDT(getstatus); DataTable dt3 = new DataTable(); string getboxstat = @"SELECT MyID, SID, FollowDate, FollowStatus FROM Box WHERE (MyID = " + myid + ") AND (SID = " + val + ")"; dt3 = profile.ReturnDT(getboxstat); if (dt2.Rows.Count > 0) { int n = (int)dt2.Rows[0]["FriendStatus"]; string ida = dt2.Rows[0]["MyID"].ToString(); string idb = dt2.Rows[0]["FriendID"].ToString(); switch (n) { case 0: if (ida == Session["UserId"].ToString()) { addasfrnd.Visible = true; addasfrnd.Text = "cancel connect request"; Session["friend"] = "ccr"; // i sent the request , i can cancel it if (dt3.Rows.Count > 0) { addbox.Visible = true; addbox.Text = "remove from box"; Session["box"] = "rfb"; //added to box .. remove from box } } else { addasfrnd.Visible = true; addasfrnd.Text = "accept connect request"; Session["friend"] = "acr"; // i have the request i can accecpt it if (dt3.Rows.Count > 0) { addbox.Visible = true; addbox.Text = "remove from box"; Session["box"] = "rfb"; //added to box .. remove from box } } break; case 1: // he is a friend addasfrnd.Visible = true; addasfrnd.Text = "in your connections"; addbox.Visible = false; if (dt3.Rows.Count > 0) { addbox.Visible = true; addbox.Text = "remove from box"; Session["box"] = "rfb"; //added to box .. remove from box } break; } } else { if (dt3.Rows.Count > 0) { addbox.Visible = true; addbox.Text = "remove from box"; Session["box"] = "rfb"; //added to box .. remove from box } addasfrnd.Visible = true; addasfrnd.Text = "ask to connect"; Session["friend"] = "atc"; // he is random } string getfrndet = @"SELECT [User].ID, [User].[uname], [User].Name, [User].Country, [User].Relationship, [User].BirthDate, [User].Gender, [User].City, Propic.Image, [User].College, [User].School, [User].Company, [User].[looking for] FROM [User] INNER JOIN Propic ON [User].ID = Propic.UID WHERE ([User].ID = " + val + ") AND (Propic.[Current] = 1)"; DataTable table = new DataTable(); table = profile.ReturnDT(getfrndet); Name.Text = table.Rows[0]["Name"].ToString(); uname.Text = "<a href='profile.aspx?uname="+table.Rows[0]["uname"].ToString()+"'> @ "+ table.Rows[0]["uname"].ToString() + "</a>"; if (table.Rows[0]["Image"] is DBNull == false) { RadBinaryImage rbg = new RadBinaryImage(); rbg.ResizeMode = BinaryImageResizeMode.Crop; rbg.Height = 230; rbg.Width = 177; rbg.DataValue = (byte[])table.Rows[0]["Image"]; rbg.CssClass = "sidemeyaaar"; propic.Controls.Add(rbg); } if (table.Rows[0]["College"] is DBNull == false) { Label lbl = new Label(); Label lbl2 = new Label(); lbl.Text = "college :"; lbl2.Text = table.Rows[0]["College"].ToString(); addcontrols.Controls.Add(lbl); addcontrols.Controls.Add(lbl2); } if (table.Rows[0]["School"] is DBNull == false) { Label lbl = new Label(); Label lbl2 = new Label(); lbl.Text = "<br> school :"; lbl2.Text = table.Rows[0]["School"].ToString(); addcontrols.Controls.Add(lbl); addcontrols.Controls.Add(lbl2); } if (table.Rows[0]["Company"] is DBNull == false) { Label lbl = new Label(); Label lbl2 = new Label(); lbl.Text = "<br> works at :"; lbl2.Text = table.Rows[0]["Company"].ToString(); addcontrols.Controls.Add(lbl); addcontrols.Controls.Add(lbl2); } if (table.Rows[0]["BirthDate"] is DBNull == false) { Label lbl = new Label(); Label lbl2 = new Label(); lbl.Text = "<br> born on :"; lbl2.Text = table.Rows[0]["BirthDate"].ToString(); addcontrols.Controls.Add(lbl); addcontrols.Controls.Add(lbl2); } if (table.Rows[0]["Gender"] is DBNull == false) { Label lbl = new Label(); Label lbl2 = new Label(); lbl.Text = "<br> gender :"; lbl2.Text = table.Rows[0]["Gender"].ToString(); addcontrols.Controls.Add(lbl); addcontrols.Controls.Add(lbl2); } if (table.Rows[0]["Country"] is DBNull == false) { Label lbl = new Label(); Label lbl2 = new Label(); lbl.Text = "<br>" + "lives in :"; lbl2.Text = table.Rows[0]["City"].ToString() + table.Rows[0]["Country"].ToString(); addcontrols.Controls.Add(lbl); addcontrols.Controls.Add(lbl2); } if (table.Rows[0]["Relationship"] is DBNull == false) { Label lbl = new Label(); Label lbl2 = new Label(); lbl.Text = "<br>" + "relationship :"; lbl2.Text = table.Rows[0]["Relationship"].ToString(); addcontrols.Controls.Add(lbl); addcontrols.Controls.Add(lbl2); } if (table.Rows[0]["looking for"] is DBNull == false) { Label lbl = new Label(); Label lbl2 = new Label(); lbl.Text = "<br>" + "looking for :"; lbl2.Text = table.Rows[0]["looking for"].ToString(); addcontrols.Controls.Add(lbl); addcontrols.Controls.Add(lbl2); } }
protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); string wtf = abcd; if (wtf.StartsWith("c")) { ptb.Visible = true; Post.Visible = true; DataTable dt = new DataTable(); if (wtf.StartsWith("calbum")) { int detid = int.Parse(wtf.Substring(6)); string getcomments = @"SELECT [User].Name, [User].ID, AlbumComments.ID AS CID, AlbumComments.Comment, AlbumComments.AID, AlbumComments.UID, Propic.Image, Propic.[Current] FROM [User] INNER JOIN AlbumComments ON [User].ID = AlbumComments.UID INNER JOIN Propic ON AlbumComments.UID = Propic.UID WHERE (AlbumComments.AID = " + detid + @") AND (Propic.[Current] = 1) ORDER BY CID"; dt = dbclass.ReturnDT(getcomments); } else if (wtf.StartsWith("cphoto")) { int detid = int.Parse(wtf.Substring(6)); string getcomments = @"SELECT [User].Name, [User].ID, PhotoComments.ID AS CID, PhotoComments.Comment, PhotoComments.PID, PhotoComments.UID, Propic.Image, Propic.[Current] FROM [User] INNER JOIN PhotoComments ON [User].ID = PhotoComments.UID INNER JOIN Propic ON PhotoComments.UID = Propic.UID WHERE (Propic.[Current] = 1) AND (PhotoComments.PID = " + detid + @") ORDER BY CID"; dt = dbclass.ReturnDT(getcomments); } else { int detid = int.Parse(wtf.Substring(8)); string getcomments = @"SELECT [User].Name, [User].ID, Comments.ID AS CID, Comments.Comment, Comments.ItemID, Comments.UID, Propic.Image, Propic.[Current] FROM [User] INNER JOIN Comments ON [User].ID = Comments.UID INNER JOIN Propic ON Comments.UID = Propic.UID WHERE (Comments.ItemID = " + detid + @") AND (Propic.[Current] = 1) ORDER BY CID"; dt = dbclass.ReturnDT(getcomments); } foreach (DataRow m in dt.Rows) { RadBinaryImage img = new RadBinaryImage(); img.DataValue = (byte[])m["Image"]; img.Width =35; img.Height = 35; img.ResizeMode = BinaryImageResizeMode.Crop; img.CssClass = "magea"; Label name = new Label(); name.Text = "~" + m["Name"].ToString() + "<br>"; name.ForeColor = System.Drawing.Color.Black; Label cmnnt = new Label(); cmnnt.Text ="<b>"+ m["Comment"].ToString()+"</b>"; cmnnt.ForeColor = System.Drawing.Color.Black; Table tb = new Table(); TableRow tr = new TableRow(); TableCell cell = new TableCell(); cell.Controls.Add(img); cell.VerticalAlign = System.Web.UI.WebControls.VerticalAlign.Top; tr.Cells.Add(cell); TableCell cmnt = new TableCell(); cmnt.Controls.Add(name); cmnt.Controls.Add(cmnnt); cell.VerticalAlign = System.Web.UI.WebControls.VerticalAlign.Top; tr.Cells.Add(cmnt); tb.Rows.Add(tr); emptypanel.Controls.Add(tb); } } else if (wtf.StartsWith("phewnlike")) { ptb.Visible = false; Post.Visible = false; DataTable dt2 = new DataTable(); DataTable dt3 = new DataTable(); string m = wtf.Substring(9); if (m.StartsWith("album")) { int detid = int.Parse(m.Substring(5)); string getphew = @"SELECT Propic.Image FROM PhewAlbums INNER JOIN Propic ON PhewAlbums.UID = Propic.UID WHERE (PhewAlbums.AID = " + detid + ") AND (Propic.[Current] = 1)"; string getlike = @"SELECT Propic.Image FROM LikeAlbums INNER JOIN Propic ON LikeAlbums.UID = Propic.UID WHERE (LikeAlbums.AID = " + detid + ") AND (Propic.[Current] = 1)"; dt3 = dbclass.ReturnDT(getlike); dt2 = dbclass.ReturnDT(getphew); } else if (m.StartsWith("photo")) { int detid = int.Parse(m.Substring(5)); string getphew = @"SELECT Propic.Image FROM PhewPhotos INNER JOIN Propic ON PhewPhotos.UID = Propic.UID WHERE (PhewPhotos.PID = " + detid + ") AND (Propic.[Current] = 1)"; string getlike = @"SELECT Propic.Image FROM LikePhotos INNER JOIN Propic ON LikePhotos.UID = Propic.UID WHERE (LikePhotos.PID = " + detid + ") AND (Propic.[Current] = 1)"; dt3 = dbclass.ReturnDT(getlike); dt2 = dbclass.ReturnDT(getphew); } else { int detid = int.Parse(m.Substring(7)); string getphew = @"SELECT Propic.Image FROM Phew INNER JOIN Propic ON Phew.UID = Propic.UID WHERE (Phew.NID = " + detid + ") AND (Propic.[Current] = 1)"; string getlike = @"SELECT Propic.Image FROM [Like] INNER JOIN Propic ON [Like].UID = Propic.UID WHERE ([Like].NID = " + detid + ") AND (Propic.[Current] = 1)"; dt3 = dbclass.ReturnDT(getlike); dt2 = dbclass.ReturnDT(getphew); } if (dt3.Rows.Count > 0) { Label likedby = new Label(); likedby.Text = "post is likd by :-" + "<br>"; likedby.CssClass = "alitbig"; emptypanel.Controls.Add(likedby); if (dt3.Rows.Count > 0) { foreach (DataRow a in dt3.Rows) { RadBinaryImage img = new RadBinaryImage(); img.DataValue = (byte[])a["Image"]; img.Width = 50; img.Height = 50; img.CssClass = "magea"; img.ResizeMode = BinaryImageResizeMode.Crop; //img.ID = x.ToString(); emptypanel.Controls.Add(img); } Label br = new Label(); br.Text = "<br>"; emptypanel.Controls.Add(br); } } if (dt2.Rows.Count > 0) { Label phewdby = new Label(); phewdby.Text = "post is phewd by :-" + "<br>"; phewdby.CssClass = "alitbig"; emptypanel.Controls.Add(phewdby); foreach (DataRow a in dt2.Rows) { RadBinaryImage img = new RadBinaryImage(); img.DataValue = (byte[])a["Image"]; img.Width = 50; img.Height =50; img.CssClass = "magea"; img.ResizeMode = BinaryImageResizeMode.Crop; //img.ID = x.ToString(); emptypanel.Controls.Add(img); } } } else if (wtf.StartsWith("aalbum")) { ptb.Visible = false; Post.Visible = false; int detid = int.Parse(wtf.Substring(6)); string selectallph = @"SELECT newsfeed.AlID, newsfeed.Message, Photos.Photo FROM newsfeed INNER JOIN Photos ON newsfeed.AlID = Photos.AlbumID WHERE (Photos.AlbumID = " + detid + ")"; DataTable dt = new DataTable(); dt = dbclass.ReturnDT(selectallph); Label lbl = new Label(); lbl.Text = dt.Rows[0]["Message"].ToString() + "<br/>"; lbl.CssClass = "alitbig"; emptypanel.Controls.Add(lbl); for (int x = 0; x < dt.Rows.Count; x++) { RadBinaryImage img = new RadBinaryImage(); img.DataValue = (byte[])dt.Rows[x]["Photo"]; img.Width = 115; img.Height = 117; img.ResizeMode = BinaryImageResizeMode.Crop; img.ID = x.ToString(); emptypanel.Controls.Add(img); } //text above photo //loads albumid 117 * 117 //3 photos in one time.. } else if (wtf.StartsWith("aphoto")) { ptb.Visible = false; Post.Visible = false; int detid = int.Parse(wtf.Substring(6)); string getphotontext = @"SELECT newsfeed.Message, newsfeed.P , Photos.Photo FROM newsfeed INNER JOIN Photos ON newsfeed.P = Photos.ID WHERE (Photos.ID = " + detid + ")"; DataTable dt = new DataTable(); dt = dbclass.ReturnDT(getphotontext); Label lbl = new Label(); lbl.Text = dt.Rows[0]["Message"].ToString() + "<br/>"; RadBinaryImage img = new RadBinaryImage(); img.DataValue = (byte[])dt.Rows[0]["Photo"]; img.CssClass = "theimage"; img.ResizeMode = BinaryImageResizeMode.Fit; Random rnd = new Random(); int k = rnd.Next(); img.ID = k.ToString(); lbl.CssClass = "alitbig"; emptypanel.Controls.Add(img); img.Width = 370; img.Height = 480; //text above photo //loads photo id // loads phoos -- 350 * depends upon phptograph } else { ptb.Visible = false; Post.Visible = false; int detid = int.Parse(wtf.Substring(8)); string getnewsfeed = @"SELECT Message FROM newsfeed WHERE (ID = " + detid + ")"; DataTable dt = new DataTable(); dt = dbclass.ReturnDT(getnewsfeed); Label lbl = new Label(); lbl.Text = dt.Rows[0]["Message"].ToString() + "<br/>"; lbl.CssClass = "bigfont"; emptypanel.Controls.Add(lbl); } //this.SqlDataSource1.SelectParameters["NID"].DefaultValue = this.NID; //this.DataBind(); }
protected void rdGaleryCntrl_ItemDataBound(object sender, RadListViewItemEventArgs e) { blnOfertaExit = false; string sNombre = string.Empty; if (e.Item is RadListViewDataItem) { if (sType == "USR") { //LinkButton oLinkButton = e.Item.FindControl("idLnkButton") as LinkButton; //oLinkButton.OnClientClick = string.Format("ViewProfile({0}); return false;", ((e.Item as RadListViewDataItem).DataItem as DataRowView)["cod_usuario"].ToString()); HyperLink oHyperLink = e.Item.FindControl("idLnkButton") as HyperLink; oHyperLink.NavigateUrl = string.Format("../Escort.aspx?CodUsuario={0}", ((e.Item as RadListViewDataItem).DataItem as DataRowView)["cod_usuario"].ToString()); if (sIdControls.Length == 0) { sIdControls.Append(oHyperLink.ClientID); } else { sIdControls.Append(",").Append(oHyperLink.ClientID); } //oHyperLink.NavigateUrl = "http://localhost/ISBAN/fancybox/thickbox/boletines.html"; sNombre = ((e.Item as RadListViewDataItem).DataItem as DataRowView)["nom_usuario"].ToString() + " " + ((e.Item as RadListViewDataItem).DataItem as DataRowView)["ape_usuario"].ToString(); RadBinaryImage oImge = e.Item.FindControl("idImgUser") as RadBinaryImage; oImge.AlternateText = "Escort " + sNombre.Trim() + ", Escorts en Chile - Santiago"; //Esta debe quedar oImge.ImageUrl = oWeb.getImageProfileUser(((e.Item as RadListViewDataItem).DataItem as DataRowView)["cod_usuario"].ToString(), sRuta); //oImge.Height = 150; //oImge.DataValue = oWeb.getImageProfileUser(((e.Item as RadListViewDataItem).DataItem as DataRowView)["cod_usuario"].ToString(), 150, 150); Label oLabel = e.Item.FindControl("idLblNomUser") as Label; oLabel.Text = sNombre; HtmlGenericControl oMdlDataUser = e.Item.FindControl("mdlDataUser") as HtmlGenericControl; DataTable dCampoUsuario = oWeb.DeserializarTbl((!string.IsNullOrEmpty(sRuta) ? Server.MapPath(".").ToUpper().Replace(sRuta.ToUpper(), "") : Server.MapPath(".")), "CampoUsuarios.bin"); if (dCampoUsuario != null) { if (dCampoUsuario.Rows.Count > 0) { DataRow[] oRows = dCampoUsuario.Select(" ind_despliegue_portal = 'V' ", " ord_campo "); if (oRows != null) { if (oRows.Count() > 0) { foreach (DataRow oRow in oRows) { DataTable dInfUsuario = oWeb.DeserializarTbl((!string.IsNullOrEmpty(sRuta) ? Server.MapPath(".").ToUpper().Replace(sRuta.ToUpper(), "") : Server.MapPath(".")), "InfoUsuario_" + ((e.Item as RadListViewDataItem).DataItem as DataRowView)["cod_usuario"].ToString() + ".bin"); if (dInfUsuario != null) { if (dInfUsuario.Rows.Count > 0) { DataRow[] oRowsInf = dInfUsuario.Select("cod_campo = " + oRow["cod_campo"].ToString()); if (oRowsInf != null) { if (oRowsInf.Count() > 0) { //oLabel = new Label(); //oLabel.Text = oRow["nom_campo"].ToString(); //oMdlDataUser.Controls.Add(oLabel); if (!string.IsNullOrEmpty(oRowsInf[0]["val_campo"].ToString())) { if ((oRowsInf[0]["cod_campo"].ToString() == "20140815025804") && (!blnOfertaExit)) { oMdlDataUser.Controls.Add(new LiteralControl("<p class=\"dat20140815025745\" class=\"tTipMsgMoney\">")); } else { if (oRowsInf[0]["cod_campo"].ToString() == "20140815025745") { blnOfertaExit = true; } oMdlDataUser.Controls.Add(new LiteralControl("<p class=\"dat" + oRowsInf[0]["cod_campo"].ToString() + "\">")); } oLabel = new Label(); switch (oRow["tipo_campo"].ToString().Trim()) { case "5": oNumInfo.CurrencyDecimalDigits = 0; int iValCampo = int.Parse(oRowsInf[0]["val_campo"].ToString()); if (oRowsInf[0]["cod_campo"].ToString() == "20140815025804") { oLabel.Text = (blnOfertaExit ? "Normal " : "") + iValCampo.ToString("C", oNumInfo); } else { oLabel.Text = iValCampo.ToString("C", oNumInfo); } break; default: oLabel.Text = oRowsInf[0]["val_campo"].ToString(); break; } oMdlDataUser.Controls.Add(oLabel); oMdlDataUser.Controls.Add(new LiteralControl("</p>")); } else if ((oRowsInf[0]["cod_campo"].ToString() == "20140815025804") && (!blnOfertaExit)) { oMdlDataUser.Controls.Add(new LiteralControl("<p class=\"dat20140815025745\">")); oLabel = new Label(); oLabel.Text = "$ Consultar"; oMdlDataUser.Controls.Add(oLabel); oMdlDataUser.Controls.Add(new LiteralControl("</p>")); } } } oRowsInf = null; } dInfUsuario = null; } } } } oRows = null; } } dCampoUsuario = null; } } }
protected void Page_Load(object sender, EventArgs e) { string id = Request.QueryString["id"].ToString(); string myd = Session["UserId"].ToString(); string checkboxreq = @"SELECT MyID, SID, FollowDate, FollowStatus, ID FROM Box WHERE (MyID = " + myd + ") AND (SID = " + id + ")"; DataTable chboc = new DataTable(); chboc = profile.ReturnDT(checkboxreq); if (chboc.Rows.Count != 0) { RadButton addbox = (RadButton)RadPanelBar1.FindItemByValue("buttons").FindControl("addbox"); addbox.Text = "Remove From Box"; addbox.CommandName = "rfb"; } string asked2connect = @"SELECT * FROM Friends WHERE (MyID = " + Session["UserId"] + ") AND (FriendID = " + id + ") AND (FriendStatus = 0) "; DataTable dt3 = new DataTable(); dt3 = profile.ReturnDT(asked2connect); if (dt3.Rows.Count > 0) { RadButton editprofile = (RadButton)RadPanelBar1.FindItemByValue("buttons").FindControl("friendreq"); editprofile.CommandName = "rempen"; editprofile.Text = "Cancel Pending Connect Req?"; } string chkfriendRequest = @"SELECT * FROM Friends WHERE (MyId=" + id + " and FriendId=" + Session["UserId"].ToString() + ")"; DataTable dt1 = new DataTable(); dt1 = profile.ReturnDT(chkfriendRequest); if (dt1.Rows.Count > 0) { if (id == Session["UserId"].ToString()) { RadPanelBar1.FindItemByValue("connect").Text = "Personalize Profile"; RadButton editprofile = (RadButton)RadPanelBar1.FindItemByValue("buttons").FindControl("friendreq"); editprofile.Text = "Edit Your Profile"; editprofile.CommandName = "ep"; RadButton addbox = (RadButton)RadPanelBar1.FindItemByValue("buttons").FindControl("addbox"); addbox.Text = "Change Profile Picture"; addbox.CommandName = "cpp"; RadButton message = (RadButton)RadPanelBar1.FindItemByValue("buttons").FindControl("message"); message.Text = "Privacy Settings"; message.CommandName = "pst"; } else if (dt1.Rows[0]["FriendStatus"].ToString() == "1") { RadButton editprofile = (RadButton)RadPanelBar1.FindItemByValue("buttons").FindControl("friendreq"); editprofile.Text = "Remove Connection"; editprofile.CommandName = "unfriend"; RadButton addbox = (RadButton)RadPanelBar1.FindItemByValue("buttons").FindControl("addbox"); addbox.Visible = false; RadButton message = (RadButton)RadPanelBar1.FindItemByValue("buttons").FindControl("message"); message.Text = "Message"; message.CommandName = "ms"; } else if (dt1.Rows[0]["FriendStatus"].ToString() == "0") { RadButton editprofile = (RadButton)RadPanelBar1.FindItemByValue("buttons").FindControl("friendreq"); editprofile.Text = "Accept Connection"; editprofile.CommandName = "befriend"; RadButton addbox = (RadButton)RadPanelBar1.FindItemByValue("buttons").FindControl("addbox"); RadButton message = (RadButton)RadPanelBar1.FindItemByValue("buttons").FindControl("message"); message.Text = "Message"; message.CommandName = "ms"; } } DataSet udet = new DataSet(); string urprofile = @"SELECT Name,City, ID, Country, College, School, Company, Gender, Degree, uname, Designation, BirthDate FROM [User] WHERE (ID =" + id + ")"; udet = profile.ReturnDS(urprofile); Label name = (Label)RadPanelBar1.FindItemByValue("bi").FindControl("nm"); Label dob = (Label)RadPanelBar1.FindItemByValue("bi").FindControl("dob"); Label gen = (Label)RadPanelBar1.FindItemByValue("bi").FindControl("gen"); Label born = (Label)RadPanelBar1.FindItemByValue("bi").FindControl("born"); name.Text = udet.Tables[0].Rows[0]["Name"].ToString(); dob.Text = udet.Tables[0].Rows[0]["BirthDate"].ToString(); gen.Text = udet.Tables[0].Rows[0]["Gender"].ToString(); born.Text = udet.Tables[0].Rows[0]["City"].ToString(); //Education And Work ... if (udet.Tables[0].Rows[0]["College"] is DBNull && udet.Tables[0].Rows[0]["School"] is DBNull && udet.Tables[0].Rows[0]["Designation"] is DBNull && udet.Tables[0].Rows[0]["Company"] is DBNull && udet.Tables[0].Rows[0]["Degree"] is DBNull) { eduwork.Visible = false; RadTabStrip1.FindTabByText("Education and Work").Visible = false; } else { if (udet.Tables[0].Rows[0]["School"] is DBNull) { school.Text = ": Not disclosed by user"; } else { school.Text = ": " + udet.Tables[0].Rows[0]["School"].ToString(); } if (udet.Tables[0].Rows[0]["College"] is DBNull) { collegea.Text = ": Not disclosed by user"; } else { collegea.Text = ": " + udet.Tables[0].Rows[0]["College"].ToString(); } if (udet.Tables[0].Rows[0]["Degree"] is DBNull) { degree.Text = ": Not disclosed by user"; } else { degree.Text = ": " + udet.Tables[0].Rows[0]["Degree"].ToString(); } if (udet.Tables[0].Rows[0]["Company"] is DBNull) { company.Text = ": Not disclosed by user"; } else { company.Text = ": " + udet.Tables[0].Rows[0]["Company"].ToString(); } if (udet.Tables[0].Rows[0]["Designation"] is DBNull) { college.Text = ": Not disclosed by user"; } else { college.Text = ": " + udet.Tables[0].Rows[0]["Designation"].ToString(); } } DataSet profilepic = new DataSet(); string propicsql = @"SELECT Image FROM Propic WHERE (UID = " + id + ") AND ([Current] = 1)"; profilepic = profile.ReturnDS(propicsql); RadBinaryImage prop = (RadBinaryImage)RadPanelBar1.FindItemByValue("bi").FindControl("profilepicture"); if (profilepic.Tables[0].Rows[0]["Image"] is DBNull == false) { prop.DataValue = (byte[])profilepic.Tables[0].Rows[0]["Image"]; } else { prop.Visible = false; } DataSet mimage = new DataSet(); string mimagesql = @"SELECT Image, Desciption FROM Mimage WHERE (UID = " + id + ")"; mimage = profile.ReturnDS(mimagesql); if (mimage.Tables[0].Rows[0]["Image"] is DBNull) { mimageandpic.Visible = false; RadTabStrip1.FindTabByText("Mimage").Visible = false; } else { mmimage.DataValue = (byte[])mimage.Tables[0].Rows[0]["Image"]; } string getallbumsofuser = @"SELECT Name, UID, ID FROM Albums WHERE (UID = " + id + ")"; /* * string getalbums = @"SELECT TOP (1) Albums.Name, Albums.UID, Albums.ID, Photos.Photo * FROM Albums INNER JOIN * Photos ON Albums.ID = Photos.AlbumID * WHERE (Albums.UID = " +id+")"; * DataSet displaypics = new DataSet(); * displaypics = profile.ReturnDS(getalbums); * * RadBinaryImage A01 = new RadBinaryImage(); * A01.DataValue = (byte[])displaypics.Tables[0].Rows[0]["Photo"]; * A01.Width = 150; * A01.Height = 150; * A01.ResizeMode = BinaryImageResizeMode.Fit; * photos.Controls.Add(A01); */ /* DataTable evntsofmylife = new DataTable(); * string evntoflifesql = @"SELECT ID, EventName, Description, UID, Image * FROM Events * WHERE (UID = "+id+")"; * evntsofmylife = profile.ReturnDT(evntoflifesql); * if (evntsofmylife.Rows.Count > 0) * { * Repeater1.DataSource = evntsofmylife; * Repeater1.DataBind(); * * } * else * { * eventlife.Visible = false; * RadTabStrip1.FindTabByText("Events in Life").Visible = false; * } */ DataSet philo = new DataSet(); string philosql = @"SELECT Religion, Life, Political, Quote FROM Political WHERE (UID = " + id + ")"; philo = profile.ReturnDS(philosql); if (philo.Tables[0].Rows[0]["Religion"] is DBNull && philo.Tables[0].Rows[0]["Life"] is DBNull && philo.Tables[0].Rows[0]["Quote"] is DBNull && philo.Tables[0].Rows[0]["Political"] is DBNull) { philosophy.Visible = false; RadTabStrip1.FindTabByText("Philosophy").Visible = false; } else { if (philo.Tables[0].Rows[0]["Religion"] is DBNull) { rel.Text = ": Not disclosed by user"; } else { rel.Text = ": " + philo.Tables[0].Rows[0]["Religion"].ToString(); } if (philo.Tables[0].Rows[0]["Life"] is DBNull) { life.Text = ": Not disclosed by user"; } else { life.Text = ": " + philo.Tables[0].Rows[0]["Life"].ToString(); } if (philo.Tables[0].Rows[0]["Quote"] is DBNull) { qute.Text = ": Not disclosed by user"; } else { qute.Text = ": " + philo.Tables[0].Rows[0]["Quote"].ToString(); } if (philo.Tables[0].Rows[0]["Political"] is DBNull) { politics.Text = ": Not disclosed by user"; } else { politics.Text = ": " + philo.Tables[0].Rows[0]["Political"].ToString(); } } DataSet eement = new DataSet(); string ementsql = @"SELECT Movies, Sports, Television, Music, Books FROM Ement WHERE (UID = " + id + ")"; eement = profile.ReturnDS(ementsql); if (eement.Tables[0].Rows[0]["Sports"] is DBNull && eement.Tables[0].Rows[0]["Television"] is DBNull && eement.Tables[0].Rows[0]["Music"] is DBNull && eement.Tables[0].Rows[0]["Books"] is DBNull) { ement.Visible = false; RadTabStrip1.FindTabByText("Entertainment and Intrests").Visible = false; } else { if (eement.Tables[0].Rows[0]["Movies"] is DBNull) { movies.Text = ": Not disclosed by user"; } else { movies.Text = ": " + eement.Tables[0].Rows[0]["Movies"].ToString(); } if (eement.Tables[0].Rows[0]["Books"] is DBNull) { books.Text = ": Not disclosed by user"; } else { books.Text = ": " + eement.Tables[0].Rows[0]["Books"].ToString(); } if (eement.Tables[0].Rows[0]["Music"] is DBNull) { music.Text = ": Not disclosed by user"; } else { music.Text = ": " + eement.Tables[0].Rows[0]["Music"].ToString(); } if (eement.Tables[0].Rows[0]["Television"] is DBNull) { tel.Text = ": Not disclosed by user"; } else { tel.Text = ": " + eement.Tables[0].Rows[0]["Television"].ToString(); } if (eement.Tables[0].Rows[0]["Sports"] is DBNull) { sports.Text = ": Not disclosed by user"; } else { sports.Text = ": " + eement.Tables[0].Rows[0]["Sports"].ToString(); } } DataSet achievve = new DataSet(); string achievesql = @"SELECT Achievement FROM Achieve WHERE (UID = " + id + ")"; achievve = profile.ReturnDS(achievesql); if (achievve.Tables[0].Rows[0]["Achievement"] is DBNull) { achieve.Visible = false; RadTabStrip1.FindTabByText("Achievements").Visible = false; } else { achievements.Text = achievve.Tables[0].Rows[0]["Achievement"].ToString(); } DataSet coninfo = new DataSet(); string coninfosql = @"SELECT Website, Phone, Email, Address FROM Contact WHERE (UID = " + id + ")"; coninfo = profile.ReturnDS(coninfosql); if (coninfo.Tables[0].Rows[0]["Website"] is DBNull && coninfo.Tables[0].Rows[0]["Phone"] is DBNull && coninfo.Tables[0].Rows[0]["Email"] is DBNull && coninfo.Tables[0].Rows[0]["Address"] is DBNull) { contactme.Visible = false; RadTabStrip1.FindTabByText("Contact Information").Visible = false; } else { if (coninfo.Tables[0].Rows[0]["Website"] is DBNull) { web.Text = ": Not disclosed by user"; } else { web.Text = ": <a class='someclasslink' href='" + coninfo.Tables[0].Rows[0]["Website"].ToString() + "' target='_blank'>" + coninfo.Tables[0].Rows[0]["Website"].ToString() + "</a>"; } if (coninfo.Tables[0].Rows[0]["Phone"] is DBNull) { phone.Text = ": Not disclosed by user"; } else { phone.Text = ": " + coninfo.Tables[0].Rows[0]["Phone"].ToString(); } if (coninfo.Tables[0].Rows[0]["Address"] is DBNull) { add.Text = ": Not disclosed by user"; } else { add.Text = ": " + coninfo.Tables[0].Rows[0]["Address"].ToString(); } if (coninfo.Tables[0].Rows[0]["Email"] is DBNull) { email.Text = ": Not disclosed by user"; } else { email.Text = ": <a class='someclasslink' href='mailto:" + coninfo.Tables[0].Rows[0]["Email"].ToString() + "'>" + coninfo.Tables[0].Rows[0]["Email"].ToString() + "</a>"; } } }
protected void QRCodeOlustur() { RadBarcode barcode = new RadBarcode(); //barcode.Text = "some text"; barcode.Text = ""; barcode.Type = BarcodeType.QRCode; barcode.LineWidth = 2; RadBinaryImage image = new RadBinaryImage(); //PlaceHolder1.Controls.Add(image); System.IO.MemoryStream stream = new System.IO.MemoryStream(); barcode.GetImage().Save(stream, System.Drawing.Imaging.ImageFormat.Png); image.DataValue = stream.ToArray(); System.Drawing.Image img=barcode.GetImage(); string qrCodeImageFile = Guid.NewGuid().ToString(); img.Save(Server.MapPath("~/DosyaSistemi/QRCode/"+qrCodeImageFile+".png"), System.Drawing.Imaging.ImageFormat.Png); //FileStream file =new FileStream(Server.MapPath("~/DosyaSistemi/Oneri.docx")) }
protected void getFollow() { Controls.Add(new LiteralControl("<div id=\"zonafollow\">")); StringBuilder sFile = new StringBuilder(); sFile.Append("SeguirUsuariosF_").Append(oIsUsuario.CodUsuario).Append(".bin"); DataTable dSeguirFUsuarios = oWeb.DeserializarTbl(Server.MapPath(".").ToString(), sFile.ToString()); SysUsuario oUsuario; BinaryUsuario dUsuario; if (dSeguirFUsuarios != null) { foreach (DataRow oRow in dSeguirFUsuarios.Rows) { oUsuario = new SysUsuario(); oUsuario.Path = Server.MapPath("."); oUsuario.CodUsuario = oRow["cod_seg_usuario"].ToString(); dUsuario = oUsuario.ClassGet(); if (dUsuario.EstUsuario == "V") { Controls.Add(new LiteralControl("<div class=\"bfollow\">")); Controls.Add(new LiteralControl("<div class=\"bImgUsrFollow\">")); RadBinaryImage oImage = new RadBinaryImage(); oImage.CssClass = "cTwittImg"; oImage.DataValue = oWeb.getImageProfileUser(oRow["cod_seg_usuario"].ToString(), 300, 300); oImage.Width = Unit.Pixel(52); oImage.AutoAdjustImageControlSize = false; LinkButton oLinkButton = new LinkButton(); //oLinkButton.Height = Unit.Pixel(52); oLinkButton.Width = Unit.Pixel(52); oLinkButton.Attributes["CodUsuario"] = oRow["cod_seg_usuario"].ToString(); oLinkButton.CssClass = "cTwittImgUserFollowMe"; oLinkButton.Click += new EventHandler(oLinkButton_Click); oLinkButton.Controls.Add(oImage); Controls.Add(oLinkButton); Controls.Add(new LiteralControl("</div>")); Controls.Add(new LiteralControl("<div>")); LinkButton oLnkButton = new LinkButton(); oLnkButton.Text = oRow["usuario_follow"].ToString(); oLnkButton.Attributes["CodUsuario"] = oRow["cod_seg_usuario"].ToString(); oLnkButton.CssClass = "bNamefollow"; oLnkButton.Click += new EventHandler(oLinkButton_Click); Controls.Add(oLnkButton); //Controls.Add(new LiteralControl(oRow["usuario_follow"].ToString())); Controls.Add(new LiteralControl("</div>")); Controls.Add(new LiteralControl("<div class=\"bBtnfollow\">")); Controls.Add(new LiteralControl("<div class=\"zonaUnfollow\">")); Button oButton = new Button(); oButton.ID = "idGetBtnUnFollow_" + oIsUsuario.CodUsuario + "_" + oRow["cod_seg_usuario"].ToString(); oButton.Text = oCulture.GetResource("Usuario", "BtnFollowing"); oButton.Attributes["CodUsuario"] = oIsUsuario.CodUsuario; oButton.Attributes["CodSegUsuario"] = oRow["cod_seg_usuario"].ToString(); oButton.CssClass = "cGetBtnFollow"; oButton.Click += new EventHandler(oButton_UnFullow); Controls.Add(oButton); oButton.Attributes["onmouseover"] = "document.getElementById('" + oButton.ClientID + "').value='" + oCulture.GetResource("Usuario", "BtnUnFollow") + "'"; oButton.Attributes["onmouseout"] = "document.getElementById('" + oButton.ClientID + "').value='" + oCulture.GetResource("Usuario", "BtnFollowing") + "'"; Controls.Add(new LiteralControl("</div>")); Controls.Add(new LiteralControl("</div>")); Controls.Add(new LiteralControl("<div class=\"bDescfollow\">")); DataTable dCampoUsuarios = oWeb.DeserializarTbl(Server.MapPath(".").ToString(), "CampoUsuarios.bin"); if (dCampoUsuarios != null) { if (dCampoUsuarios.Rows.Count > 0) { DataRow[] cRow = dCampoUsuarios.Select(" tipo_campo = 2 and desp_campo = 'O' and ind_despliegue = 'V' "); if (cRow != null) { if (cRow.Count() > 0) { DataTable dInfoUsuarios = oWeb.DeserializarTbl(Server.MapPath(".").ToString(), "InfoUsuario_" + oRow["cod_seg_usuario"].ToString() + ".bin"); if (dInfoUsuarios != null) { if (dInfoUsuarios.Rows.Count > 0) { DataRow[] iRow = dInfoUsuarios.Select(" cod_campo = " + cRow[0]["cod_campo"].ToString()); if (iRow != null) { if (iRow.Count() > 0) { Controls.Add(new LiteralControl(iRow[0]["val_campo"].ToString())); } } iRow = null; } } dInfoUsuarios = null; } } cRow = null; } } dCampoUsuarios = null; Controls.Add(new LiteralControl("</div>")); Controls.Add(new LiteralControl("</div>")); } dUsuario = null; } } dSeguirFUsuarios = null; Controls.Add(new LiteralControl("</div>")); }
protected void QRCodeOlustur() { EFDal ed = new EFDal(); string BaseUrl = ConfigurationManager.AppSettings["BaseUrl"].ToString(); //Burada daha önce bu IstId için bir kapak oluşturulmuş mu ona bakmak gerekli.. string DahaOnceVerilmisDosyaAdi = ed.KapakSayfasiDosyaAdiniDon(Convert.ToInt32(Request["IstId"].ToString())); Guid KapakDosyaAdi = Guid.Empty; if (DahaOnceVerilmisDosyaAdi != string.Empty) { KapakDosyaAdi = Guid.Parse(DahaOnceVerilmisDosyaAdi.Replace(".pdf","")); } else { KapakDosyaAdi = Guid.NewGuid(); } Session["SertifikaDosyaAdi"] = KapakDosyaAdi; try { string qrCodeImageFile = Guid.NewGuid().ToString(); //string qrCodeImagePath = Server.MapPath("~/DosyaSistemi/QRCode/" + qrCodeImageFile + ".png"); RadBarcode barcode = new RadBarcode(); //barcode.Text = "some text"; barcode.Text = BaseUrl + "DosyaSistemi/" + ed.kal_BolgeKoduDon(Context.User.Identity.Name).ToString() + "/" + DateTime.Now.Year.ToString() + "/" + KapakDosyaAdi.ToString() + ".pdf"; barcode.Type = BarcodeType.QRCode; Session["qrCodeURL"] = barcode.Text; barcode.LineWidth = 2; RadBinaryImage image = new RadBinaryImage(); System.IO.MemoryStream stream = new System.IO.MemoryStream(); // kaldırılabilir?-> barcode.GetImage().Save(stream, System.Drawing.Imaging.ImageFormat.Png); image.DataValue = stream.ToArray(); ed.InsertqrCodeImage(Convert.ToInt32(Request["IstId"].ToString()), image.DataValue); //System.Drawing.Image img = barcode.GetImage(); //img.Save(qrCodeImagePath, System.Drawing.Imaging.ImageFormat.Png); //return qrCodeImagePath; } catch (Exception e) { //return string.Empty; } }
protected void getFollowMe() { Controls.Add(new LiteralControl("<div id=\"zonafollowme\">")); StringBuilder sFile = new StringBuilder(); sFile.Append("SeguirUsuariosM_").Append(oIsUsuario.CodUsuario).Append(".bin"); DataTable dSeguirMUsuarios = oWeb.DeserializarTbl(Server.MapPath(".").ToString(), sFile.ToString()); if (dSeguirMUsuarios != null) { foreach (DataRow oRow in dSeguirMUsuarios.Rows) { Controls.Add(new LiteralControl("<div class=\"bfollowme\">")); Controls.Add(new LiteralControl("<div class=\"bImgUsrFollowme\">")); RadBinaryImage oImage = new RadBinaryImage(); oImage.CssClass = "cTwittImg"; oImage.DataValue = oWeb.getImageProfileUser(oRow["cod_usuario"].ToString(), 62, 62); LinkButton oLinkButton = new LinkButton(); oLinkButton.Height = Unit.Pixel(62); oLinkButton.Attributes["CodUsuario"] = oRow["cod_usuario"].ToString(); oLinkButton.Width = Unit.Pixel(62); oLinkButton.CssClass = "cTwittImgUserFollowMe"; oLinkButton.Click += new EventHandler(oLinkButton_Click); oLinkButton.Controls.Add(oImage); Controls.Add(oLinkButton); Controls.Add(new LiteralControl("</div>")); Controls.Add(new LiteralControl("<div>")); LinkButton oLnkButton = new LinkButton(); oLnkButton.Text = oRow["usuario_followme"].ToString(); oLnkButton.Attributes["CodUsuario"] = oRow["cod_usuario"].ToString(); oLnkButton.CssClass = "bNamefollowme"; oLnkButton.Click += new EventHandler(oLinkButton_Click); Controls.Add(oLnkButton); //Controls.Add(new LiteralControl(oRow["usuario_followme"].ToString())); Controls.Add(new LiteralControl("</div>")); Controls.Add(new LiteralControl("<div class=\"bBtnfollowme\">")); Controls.Add(new LiteralControl("<div class=\"zonaUnfollowme\">")); //Button oButton = new Button(); //oButton.ID = "idGetBtnUnFollow_" + oIsUsuario.CodUsuario + "_" + oRow["cod_usuario"].ToString(); //oButton.Text = oCulture.GetResource("Usuario", "BtnFollowing"); //oButton.Attributes["CodUsuario"] = oRow["cod_usuario"].ToString(); //oButton.Attributes["CodSegUsuario"] = oIsUsuario.CodUsuario; //oButton.CssClass = "cPutBtnFollow"; //oButton.Click += new EventHandler(oButton_UnFullow); //Controls.Add(oButton); Controls.Add(new LiteralControl("</div>")); Controls.Add(new LiteralControl("</div>")); Controls.Add(new LiteralControl("<div class=\"bDescfollow\">")); DataTable dCampoUsuarios = oWeb.DeserializarTbl(Server.MapPath(".").ToString(), "CampoUsuarios.bin"); if (dCampoUsuarios != null) { if (dCampoUsuarios.Rows.Count > 0) { DataRow[] cRow = dCampoUsuarios.Select(" tipo_campo = 2 and desp_campo = 'O' and ind_despliegue = 'V' "); if (cRow != null) { if (cRow.Count() > 0) { DataTable dInfoUsuarios = oWeb.DeserializarTbl(Server.MapPath(".").ToString(), "InfoUsuario_" + oRow["cod_usuario"].ToString() + ".bin"); if (dInfoUsuarios != null) { if (dInfoUsuarios.Rows.Count > 0) { DataRow[] iRow = dInfoUsuarios.Select(" cod_campo = " + cRow[0]["cod_campo"].ToString()); if (iRow != null) { if (iRow.Count() > 0) { Controls.Add(new LiteralControl(iRow[0]["val_campo"].ToString())); } } iRow = null; } } dInfoUsuarios = null; } } cRow = null; } } dCampoUsuarios = null; Controls.Add(new LiteralControl("</div>")); Controls.Add(new LiteralControl("</div>")); } } dSeguirMUsuarios = null; Controls.Add(new LiteralControl("</div>")); }