void GetIdentity() { List <rapidInfoModel.Identity> list = rapidInfoModel.Identity.GetData(); foreach (rapidInfoModel.Identity a in list) { List <rapidInfoModel.AreaLink> Areas = rapidInfoModel.AreaLink.GetData(Cmn.ToInt(a.Id)); sb.Append(a.Id + "^" + a.Name + "^"); if (Areas.Count != 0) { foreach (rapidInfoModel.AreaLink al in Areas) { rapidInfoModel.Area area = rapidInfoModel.Area.GetData(al.AreaId); sb.Append("<div class='alert alert-warning alert-dismissible' style='display:inline-block;padding:6px;padding-right:25px;' role='alert'>" + "<button type='button' class='close' data-dismiss='alert' onclick='UnlinkAreas(" + al.AreaId + "," + a.Id + ")' aria-label='Close'><span aria-hidden='true'>×</span></button><strong>" + area.Name + "</strong></div> "); } } sb.Append("^"); sb.Append("~"); } }
protected void Unnamed1_Click(object sender, EventArgs e) { rapidInfoModel.Area a = rapidInfoModel.Area.GetData(Cmn.ToInt(lblId.Text)); if (a == null) { a = new rapidInfoModel.Area(); } a.Name = txtName.Text; a.ParentId = Cmn.ToInt(txtParentId.Value); a.Save(); WriteClientScript("parent.GetAreas();"); }
void ShowData(int id) { rapidInfoModel.Area a = rapidInfoModel.Area.GetData(id); if (a != null) { lblId.Text = a.Id.ToString(); txtName.Text = a.Name; if (a.ParentId != null && a.ParentId != 0) { txtParentId.Value = a.ParentId.ToString(); rapidInfoModel.Area parent = rapidInfoModel.Area.GetData(Cmn.ToInt(a.ParentId)); txtParentName.Text = parent.Name; } } }
void GetAreas() { List <rapidInfoModel.Area> list = rapidInfoModel.Area.GetData(); foreach (rapidInfoModel.Area a in list) { rapidInfoModel.Area parent = rapidInfoModel.Area.GetData(Cmn.ToInt(a.ParentId)); sb.Append(a.Id + "^" + a.Name + "^" + a.ParentId + "^"); if (parent != null) { sb.Append(parent.Name); } sb.Append("~"); } }
protected void Page_Load(object sender, EventArgs e) { base.Page_Load(sender, e); string str = ""; if (Action == "") { Action = "people"; } rapidInfoModel.Identity iden = rapidInfoModel.Identity.GetData(Action); if (iden != null) { //leftPanel.InnerHtml = "<img class='profileImg' src='" + ResolveClientUrl(@"~/Images/identity/" + iden.Id + ".jpg") + "' alt='" + iden.Name + "' />"; str += "<h1>" + iden.Name + "</h1>"; str += "<p>" + "<img class='profileImg' src='" + ResolveClientUrl(@"~/Images/identity/" + iden.Id + ".jpg") + "' alt='" + iden.Name + "' />" + Cmn.GetUnCompressed(iden.Details, (int)iden.DetailsLength) + "</p>"; rightPanel.InnerHtml = str; return; } rapidInfoModel.Area a = rapidInfoModel.Area.GetDataByName(Action); List <rapidInfoModel.AreaLink> alList = rapidInfoModel.AreaLink.GetDataByArea(a.Id); if (alList.Count == 0) { str += "<h1>" + a.Name + "</h1><br/>"; str += "<div class='row'>"; List <rapidInfoModel.Area> ChildList = rapidInfoModel.Area.GetDataByParent(a.Id); var ctr = 0; foreach (rapidInfoModel.Area child in ChildList) { if (ctr % 4 == 0 && ctr != 0) { str += "</div><br><br><div class='row'>"; } string image = @"\image\" + child.Name.Replace(" ", "-").ToLower() + ".jpg"; if (!File.Exists(Server.MapPath(image))) { image = @"\image\notavailable.jpg"; } str += "<div class='col-md-3 ' ><div style='border:1px solid rgb(134, 134, 134);padding:2px'><a class='newProductMenuBlock' href='/" + child.Name.Replace(" ", "").ToLower() + "'><img class='img-responsive' style='width:100%;height:147px' src='" + image + "'><span class='ProductMenuCaption'><i class='fa fa-caret-right'></i>" + child.Name + "</span></a></div></div>"; ctr++; //str += "<li><a href='/" + child.Name.Replace(" ", "").ToLower() + "'>" + child.Name + "</a></li>"; } str += "</div>"; } else { //str += "<h1>"; str += "<h1>" + a.Name + "</h1><br/>"; str += "<div class='row'>"; var ctr = 0; foreach (rapidInfoModel.AreaLink child in alList) { if (ctr % 4 == 0 && ctr != 0) { str += "</div><br><br><div class='row'>"; } rapidInfoModel.Identity identity = rapidInfoModel.Identity.GetData(child.IdentityId); string image = @"\images\identity\" + identity.Id + ".jpg"; if (!File.Exists(Server.MapPath(image))) { image = @"\image\notavailable.jpg"; } str += "<div class='col-md-2 ' ><div style='border:1px solid rgb(134, 134, 134);padding:2px'><a class='newProductMenuBlock' href='/" + identity.Name.Replace(" ", "").ToLower() + "'><img class='img-responsive' style='width:100%;height:170px' src='" + image + "'><span class='ProductMenuCaption'><i class='fa fa-caret-right'></i>" + identity.Name + "</span></div></div>"; ctr++; //str += "<li><a href='/" + identity.Name.Replace(" ", "").ToLower() + "'>" + identity.Name + "</a></li>"; } str += "</div>"; } rightPanel.InnerHtml = str; }