protected void Unnamed1_Click1(object sender, EventArgs e)
    {
        rapidInfoModel.Identity a = rapidInfoModel.Identity.GetData(Cmn.ToInt(lblId.Text));
        if (a == null)
        {
            a = new rapidInfoModel.Identity();
        }

        a.Name          = txtName.Text;
        a.Details       = Cmn.GetCompressed(txtDetails.InnerText);
        a.DetailsLength = txtDetails.InnerText.Length;
        a.Save();


        if (a != null)
        {
            string FileName = @"~\Images\identity\" + a.Id + ".jpg";

            if (FileUpload.HasFile != false)
            {
                try { FileUpload.SaveAs(Server.MapPath(FileName)); RegularExpressionValidator1.Visible = false; }
                catch (Exception ex) { Cmn.LogError(ex, "Image"); }
            }
        }

        WriteClientScript("parent.GetIdentity();");
    }
    void ShowData(int id)
    {
        rapidInfoModel.Identity a = rapidInfoModel.Identity.GetData(id);

        if (a != null)
        {
            lblId.Text   = a.Id.ToString();
            txtName.Text = a.Name;

            txtDetails.InnerHtml = Cmn.GetUnCompressed(a.Details, (int)a.DetailsLength);

            lblImage.Text = "<img src='" + ResolveClientUrl(@"~/Images/identity/" + a.Id + ".jpg") + "' alt='" + a.Name + "' height='80' />";
        }
    }
Example #3
0
    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;
    }