private void Create_Card_Viewer(List <DataAccess.Assessment> listAssessments)
        {
            foreach (var item in listAssessments)
            {
                int _AssessmentID = item.AssessmentID;

                int _total_score = -1;

                HtmlGenericControl divContainer = new HtmlGenericControl("div");
                divContainer.Attributes.Add("class", "col-xl-3 col-lg-4 col-md-6 col-sm-12 pull-left");
                HtmlGenericControl divContainerChild = new HtmlGenericControl("div");
                divContainerChild.Attributes.Add("class", "cat__ecommerce__catalog__item");

                //cat__ecommerce__catalog__item__status
                HtmlGenericControl divARImage = new HtmlGenericControl("div");
                divARImage.Attributes.Add("class", "cat__ecommerce__catalog__item__img");
                HtmlGenericControl divARStatus  = new HtmlGenericControl("div");
                HtmlGenericControl spanARStatus = new HtmlGenericControl("span");
                spanARStatus.Attributes.Add("class", "cat__ecommerce__catalog__item__status__title");
                List <HtmlGenericControl> listBtns = new List <HtmlGenericControl>();
                //resp exists  <div class="cat__ecommerce__catalog__item__status">
                List <DataAccess.Assessment> listOtherVersios       = gAssessment.GetAssessmentsByTreeIDFromCache(item.AssessmentTreeID.Value);
                List <AssessmentResponse>    listAssessmentResponse = new List <AssessmentResponse>();
                if (listOtherVersios != null && listOtherVersios.Count > 1)
                {
                    foreach (var item_older in listOtherVersios)
                    {
                        List <AssessmentResponse> listAssessmentResponse_temp = gAssessment.GetAssessmentResponsesByUserAndAssessmentID(BSWSession.UserID, item_older.AssessmentID);
                        if (listAssessmentResponse_temp != null && listAssessmentResponse_temp.Count > 0)
                        {
                            listAssessmentResponse.AddRange(listAssessmentResponse_temp);
                        }
                    }
                }
                else
                {
                    listAssessmentResponse = gAssessment.GetAssessmentResponsesByUserAndAssessmentID(BSWSession.UserID, _AssessmentID);
                }

                if (listAssessmentResponse != null && listAssessmentResponse.Count > 0)
                {
                    bool is_crrt                  = false;
                    bool is_have_history          = false;
                    HtmlGenericControl objDDLMenu = CreateDDLMenuAI();
                    HtmlGenericControl divbtngrp  = new HtmlGenericControl("div");
                    divbtngrp.Attributes.Add("class", "btn-group pull-right ");
                    divbtngrp.Attributes.Add("style", "padding-right:4px; ");
                    divbtngrp.Attributes.Add("role", "group");
                    HtmlGenericControl objBtn_t = new HtmlGenericControl("a");
                    objBtn_t.Attributes.Add("class", "btn btn-icon btn-outline-success dropdown-toggle");
                    objBtn_t.Attributes.Add("data-toggle", "dropdown");
                    objBtn_t.Attributes.Add("aria-expanded", "false");
                    objBtn_t.InnerHtml = "<i class='fa fa-search' style='color: #46be8a;' ></i>";
                    HtmlGenericControl uldivbtngrp = new HtmlGenericControl("ul");
                    uldivbtngrp.Attributes.Add("class", "dropdown-menu");

                    foreach (var itemAR in listAssessmentResponse)
                    {
                        _AssessmentID = itemAR.AssessmentID;
                        if (listAssessmentResponse.Count == 1)
                        {
                            HtmlGenericControl objBtn_t1 = new HtmlGenericControl("a");
                            HtmlGenericControl ctrl_i_t  = new HtmlGenericControl("i");
                            ctrl_i_t.Attributes.Add("class", itemAR.IsCurent ? "fa fa-pencil" : "fa fa-search");
                            objBtn_t1.Attributes.Add("class", "btn btn-icon btn-outline-success mr-2 mb-2 pull-right");
                            objBtn_t1.Attributes.Add("href", "AssessmentViewer.aspx" + EncryptQueryString("AssessmentID=" + _AssessmentID.ToString() + "&AssessmentRespID=" + itemAR.ID.ToString()));
                            objBtn_t1.Controls.Add(ctrl_i_t);
                            listBtns.Add(objBtn_t1);
                            if (!itemAR.IsCurent)
                            {
                                objBtn_t1 = new HtmlGenericControl("a");
                                ctrl_i_t  = new HtmlGenericControl("i");
                                ctrl_i_t.Attributes.Add("class", "fa fa-pencil");
                                objBtn_t1.Attributes.Add("class", "btn btn-icon btn-outline-success mr-2 mb-2 pull-right");
                                objBtn_t1.Attributes.Add("href", "AssessmentViewer.aspx" + EncryptQueryString("AssessmentID=" + _AssessmentID.ToString()));
                                objBtn_t1.Controls.Add(ctrl_i_t);
                                listBtns.Add(objBtn_t1);
                            }
                            else
                            {
                                is_crrt = true;
                                divARStatus.Attributes.Add("class", "cat__ecommerce__catalog__item__status continue-color");
                                spanARStatus.InnerHtml = "CNT";
                            }
                        }
                        else
                        {
                            if (itemAR.Equals(listAssessmentResponse.First()))
                            {
                                HtmlGenericControl objBtn_t1 = new HtmlGenericControl("a");
                                HtmlGenericControl ctrl_i_t1 = new HtmlGenericControl("i");


                                if (!itemAR.IsCurent)
                                {
                                    objBtn_t1 = new HtmlGenericControl("a");
                                    ctrl_i_t1 = new HtmlGenericControl("i");
                                    ctrl_i_t1.Attributes.Add("class", "fa fa-refresh");
                                    objBtn_t1.Attributes.Add("class", "btn btn-icon btn-outline-success mr-2 mb-2 pull-right");
                                    objBtn_t1.Attributes.Add("href", "AssessmentViewer.aspx" + EncryptQueryString("AssessmentID=" + _AssessmentID.ToString()));
                                    objBtn_t1.Controls.Add(ctrl_i_t1);
                                    listBtns.Add(objBtn_t1);
                                }
                                else
                                {
                                    ctrl_i_t1.Attributes.Add("class", itemAR.IsCurent ? "fa fa-pencil" : "fa fa-search");
                                    objBtn_t1.Attributes.Add("class", "btn btn-icon btn-outline-success mr-2 mb-2 pull-right");
                                    objBtn_t1.Attributes.Add("href", "AssessmentViewer.aspx" + EncryptQueryString("AssessmentID=" + _AssessmentID.ToString() + "&AssessmentRespID=" + itemAR.ID.ToString()));
                                    objBtn_t1.Controls.Add(ctrl_i_t1);
                                    listBtns.Add(objBtn_t1);
                                    is_crrt = true;
                                    divARStatus.Attributes.Add("class", "cat__ecommerce__catalog__item__status continue-color");
                                    spanARStatus.InnerHtml = "CNT";
                                    continue;
                                }
                            }

                            HtmlGenericControl objBtn_t_a = new HtmlGenericControl("a");
                            objBtn_t_a.Attributes.Add("class", "dropdown-item");
                            objBtn_t_a.Attributes.Add("href", "AssessmentViewer.aspx" + EncryptQueryString("AssessmentID=" + _AssessmentID.ToString() + "&AssessmentRespID=" + itemAR.ID.ToString()));
                            objBtn_t_a.InnerText = itemAR.AdministerDate.ToShortDateString();
                            HtmlGenericControl ctrl_i_t = new HtmlGenericControl("i");
                            ctrl_i_t.InnerHtml = "<span class='badge badge-pill badge-info mr-2 mb-2 pull-right'>" + itemAR.TotalScore.ToString() + "</span>";
                            objBtn_t_a.Controls.Add(ctrl_i_t);
                            uldivbtngrp.Controls.Add(objBtn_t_a);
                            is_have_history = true;
                        }

                        if (itemAR.IsCurent)
                        {
                        }
                    }
                    if (is_have_history)
                    {
                        divbtngrp.Controls.Add(objBtn_t);
                        divbtngrp.Controls.Add(uldivbtngrp);
                        listBtns.Add(divbtngrp);
                    }

                    if (!is_crrt)
                    {
                        divARStatus.Attributes.Add("class", "cat__ecommerce__catalog__item__status completed-color");
                        spanARStatus.InnerHtml = "DONE";
                        _total_score           = listAssessmentResponse[0].TotalScore;
                    }
                }
                else
                {
                    divARStatus.Attributes.Add("class", "cat__ecommerce__catalog__item__status");
                    spanARStatus.InnerHtml = "NEW";
                    HtmlGenericControl objBtn_t = new HtmlGenericControl("a");
                    HtmlGenericControl ctrl_i_t = new HtmlGenericControl("i");
                    ctrl_i_t.Attributes.Add("class", "fa fa-pencil");
                    objBtn_t.Attributes.Add("class", "btn btn-icon btn-outline-success mr-2 mb-2 pull-right");
                    objBtn_t.Attributes.Add("href", "AssessmentViewer.aspx" + EncryptQueryString("AssessmentID=" + _AssessmentID.ToString()));
                    objBtn_t.Controls.Add(ctrl_i_t);
                    listBtns.Add(objBtn_t);
                }
                divARStatus.Controls.Add(spanARStatus);
                divARImage.Controls.Add(divARStatus);

                //TODO - Favouirete Assessment
                HtmlGenericControl divARFavourite = new HtmlGenericControl("div");
                divARFavourite.Attributes.Add("class", "cat__ecommerce__catalog__item__like cat__ecommerce__catalog__item__like");
                if (_total_score > 0)
                {
                    divARFavourite.InnerHtml = "<span class='badge badge-pill badge-success mr-2 mb-2'> " + _total_score.ToString() + " </span>";
                }
                //<span class='badge badge-pill badge-success mr-2 mb-2'>90</span>
                //if(liked) add class --selected
                divARImage.Controls.Add(divARFavourite);

                HtmlGenericControl divARContentItem = new HtmlGenericControl("div");
                divARContentItem.Attributes.Add("class", "cat__ecommerce__catalog__item__price");
                divARContentItem.InnerHtml = item.Name;
                divARImage.Controls.Add(divARContentItem);

                divContainerChild.Controls.Add(divARImage);
                //divARIImage ended

                //content
                HtmlGenericControl divARContent = new HtmlGenericControl("div");
                divARContent.Attributes.Add("class", "cat__ecommerce__catalog__item__title col-sm-12 row");

                HtmlGenericControl divARContent_t = new HtmlGenericControl("div");
                divARContent_t.Attributes.Add("class", "col-sm-6");

                HtmlGenericControl html_a_ARTitle = new HtmlGenericControl("a");
                html_a_ARTitle.Attributes.Add("href", "javascript:void(0);");
                string _a_type = string.Empty;
                if (item.TypeID > 0)
                {
                    _a_type = gLookUp.GetAssesmentTypeFromCache(item.TypeID).Description;
                }
                if (listAssessmentResponse != null && listAssessmentResponse.Count > 0)
                {
                    html_a_ARTitle.InnerHtml = "<i class='fa fa-calendar' ></i> " + listAssessmentResponse[0].AdministerDate.ToShortDateString();
                }
                else
                {
                    html_a_ARTitle.InnerText = _a_type;
                }

                divARContent_t.Controls.Add(html_a_ARTitle);
                divARContent.Controls.Add(divARContent_t);

                HtmlGenericControl divARContent_t2 = new HtmlGenericControl("div");
                divARContent_t2.Attributes.Add("class", "col-sm-6 ");
                divARContent_t2.Attributes.Add("style", "padding-right: 0 !important; margin-top: -8px !important;");

                foreach (var itemBtn in listBtns)
                {
                    divARContent_t2.Controls.Add(itemBtn);
                }
                divARContent.Controls.Add(divARContent_t2);

                divContainerChild.Controls.Add(divARContent);

                divContainer.Controls.Add(divContainerChild);
                divCardViewer.Controls.Add(divContainer);
            }
        }