protected void Page_Load(object sender, EventArgs e)
 {
     getName = Request.QueryString["name"];
     if (null != getName)
     {
         Response response = AmazonDynamoDBAffiliateTable.Instance.GetDataInDynamoDb(getName.ToLower());
         identity   = response.AffiliateDataModel.FirstOrDefault();
         identity   = AmazonDynamoDBAffiliateTable.Instance.ConvertToTitleCase(identity);
         name.Value = identity.Name;
     }
     countDiv.InnerText = DashBoard.Count.ToString();
 }
        public static Response Send(AffiliateDataModel IdentityData)
        {
            Response status;

            IdentityData             = AmazonDynamoDBAffiliateTable.Instance.SetEmptyValuestoNull(IdentityData);
            IdentityData             = AmazonDynamoDBAffiliateTable.Instance.ConvertToLowerCase(IdentityData);
            IdentityData.CurrentDate = System.DateTime.Now.Date.ToString("dd.MM.yyy");
            if (null == getName)
            {
                status = AmazonDynamoDBAffiliateTable.Instance.SaveDataInDynamoDb(IdentityData);
            }
            else
            {
                status = AmazonDynamoDBAffiliateTable.Instance.UpdateDataInDynamoDb(IdentityData);
            }
            return(status);
        }
Example #3
0
        private void CreateHTMLTable(List <AffiliateDataModel> Affiliates)
        {
            Response response = AmazonDynamoDBIdentityTable.Instance.GetAllDataInDynamoDb();
            List <IdentityDataModel> Identities = response.IdentityDataModel;
            int tasknumber = 0;

            foreach (AffiliateDataModel Identity in Affiliates)
            {
                AffiliateDataModel affiliate = Identity;
                affiliate = AmazonDynamoDBAffiliateTable.Instance.ConvertToTitleCase(affiliate);
                var tr = new HtmlTableRow();
                tr.ID = affiliate.Name;
                tasknumber++;
                HtmlTableCell taskNumber = new HtmlTableCell();
                taskNumber.InnerText = tasknumber.ToString();
                taskNumber.Attributes.Add("class", "tablecolumn");
                tr.Cells.Add(taskNumber);
                HtmlTableCell currentDate = new HtmlTableCell();
                currentDate.InnerText = affiliate.CurrentDate;
                currentDate.Attributes.Add("class", "tablecolumn");
                tr.Cells.Add(currentDate);
                HtmlTableCell name = new HtmlTableCell();
                name.InnerText = affiliate.Name;
                name.Attributes.Add("class", "tablecolumn");
                tr.Cells.Add(name);

                HtmlTableCell websiteCount = new HtmlTableCell();
                websiteCount.InnerText = affiliate.Identities.Count.ToString();
                websiteCount.Attributes.Add("class", "tablecolumn");
                tr.Cells.Add(websiteCount);

                HtmlAnchor _edit = new HtmlAnchor();
                _edit.HRef = "/AddAffiliate.aspx?name=" + name.InnerText;
                _edit.Attributes.CssStyle.Add("margin-left", "0px");
                HtmlImage editimage = new HtmlImage();
                editimage.Attributes.Add("src", "../Images/edit.png");
                editimage.Attributes.CssStyle.Add("width", "15px");
                _edit.Controls.Add(editimage);
                _edit.Attributes.Add("id", "edit" + name.InnerText);
                HtmlAnchor _delete = new HtmlAnchor();
                _delete.HRef = "#";
                _delete.Attributes.CssStyle.Add("margin-left", "22px");
                HtmlImage deleteimage = new HtmlImage();
                deleteimage.Attributes.Add("src", "../Images/delete.png");
                deleteimage.Attributes.CssStyle.Add("width", "30px");
                _delete.Attributes.Add("onclick", "deleteIdentity('" + name.InnerText + "')");
                _delete.Attributes.Add("id", "delete" + name.InnerText);
                _delete.Controls.Add(deleteimage);

                HtmlGenericControl copyBasicData = new HtmlGenericControl("input");
                copyBasicData.Attributes.Add("type", "button");
                copyBasicData.Attributes.Add("class", "btn btn-click");
                copyBasicData.Attributes.Add("value", "Copy Data");
                copyBasicData.Attributes.CssStyle.Add("width", "auto");
                copyBasicData.Attributes.CssStyle.Add("background-color", "#06d995");
                copyBasicData.Attributes.CssStyle.Add("color", "#ffffff");
                copyBasicData.Attributes.CssStyle.Add(" margin-left", "10px");
                copyBasicData.Attributes.Add("onclick", "copyPersonalData('" + affiliate.Name + "')");
                copyBasicData.Attributes.Add("id", "affiliate" + affiliate.Name);



                HtmlTableCell actioncell = new HtmlTableCell();
                actioncell.Controls.Add(_edit);
                actioncell.Controls.Add(_delete);
                actioncell.Controls.Add(copyBasicData);
                actioncell.Attributes.Add("class", "tablecolumn");
                tr.Cells.Add(actioncell);

                affiliates.Rows.Add(tr);
            }
        }