private void RepeaterItem(RepeaterItem e)
    {
        if (e.ItemType == ListItemType.Item || e.ItemType == ListItemType.AlternatingItem)
        {
            try
            {
                ImageButton lbtnDelete = (ImageButton)e.FindControl("deleteImage");
                HtmlImage image = (HtmlImage)e.FindControl("imgDelete");

                //if (Common.ExistServiceTypeIdForMessageContent(Convert.ToInt32(lbtnDelete.CommandArgument)) == true)
                //{
                //    lbtnDelete.Enabled = false;
                //}
                //else
                //{
                lbtnDelete.Enabled = true;
                lbtnDelete.Attributes["onClick"] = "confirmAction(event, '" + Resources.UIResource.ConfirmDeleteServiceType + "');";
                //}
            }
            catch (Exception ex)
            {
                // Logger.Error(ex.Message);
                //this.latestException = ex;
            }
        }
    }
Esempio n. 2
0
    protected String GetCommentReplyHtml(Comment comment, RepeaterItem item)
    {
        CommentReplyManager manager = new CommentReplyManager();
        IList<CommentReply> replyes = manager.GetCommentReplyByCommentID(comment.ID);
        HtmlGenericControl divReply = item.FindControl("divReply") as HtmlGenericControl;
        HyperLink hplReply = item.FindControl("hplReply") as HyperLink;

        if (replyes != null && replyes.Count > 0)
        {
            ///Show the Reply Link
            divReply.Visible = true;
            hplReply.Attributes["onclick"] = String.Format("ShowPopupForCommentReply({0}, this);", comment.ID);

            UserManager userManager = new UserManager();
            StringBuilder sb = new StringBuilder(10);
            #region Expand Collapse Implementation
            //sb.Append("Comment Replyes:");
            //foreach (CommentReply reply in replyes)
            //{
            //    PlanningPrepUser user = userManager.Get(reply.UserID);
            //    sb.Append("<div style='margin-top:10px;'>");
            //    sb.Append("<div class='ExamTitle' onclick='ToggleCollapse(this)' style='cursor:pointer'>");
            //    sb.AppendFormat("<img class='clickableimage' src='/Images/plus.gif' alt='Expand' title='Expand'/> {0}", user.Username);
            //    sb.Append("</div>");
            //    sb.AppendFormat("<div class='replymessage' style='display:none;'>{0}</div>", AppUtil.FormatText(reply.Message));
            //    sb.Append("</div>");
            //}
            #endregion

            for(int i=0; i<replyes.Count; i++)
            {
                CommentReply reply = replyes[i];
                PlanningPrepUser user = userManager.Get(reply.UserID);
                if (i == 0)
                    sb.Append("<div class='replymessagecontainer' style='margin-top:10px;'>");
                else
                    sb.Append("<div class='replymessagecontainer'>");
                sb.AppendFormat("<div class='replymessageheading'>Reply of <b>{0}</b></div>", AppUtil.Encode(string.Format("{0} {1}",user.FirstName,user.LastName)));
                sb.Append(string.Format("\"{0}\"", AppUtil.FormatText(reply.Message)));
                sb.Append("</div>");
            }

            return sb.ToString();
        }
        else
        {
            ///Show the Reply Link if this commment is not the users own comment
            if (comment.UserID != _LoggedInUser.Author_ID)
            {
                divReply.Visible = true;
                hplReply.Attributes["onclick"] = String.Format("ShowPopupForCommentReply({0}, this);", comment.ID);
            }
        }
        if (_LoggedInUser.Author_ID == 0)
            divReply.Visible = false;

        return String.Empty;
    }
Esempio n. 3
0
    protected void rptMenuShopDepartments_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        RepeaterItem rptItem = e.Item as RepeaterItem;

        if (rptItem != null && rptItem.ItemType != ListItemType.Header)
        {
            //HtmlTableCell cell = rptItem.FindControl("departmentCell") as HtmlTableCell;
            //Repeater rptShoppingFoods = cell.FindControl("rptShoppingFoods") as Repeater;
            Repeater rptShoppingFoods = rptItem.FindControl("rptShoppingFoods") as Repeater;
            int      shopDepartmentId = (rptItem.DataItem as ShopDepartment).ShopDepartmentId;

            if (this.foodsList != null)
            {
                rptShoppingFoods.DataSource = this.foodsList.Where(list => list.ShopDepartmentId == shopDepartmentId).ToArray();
                rptShoppingFoods.DataBind();
            }
        }
    }
Esempio n. 4
0
    protected void rbLable_CheckedChanged(object sender, EventArgs e)
    {
        RadioButton  rdb   = sender as RadioButton;
        RepeaterItem item  = rdb.Parent as RepeaterItem;
        int          count = rptLable.Items.Count;

        for (int i = 0; i < count; i++)
        {
            RadioButton rbLable = rptLable.Items[i].FindControl("rbLable") as RadioButton;
            if (i != item.ItemIndex)
            {
                rbLable.Checked = false;
            }
        }
        Repeater rept = (Repeater)item.FindControl("rptLableFriend");

        rept.Visible = true;
    }
Esempio n. 5
0
        protected void BindMeds(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
            {
                RepeaterItem member         = (RepeaterItem)e.Item;
                Panel        pnlMember      = (Panel)member.FindControl("pnlMember");
                Panel        pnlMemberMed   = (Panel)pnlMember.FindControl("pnlMemberMed");
                Repeater     rptMembersMeds = (Repeater)pnlMember.FindControl("rptMembersMeds");

                using (DataView dv = new DataView(gpcr.TheraSubTable))
                {
                    dv.RowFilter = String.Format("CCHID = '{0}'", ((DataRowView)e.Item.DataItem)["CCHID"].ToString());
                    rptMembersMeds.DataSource = dv.ToTable("Membermeds", false,
                                                           new String[] { "DrugName", "Strength", "ReplacementDrugName", "ReplacementStrength", "TotalPotentialSavings" });
                    rptMembersMeds.DataBind();
                }
            }
        }
Esempio n. 6
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack && !IsCallback)
        {
            templateRepeater.DataSource = new List <ImageItem>(GetTemplates());
            templateRepeater.DataBind();
            if (templateRepeater.Items.Count > 0)
            {
                RepeaterItem             item = templateRepeater.Items[0];
                LinkButton               lb   = (LinkButton)item.FindControl("templateButton");
                RepeaterCommandEventArgs arg  = new RepeaterCommandEventArgs(item, lb,
                                                                             new CommandEventArgs(lb.CommandName, lb.CommandArgument));
                templateRepeater_ItemCommand(templateRepeater, arg);
            }

            LoadImageList();
        }
    }
Esempio n. 7
0
        /// <summary>
        /// Retorna os conteúdos cadastrados dentro da linha do objetivo.
        /// </summary>
        /// <param name="container">Linha do objetivo</param>
        /// <returns></returns>
        private List <ORC_Conteudo_Cadastro> RetornaConteudos(RepeaterItem container)
        {
            List <ORC_Conteudo_Cadastro> lista = new List <ORC_Conteudo_Cadastro>();
            Repeater rptConteudos = (Repeater)container.FindControl("rptConteudos");

            foreach (RepeaterItem item in rptConteudos.Items)
            {
                ORC_Conteudo_Cadastro entConteudos = RetornaConteudoCadastro(item);
                if ((entConteudos.listItensConteudo.Count > 0) ||
                    (entConteudos.listHabilidades.Count > 0) ||
                    (entConteudos.listPeriodos.Count > 0))
                {
                    lista.Add(entConteudos);
                }
            }

            return(lista);
        }
    protected void btnExcluir_Click(object sender, EventArgs e)
    {
        Button       btnExcluir = (Button)sender;
        RepeaterItem item       = (RepeaterItem)btnExcluir.NamingContainer;

        try
        {
            ExcluirEndereco(item.ItemIndex);

            rptEndereco.Visible = rptEndereco.Items.Count > 0 && VerificaItemVisivel();
        }
        catch (Exception ex)
        {
            ApplicationWEB._GravaErro(ex);
            ((Label)item.FindControl("lblMessage")).Text =
                UtilBO.GetErroMessage("Erro ao tentar excluir o endereço.", UtilBO.TipoMensagem.Erro);
        }
    }
 protected void UsersListRepeater_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     try
     {
         if (e.Item != null && e.Item.DataItem != null)
         {
             //-- Creo el objeto que tiene los datos de la ROW del Listview
             //----------------------------------------------------------------
             RepeaterItem dataItem = e.Item;
             Docente      data     = (Docente)dataItem.DataItem;
             ((Label)dataItem.FindControl("lblMaterias")).Text = data.MateriasToString();
         }
     }
     catch (Exception ex)
     {
         lblInfo.Text = ex.Message;
     }
 }
Esempio n. 10
0
        protected void OnDelete(object sender, EventArgs e)
        {
            RepeaterItem item = (sender as LinkButton).Parent as RepeaterItem;
            int          id   = Int32.Parse((item.FindControl("lbId") as Label).Text);

            if (Session["dataTableComenzi"] != null)
            {
                DataTable datatable = (DataTable)Session["dataTableComenzi"];
                for (int i = 0; i < datatable.Rows.Count; i++)
                {
                    if (Int32.Parse(datatable.Rows[i][0].ToString()) == id)
                    {
                        datatable.Rows.Remove(datatable.Rows[i]);
                    }
                }
            }
            this.BindRepeater();
        }
Esempio n. 11
0
        /// <summary>
        /// Build a list of Sections in a Page
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void BuildPageSections(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                string page = DataBinder.Eval(e.Item.DataItem, MetadataSurveyQuestion.Page).ToString();

                RepeaterItem pageRow      = e.Item;
                Repeater     sectionsRptr = pageRow.FindControl("SectionsRptr") as Repeater;

                DataView sectionsView = _surveyData.GetPatientMetaSurveySections(metaSurveyId.Value, surveyId).DefaultView;
                sectionsView.RowFilter  = MetadataSurveyQuestion.Page + " = '" + page.Replace("'", "''") + "'";
                sectionsRptr.DataSource = sectionsView;
                sectionsRptr.DataBind();

                sectionsRptr.DataSource = sectionsView;
                sectionsRptr.DataBind();
            }
        }
    protected void BookDoctor(object sender, EventArgs e)
    {
        try
        {
            //Find the reference of the Repeater Item.
            RepeaterItem item  = (sender as LinkButton).Parent as RepeaterItem;
            int          docId = int.Parse((item.FindControl("lblId") as Label).Text);

            con.Open();
            string name = "", exp = "", qly = "", fee = "", images = "", Adate = "", ftime = "", Ttime = "", Purpose = "", Lastvisit = "";

            SqlCommand cmd = con.CreateCommand();
            cmd.CommandType = CommandType.Text;
            cmd.CommandText = "select * from DoctorMaster where id=" + docId + "";
            cmd.ExecuteNonQuery();
            DataTable      dt = new DataTable();
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            da.Fill(dt);
            foreach (DataRow dr in dt.Rows)
            {
                name      = dr["Doctor_Name"].ToString();
                exp       = dr["Specialization"].ToString();
                fee       = dr["Doctor_fee"].ToString();
                qly       = dr["Doctor_Qualification"].ToString();
                images    = dr["Doctor_Images"].ToString();
                Adate     = "22/08/2020";
                ftime     = "10:10 AM";
                Ttime     = "10:20 AM";
                Purpose   = "Treatment";
                Lastvisit = "22/08/2020";
            }


            Response.Cookies["cookies"].Value   = name.ToString() + "&" + qly.ToString() + "&" + exp.ToString() + "&" + fee.ToString() + "&" + images.ToString() + "&" + docId.ToString() + "&" + Adate.ToString() + "&" + ftime.ToString() + "&" + Ttime.ToString() + "&" + Purpose.ToString() + "&" + Lastvisit.ToString();
            Response.Cookies["cookies"].Expires = DateTime.Now.AddDays(1);


            Response.Redirect("/AppointmentSchedule.aspx");
        }
        catch (Exception ex)
        {
            ex.ToString();
        }
    }
        protected void BtnAddGrupo_Click(object sender, EventArgs e)
        {
            TxtDocenteLider.Items.Clear();
            LblLiderExiste.Text = "";
            MODGrupoDocente           grupoDocente = new MODGrupoDocente();
            MODDocente_Linha_Pesquisa docenteLinha = new MODDocente_Linha_Pesquisa();
            MODGrupo   grupo   = new MODGrupo();
            MODDocente docente = new MODDocente();

            Control      botao = (Control)sender;
            RepeaterItem item  = (RepeaterItem)botao.Parent;

            Label  lbl    = (Label)item.FindControl("TxtNomeGrupo");
            string titulo = lbl.Text;

            grupo.Nome = titulo;
            grupoNome  = titulo;

            grupo = BLLGrupo.PesquisarGrupo(grupo, "nome");

            grupoDocente.FkGrupo = grupo.IdGrupo;
            idGrupo = grupo.IdGrupo;

            TxtDocenteLider.DataSource     = BLLGrupo_Docente.Pesquisar(grupoDocente, "grupo");
            TxtDocenteLider.DataValueField = "id_docente";
            TxtDocenteLider.DataTextField  = "nome";
            TxtDocenteLider.DataBind();

            if (TxtDocenteLider.Text.Trim() == "")
            {
                LblLiderExiste.Text = "Não há lider vínculado nesse grupo!";
            }

            docenteLinha.FkDocente = Convert.ToInt32(TxtDocenteLider.SelectedValue);
            docenteLinha.FkGrupo   = idGrupo;

            RptLinhas.DataSource = BLLDocente_Linha_Pesquisa.Pesquisar(docenteLinha, "docente");
            RptLinhas.DataBind();

            if (BLLDocente_Linha_Pesquisa.Pesquisar(docenteLinha, "docente").Rows.Count == 0)
            {
                LblLiderExiste.Text = "Não há linhas vínculadas a esse lider!";
            }
        }
Esempio n. 14
0
        protected void LoadServiceCommand_OnCommand(object sender, CommandEventArgs e)
        {
            int moduleid;

            if (int.TryParse(e.CommandArgument.ToString(), out moduleid))
            {
                ThisSession.SetCurrentModule(moduleid);

                LinkButton   button = (sender as LinkButton);
                RepeaterItem item   = button.NamingContainer as RepeaterItem;
                string       url    = (item.FindControl("linkUrl") as Label).Text;
                if (url != "")
                {
                    HttpContext.Current.ApplicationInstance.CompleteRequest();
                    Response.Redirect(url, false);
                }

                /*  HomePageLandScape home = ThisSession.CurrentLandScape.Where(m => m.MenuId == moduleid).FirstOrDefault();
                 * if (home != null)
                 * {
                 *  ///  string url = "";
                 *    if (home.ClickAction == RedirectAction.FindAddPatient)
                 *    {
                 *        url = String.Format("~/Patient/FindAdd.aspx?srvNm={0}&mod={1}", home.MenuName, home.MenuId);
                 *    }
                 *    else if (home.ClickAction == RedirectAction.ModuleAction)
                 *    {
                 *        string folderName = home.ServiceAreaName.Replace(" ", String.Empty);
                 *        if (System.IO.File.Exists(Server.MapPath(string.Format("~/{0}/Home.aspx", folderName))))
                 *        {
                 *            Guid g = Guid.NewGuid();
                 *            url = string.Format("~/{1}/Home.aspx?key={0}", g.ToString(), folderName);
                 *
                 *        }
                 *
                 *    }
                 *    if (url != "")
                 *    {
                 *        HttpContext.Current.ApplicationInstance.CompleteRequest();
                 *        Response.Redirect(url, false);
                 *    }
                 * }*/
            }
        }
    private void BindSubGrid(RepeaterItem itm)
    {
        var grd        = itm.FindControl("gvNewOrder") as GridView;
        var trSubTable = itm.FindControl("trSubTable") as HtmlTableRow;
        int OrderID    = Convert.ToInt32((itm.FindControl("lblorderid") as Label).Text);

        ((ImageButton)itm.FindControl("ibtnNOExpColap")).ImageUrl = "~/images/collapse.JPG";
        DataTable dtAOPlist = orderobj.BindAdminOrderProductList(OrderID);
        string    str       = ((HiddenField)itm.FindControl("hfOrderPdf")).Value.ToString();

        if (dtAOPlist.Rows.Count > 0)
        {
            for (int i = 0; i < dtAOPlist.Rows.Count; i++)
            {
                if (dtAOPlist.Rows[i]["Country"].ToString() == "INDIA")
                {
                    dtAOPlist.Rows[i]["Country"] = "INR";
                }
                else
                {
                    dtAOPlist.Rows[i]["Country"] = "USD";
                }
            }
            if (!string.IsNullOrEmpty(str))
            {
                (itm.FindControl("hlPDF") as HyperLink).Visible = true;
                (itm.FindControl("lbtnOrderpdfDownload") as LinkButton).Visible = true;
            }
            else
            {
                (itm.FindControl("hlPDF") as HyperLink).ForeColor = System.Drawing.ColorTranslator.FromHtml("#d3d3d3");
            }
            grd.DataSource = dtAOPlist;
            grd.DataBind();
            trSubTable.Style.Add(HtmlTextWriterStyle.Display, "''");
        }
        else
        {
            trSubTable.Style.Add(HtmlTextWriterStyle.Display, "none");
        }
    }
    /// <summary>
    /// Habilita/Desabilita os campos comuns do endereço (cidade, distrito,
    /// bairro, zona).
    /// </summary>
    /// <param name="item"></param>
    /// <param name="habilitado"></param>
    private void HabilitaCamposEndereco(RepeaterItem item, bool habilitado)
    {
        if (habilitado)
        {
            ((TextBox)item.FindControl("txtDistrito")).Attributes.Remove("readOnly1");
            ((TextBox)item.FindControl("txtBairro")).Attributes.Remove("readOnly1");
            ((TextBox)item.FindControl("txtCidade")).Attributes.Remove("readOnly1");
        }
        else
        {
            ((TextBox)item.FindControl("txtDistrito")).Attributes.Add("readOnly1", "readOnly");
            ((TextBox)item.FindControl("txtBairro")).Attributes.Add("readOnly1", "readOnly");
            ((TextBox)item.FindControl("txtCidade")).Attributes.Add("readOnly1", "readOnly");
        }

        ((UCComboZona)item.FindControl("UCComboZona1"))._Combo.Enabled = habilitado;
    }
    private void ToggleElements(RepeaterItem item, bool isEdit)
    {
        //Toggle Buttons.
        item.FindControl("editLink").Visible   = !isEdit;
        item.FindControl("updateLink").Visible = isEdit;
        item.FindControl("cancelLink").Visible = isEdit;

        //Toggle Labels.
        item.FindControl("nameLabel").Visible = !isEdit;

        //Toggle TextBoxes.
        item.FindControl("EditName").Visible = isEdit;

        if (LeadershipDisplay.Items.FindByValue("AdvBoard").Selected == true)
        {
            item.FindControl("statusLabel").Visible = !isEdit;
            item.FindControl("EditStatus").Visible  = isEdit;
        }
        else if (LeadershipDisplay.Items.FindByValue("ElecBoard").Selected == true)
        {
            item.FindControl("yearLabel").Visible = !isEdit;
            item.FindControl("EditYear").Visible  = isEdit;
        }
    }
Esempio n. 18
0
        protected void rptDistributor_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            RepeaterItem item = e.Item;

            if (item.ItemIndex > -1 && item.DataItem is IGrouping <int?, PackingListViewBO> )
            {
                List <PackingListViewBO> lstPackingListsGroup = ((IGrouping <int?, PackingListViewBO>)item.DataItem).ToList();

                if (lstPackingListsGroup[0].ShipmentMode != null)
                {
                    Literal litComapny = (Literal)item.FindControl("litComapny");
                    litComapny.Text = lstPackingListsGroup[0].CompanyName;

                    Literal litDate = (Literal)item.FindControl("litDate");
                    //litDate.Text = Convert.ToDateTime(lstOrderDetailsGroup[0].ShipmentDate.ToString()).ToString("dd MMMM yyyy");

                    Literal litAddress = (Literal)item.FindControl("litAddress");
                    litAddress.Text = lstPackingListsGroup[0].Address;

                    Literal litSuberb = (Literal)item.FindControl("litSuberb");
                    litSuberb.Text = lstPackingListsGroup[0].Suberb;

                    Literal litPostCode = (Literal)item.FindControl("litPostCode");
                    litPostCode.Text = lstPackingListsGroup[0].State + " " + lstPackingListsGroup[0].PostCode + " , " + lstPackingListsGroup[0].Country;

                    // Literal litCountry = (Literal)item.FindControl("litCountry");
                    //litCountry.Text = lstOrderDetailsGroup[0].Country;

                    Literal litContactDetails = (Literal)item.FindControl("litContactDetails");
                    litContactDetails.Text = lstPackingListsGroup[0].ContactDetails;

                    Repeater rptModes = (Repeater)item.FindControl("rptModes");

                    List <IGrouping <int, PackingListViewBO> > lstModesGroup = lstPackingListsGroup.GroupBy(o => (int)o.ShimentModeID).ToList();

                    if (lstModesGroup.Count > 0)
                    {
                        rptModes.DataSource = lstModesGroup;
                        rptModes.DataBind();
                    }
                }

                // Literal litGrandTotal = (Literal)item.FindControl("litGrandTotal");
                // litGrandTotal.Text = "Total" + " " + total.ToString();
            }
        }
        protected void rptAlbums_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            RepeaterItem ri = e.Item;

            Image imgAlbum = (Image)ri.FindControl("imgAlbum");

            if (String.IsNullOrEmpty(imgAlbum.ImageUrl))
            {
                imgAlbum.ImageUrl = "../../Images/no_thumbnail_image.png";
            }

            int imageCount = SelectedCustomer.CustomerAlbums.Length;

            if (imageCount > 0)
            {
                int rowCount = Convert.ToInt32((Convert.ToDouble(imageCount) / ThumbnailImageColumnCount) + 0.49);
                pnlAlbums.Style["height"] = (rowCount * 238).ToString() + "px";
            }
        }
 public void lnk_mailLink_Click(object sender, ImageClickEventArgs e)
 {
     try
     {
         string x = e.ToString();
         PFuthurImageButton.Visible = true;
         string       s    = sender.ToString();
         RepeaterItem item = (sender as ImageButton).Parent as RepeaterItem;
         index = int.Parse((item.FindControl("lblImageName") as Label).Text);
         IdeaIDTextBox.Text    = CEideaidTextBox.Text;
         IMPIdeaIdTextBox.Text = CEideaidTextBox.Text;
         //lblHeadertag.InnerHtml = index.ToString();
         //search();
     }
     catch (Exception)
     {
         throw;
     }
 }
Esempio n. 21
0
        protected void rptPublicAlbums_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            RepeaterItem ri = e.Item;

            Image imgPublicAlbum = (Image)ri.FindControl("imgPublicAlbum");

            if (imgPublicAlbum.ImageUrl == PublicImageFolderUrl)
            {
                imgPublicAlbum.ImageUrl = "../../Images/no_thumbnail_image.png";
            }

            int imageCount = PublicAlbums.Length;

            if (imageCount > 0)
            {
                int rowCount = Convert.ToInt32((Convert.ToDouble(imageCount) / ThumbnailImageColumnCount) + 0.49);
                pnlPublicAlbums.Style["height"] = (rowCount * 200).ToString() + "px";
            }
        }
 protected void btn_Delete_Click(object sender, EventArgs e)
 {
     try
     {
         Button       btn_Delete     = (Button)sender;
         RepeaterItem item           = (RepeaterItem)btn_Delete.NamingContainer;
         HiddenField  hf_ProductCode = (HiddenField)item.FindControl("hf_ProductCode");
         if (hf_ProductCode != null)
         {
             SessionManager.DeleteProductFromCart(hf_ProductCode.Value, 0);
         }
         BindCartData(string.Empty, string.Empty);
     }
     catch (Exception ex)
     {
         l_Error.Text    = ex.Message;
         l_Error.Visible = true;
     }
 }
Esempio n. 23
0
        protected void delete(object sender, EventArgs e)
        {
            //pr = (List<Product>)Session["cart"];
            RepeaterItem item = (sender as LinkButton).NamingContainer as RepeaterItem;

            int pid = Convert.ToInt32((item.FindControl("id") as Label).Text);

            Product delItem = pr.Where <Product>(x => x.id == pid).First <Product>();

            pr.Remove(delItem);

            //foreach (Product p in pr)
            //{
            //    error.InnerText += "id: " + delItem.id + " name: " + delItem.productName;
            //}
            Session["cart"] = pr;

            Response.Redirect("Cart.aspx");
        }
        protected void rptCategories_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            RepeaterItem ri = e.Item;

            Image imgCategory = (Image)ri.FindControl("imgCategory");

            if (String.IsNullOrEmpty(imgCategory.ImageUrl))
            {
                imgCategory.ImageUrl = "../../Images/no_thumbnail_image.png";
            }

            int imageCount = PortfolioCategories.Length;

            if (imageCount > 0)
            {
                int rowCount = Convert.ToInt32((Convert.ToDouble(imageCount) / ThumbnailImageColumnCount) + 0.49);
                pnlCategories.Style["height"] = (rowCount * 200).ToString() + "px";
            }
        }
Esempio n. 25
0
 protected void rptProducts_ItemDataBound(object sender, RepeaterItemEventArgs e)
 {
     try
     {
         RepeaterItem item = e.Item;
         if (item.ItemType == ListItemType.Item || item.ItemType == ListItemType.AlternatingItem)
         {
             HyperLink hlDownload = (HyperLink)item.FindControl("hlDownload");
             if (hlDownload != null)
             {
                 hlDownload.NavigateUrl = PageHelper.GeneralDetailUrl(Consts.CON_SAN_PHAM, "tải miễn phí", DataBinder.Eval(item.DataItem, "ProductId").ToString(), DataBinder.Eval(item.DataItem, "OriginalFileName").ToString());
             }
         }
     }
     catch (Exception ex)
     {
         MailSender.SendMail("", "", "Error System", ex.Message + "\n" + ex.StackTrace);
     }
 }
    protected void lnkDelete_Click(object sender, EventArgs e)
    {
        RepeaterItem item   = (sender as LinkButton).Parent as RepeaterItem;
        Int64        NewsId = int.Parse((item.FindControl("hfId") as HiddenField).Value);
        bool         yes    = (new Cls_newsupdate_b().Delete(NewsId));

        spnMessage.Visible = (new Cls_newsupdate_b().Delete(NewsId));
        if (yes)
        {
            BindNews();
            spnMessage.Style.Add("color", "green");
            spnMessage.InnerText = "News Deleted Successfully";
        }
        else
        {
            spnMessage.Style.Add("color", "red");
            spnMessage.InnerText = "News Not Deleted";
        }
    }
Esempio n. 27
0
    protected void lnDelete_Click(object sender, EventArgs e)
    {
        RepeaterItem item    = (sender as LinkButton).Parent as RepeaterItem;
        Int64        imageId = int.Parse((item.FindControl("hfImageId") as HiddenField).Value);
        bool         yes     = (new Cls_productimagesvideos_b().Delete(imageId));

        bMessage.Visible = true;
        if (yes)
        {
            BindImagesUsingProductId(Convert.ToInt64(ocommon.Decrypt(Convert.ToString(Request.QueryString["id"]), true)));
            bMessage.Style.Add("color", "green");
            bMessage.InnerText = "Product Image Deleted Successfully";
        }
        else
        {
            bMessage.Style.Add("color", "red");
            bMessage.InnerText = "Product Image Not Deleted";
        }
    }
    protected void lnkDelete_Click(object sender, EventArgs e)
    {
        RepeaterItem item = (sender as LinkButton).Parent as RepeaterItem;

        Int64 CategoryId = int.Parse((item.FindControl("lblCategoryId") as Label).Text);
        bool  yes        = (new Cls_slider_b().Delete(CategoryId));

        if (yes)
        {
            BindCategory();
            spnMessage.Style.Add("color", "green");
            spnMessage.InnerText = "Slider Deleted Successfully";
        }
        else
        {
            spnMessage.Style.Add("color", "red");
            spnMessage.InnerText = "Slider Not Deleted";
        }
    }
Esempio n. 29
0
    protected void ck2_CheckedChanged(object sender, EventArgs e)
    {
        CheckBox ck      = (CheckBox)sender;
        bool     isCheck = ck.Checked;

        //获取当前行
        RepeaterItem item    = (RepeaterItem)ck.NamingContainer;
        Label        idLabel = (Label)item.FindControl("Label3");

        if (teacherBll.ChangeTeacherState(idLabel.Text.Trim()) == 1)
        {
            SuAlert("修改成功");
        }
        else
        {
            ck.Checked = isCheck;
            errAlert("修改失败");
        }
    }
Esempio n. 30
0
    //修改管理员是否为监考老师

    protected void isExamTeacher_CheckedChanged(object sender, EventArgs e)
    {
        CheckBox ck      = (CheckBox)sender;
        bool     isCheck = ck.Checked;

        RepeaterItem item    = (RepeaterItem)ck.NamingContainer;
        Label        idLabel = (Label)item.FindControl("Label3");

        if (teacherBll.ChangeAdminExamTeacher(idLabel.Text) > 0)
        {
            // SuAlert("修改成功");
            BindData();
        }
        else
        {
            errAlert("修改失败");
            ck.Checked = isCheck;
        }
    }
        protected void BtnEliminar_Click(object sender, EventArgs e)
        {
            try
            {
                int userMensaje = 0;
                //Find the reference of the Repeater Item.
                RepeaterItem item   = (sender as Button).Parent as RepeaterItem;
                int          Id     = int.Parse((item.FindControl("LabIdUsuario") as Label).Text);
                string       constr = ConfigurationManager.ConnectionStrings["CadenaConexion"].ConnectionString;
                using (SqlConnection con = new SqlConnection(constr))
                {
                    using (SqlCommand cmd = new SqlCommand("EliminarUsuario"))
                    {
                        cmd.CommandType = CommandType.StoredProcedure;
                        cmd.Parameters.AddWithValue("@Id", Id);
                        cmd.Connection = con;
                        con.Open();
                        userMensaje = Convert.ToInt32(cmd.ExecuteScalar());
                        con.Close();
                    }
                    switch (userMensaje)
                    {
                    case 1:
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "showContent('error','El Usuario no se encuentra registrado.');", true);
                        break;

                    case 2:
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "showContent('success','Usuario eliminado con éxito');", true);
                        break;

                    default:
                        Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "showContent('error','Error al tratar de ingresar el registro.');", true);
                        break;
                    }
                }

                ObtenerUsuarios();
            }
            catch (Exception ex)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "CallMyFunction", "showContent('warning','" + ex.Message + "');", true);
            }
        }
    protected void lnkDelete_Click(object sender, EventArgs e)
    {
        RepeaterItem item    = (sender as LinkButton).Parent as RepeaterItem;
        Int64        AdminId = int.Parse((item.FindControl("lblAdminId") as Label).Text);
        int          yes     = Deleteuser(AdminId);

        spnMessage.Visible = true;
        if (yes > 0)
        {
            BindWebUserList();
            spnMessage.Style.Add("color", "green");
            spnMessage.InnerText = "User Deleted Successfully";
        }
        else
        {
            spnMessage.Style.Add("color", "red");
            spnMessage.InnerText = "User Not Deleted";
        }
    }
    public string BindRow(RepeaterItem Container)
    {
        if (Container == null)
            return "";
        Repeater rep = Container.FindControl("repRow") as Repeater;
        if (rep == null)
            return "";
        DataRow dr = Container.DataItem as DataRow;
        if (dr == null || dr.ItemArray.Length < 3)
            return "";
        DateTime dt = DateTime.Now;
        rep.DataSource = dr.ItemArray;
        rep.DataBind();
        return dr[0].ToString();

        //if (dr[0].ToString() == dt.Year + "-" + dt.Month.ToString().PadLeft(2, '0') + "-" + dt.Day.ToString().PadLeft(2, '0'))
        //    return " style='background-color:#5e5e5e;' ";
        //else
        //    return "";
    }
    /// <summary>
    /// Sets visibility of WebDAV edit control.
    /// </summary>
    /// <param name="repeaterItem">Repeater item</param>
    /// <param name="controlType">Control type</param>
    private void VisibleWebDAVEditControl(RepeaterItem repeaterItem, WebDAVControlTypeEnum controlType)
    {
        PlaceHolder plcAttachmentActions = repeaterItem.FindControl("plcAttachmentActions") as PlaceHolder;
        PlaceHolder plcAttachmentUpdtAction = repeaterItem.FindControl("plcAttachmentUpdtAction") as PlaceHolder;
        PlaceHolder plcLibraryUpdtAction = repeaterItem.FindControl("plcLibraryUpdtAction") as PlaceHolder;
        PlaceHolder plcWebDAV = repeaterItem.FindControl("plcWebDAV") as PlaceHolder;
        PlaceHolder plcWebDAVMfi = repeaterItem.FindControl("plcWebDAVMfi") as PlaceHolder;
        Panel pnlDisabledUpdate = (repeaterItem.FindControl("pnlDisabledUpdate") as Panel);
        DirectFileUploader dfuLib = repeaterItem.FindControl("dfuElemLib") as DirectFileUploader;
        DirectFileUploader dfu = repeaterItem.FindControl("dfuElem") as DirectFileUploader;
        ImageButton btnEdit = repeaterItem.FindControl("btnEdit") as ImageButton;
        ImageButton btnDelete = repeaterItem.FindControl("btnDelete") as ImageButton;

        if ((plcAttachmentActions != null) && (plcLibraryUpdtAction != null) && (plcAttachmentUpdtAction != null) && (plcWebDAV != null)
            && (plcWebDAVMfi != null) && (pnlDisabledUpdate != null) && (dfuLib != null) && (dfu != null) && (btnEdit != null) && (btnDelete != null))
        {
            WebDAVEditControl webDAVElem = null;

            if (controlType == WebDAVControlTypeEnum.Media)
            {
                plcAttachmentActions.Visible = true;
                plcAttachmentUpdtAction.Visible = false;
                plcLibraryUpdtAction.Visible = true;
                pnlDisabledUpdate.Visible = false;
                dfuLib.Visible = false;
                dfu.Visible = false;
                btnEdit.Visible = false;
                btnDelete.Visible = false;
                plcWebDAV.Visible = false;

                webDAVElem = Page.LoadUserControl("~/CMSModules/MediaLibrary/Controls/WebDAV/MediaFileWebDAVEditControl.ascx") as WebDAVEditControl;
                if (webDAVElem != null)
                {
                    plcWebDAVMfi.Controls.Clear();
                    plcWebDAVMfi.Controls.Add(webDAVElem);
                }
            }
            else if (controlType == WebDAVControlTypeEnum.Attachment)
            {
                plcAttachmentActions.Visible = true;
                plcAttachmentUpdtAction.Visible = false;
                plcLibraryUpdtAction.Visible = false;
                pnlDisabledUpdate.Visible = false;
                dfuLib.Visible = false;
                dfu.Visible = false;
                btnEdit.Visible = false;
                btnDelete.Visible = false;
                plcWebDAV.Visible = true;

                // Dynamically load control
                webDAVElem = Page.LoadUserControl("~/CMSModules/WebDAV/Controls/AttachmentWebDAVEditControl.ascx") as WebDAVEditControl;
                if (webDAVElem != null)
                {
                    plcWebDAV.Controls.Clear();
                    plcWebDAV.Controls.Add(webDAVElem);
                }
            }

            if (webDAVElem != null)
            {
                webDAVElem.Visible = false;
                webDAVElem.CssClass = null;

                IDataContainer data = new DataRowContainer((DataRowView)repeaterItem.DataItem);
                string extension = data.GetValue(FileExtensionColumn).ToString();

                // If the WebDAV is enabled and windows authentication and extension is allowed
                if (CMSContext.IsWebDAVEnabled(CMSContext.CurrentSiteName) && RequestHelper.IsWindowsAuthentication() && WebDAVSettings.IsExtensionAllowedForEditMode(extension, CMSContext.CurrentSiteName))
                {
                    // Set WebDAV edit control
                    GetWebDAVEditControl(ref webDAVElem, data);
                }
            }
        }
    }
    private void SetRewardDetailsForInsertUpdate(RepeaterItem Item)
    {
        Repeater Repeater2 = (Repeater)Item.FindControl("repTab_content");
        #region get reward what details
        int col = 1;
        foreach (Control rptItem in Repeater2.Controls)
        {
            TextBox txtQty = (TextBox)rptItem.FindControl("txtRewards");
            decimal val = 0;
            if (txtQty != null)
            {
                if (txtQty.Text != "")
                {
                    val = Convert.ToDecimal(txtQty.Text);
                }
            }

            switch (col)
            {
                case 1:
                    cmd_across.Parameters.AddWithValue("@reward_user", val);
                    break;
                case 2:
                    cmd_across.Parameters.AddWithValue("@reward_per_friend", val);
                    break;
                case 3:
                    cmd_across.Parameters.AddWithValue("@reward_per_like", val);
                    break;
                case 4:
                    cmd_across.Parameters.AddWithValue("@reward_per_share", val);
                    break;
            }
            col++;
        }

        #endregion
    }
    private ProductMachineItem prepareCartRecord(RepeaterItem item)
    {    
        LinkButton lnkDetails = (LinkButton)item.FindControl("lnkDetails"); //Product ID
        int productID = int.Parse(lnkDetails.CommandArgument);

        TextBox txtQuantity = (TextBox)item.FindControl("txtQuantity");
        Label lblPrice = (Label)item.FindControl("lblPrice");
        TextBox txtPrice = (TextBox)item.FindControl("txtPrice");
        RadioButtonList rdOrderType = (RadioButtonList)item.FindControl("rdOrderType");


        dsCart _dsCart = new dsCart();
        dsCart.CartRow drCart = _dsCart.Cart.CreateNewRow();

        drCart.DealerUserID = WebLib.LoggedInUser.DealerUserID;
        drCart.CartItemID = productID;
        drCart.ItemTypeEnum = (int)ItemType.Machine;

        if (rdOrderType.SelectedValue == "Others")
        {
            drCart.OrderTypeEnum = (int)OrderType.Others;

            if (Common.IsNum(txtPrice.Text))
                drCart.UnitPrice = decimal.Parse(txtPrice.Text);
            else
                drCart.UnitPrice = 0;            
        }
        else
        {
            drCart.OrderTypeEnum = (int)OrderType.Normal;

            string[] price = lblPrice.Text.Split(' ');
            drCart.UnitPrice = decimal.Parse(price[0]);
        }

        drCart.IsPromotion = (rdIsPromotion.SelectedValue == "1" ? true : false);
        drCart.IsProduct = true;
        drCart.IsNewProduct = hidRdRecon.Value == "1" ? false : true;

        if (Common.IsNum(txtQuantity.Text) && int.Parse(txtQuantity.Text) <= 9999)
            drCart.Quantity = int.Parse(txtQuantity.Text);
        else
            drCart.Quantity = 1;

        drCart.CreatedBy = WebLib.LoggedInUser.DealerUserName;
        drCart.CreatedDate = DateTime.Now;
        drCart.ModifiedBy = WebLib.LoggedInUser.DealerUserName;
        drCart.ModifiedDate = DateTime.Now;

        ProductMachineItem productMachineItem = new ProductMachineItem();
        productMachineItem.dataRowCart = drCart;
        productMachineItem.dataSetCart = _dsCart;
        productMachineItem.productID = productID;

        return productMachineItem;
    }
    private void SetEditForm(RepeaterItem item, bool isEdit)
    {
        TextBox tbEditTitle = item.FindControl("tbEditTitle") as TextBox;
        TextBox tbEditDesc = item.FindControl("tbEditDesc") as TextBox;
        TextBox tbOrder = item.FindControl("tbOrder") as TextBox;
        Label lblTitle = item.FindControl("lblTitle") as Label;
        Label lblDesc = item.FindControl("lblDesc") as Label;
        Label lblOrder = item.FindControl("lblOrder") as Label;
        LinkButton lbEdit = item.FindControl("lbEdit") as LinkButton;
        LinkButton lbSave = item.FindControl("lbSave") as LinkButton;
        LinkButton lbDelete = item.FindControl("lbDelete") as LinkButton;
        LinkButton lbCancel = item.FindControl("lbCancel") as LinkButton;
        CheckBox cbActive = item.FindControl("cbActive") as CheckBox;

        tbEditTitle.Visible = tbEditDesc.Visible = tbOrder.Visible = lbSave.Visible = lbCancel.Visible = isEdit;
        lblTitle.Visible = lblDesc.Visible = lblOrder.Visible = lbEdit.Visible = lbDelete.Visible = !isEdit;

        cbActive.Enabled = isEdit;

        UpdatePanel upPan = item.FindControl("UpdatePanel1") as UpdatePanel;
        upPan.Update();
    }
    private void ToggleElements(RepeaterItem item, bool isEdit)
    {
        //Toggle Buttons.
        item.FindControl("editLink").Visible = !isEdit;
        item.FindControl("updateLink").Visible = isEdit;
        item.FindControl("cancelLink").Visible = isEdit;

        //Toggle Labels.
        item.FindControl("nameLabel").Visible = !isEdit;

        //Toggle TextBoxes.
        item.FindControl("EditName").Visible = isEdit;

        if (LeadershipDisplay.Items.FindByValue("Scholarships").Selected == true)
        {
            item.FindControl("sortLabel").Visible = !isEdit;
            item.FindControl("EditSort").Visible = isEdit;
            item.FindControl("establishedLabel").Visible = !isEdit;
            item.FindControl("EditEstablished").Visible = isEdit;

        }
        else if (LeadershipDisplay.Items.FindByValue("Founders").Selected == true)
        {
            item.FindControl("statusLabel").Visible = !isEdit;
            item.FindControl("EditStatus").Visible = isEdit;
        }
    }
    private void ToggleElements(RepeaterItem item, bool isEdit)
    {
        //Toggle Buttons.
        item.FindControl("editLink").Visible = !isEdit;
        item.FindControl("updateLink").Visible = isEdit;
        item.FindControl("cancelLink").Visible = isEdit;

        //Toggle Labels.
        item.FindControl("photoLabel").Visible = !isEdit;
        item.FindControl("nameLabel").Visible = !isEdit;
        item.FindControl("profileLabel").Visible = !isEdit;

        //Toggle TextBoxes.
        item.FindControl("EditPhoto").Visible = isEdit;
        item.FindControl("EditName").Visible = isEdit;
        item.FindControl("EditProfile").Visible = isEdit;
    }
    private void ToggleElements(RepeaterItem item, bool isEdit)
    {
        //Toggle Buttons.
            item.FindControl("editLink").Visible = !isEdit;
            item.FindControl("updateLink").Visible = isEdit;
            item.FindControl("cancelLink").Visible = isEdit;

            //Toggle Labels.
            item.FindControl("nameLabel").Visible = !isEdit;

            //Toggle TextBoxes.
            item.FindControl("EditName").Visible = isEdit;

        if (LeadershipDisplay.Items.FindByValue("AdvBoard").Selected == true)
        {
            item.FindControl("statusLabel").Visible = !isEdit;
            item.FindControl("EditStatus").Visible = isEdit;
        }
        else if (LeadershipDisplay.Items.FindByValue("ElecBoard").Selected == true)
        {
            item.FindControl("yearLabel").Visible = !isEdit;
            item.FindControl("EditYear").Visible = isEdit;
        }
    }
Esempio n. 41
0
 private void GetWidgetXml(string FolderName, RepeaterItem RPI)
 {
     try
     {
         DataSet DS = new DataSet();
         DS.ReadXml(Server.MapPath(string.Format("~/Widgets/{0}/Widget.xml", FolderName)));
         foreach (DataRow dRow in DS.Tables[0].Rows)
         {
             for (int i = 0; i < dRow.ItemArray.Length; i++)
             {
                 string property = DS.Tables[0].Columns[i].ColumnName;
                 Literal LC = (Literal)RPI.FindControl(property);
                 if (LC != null)
                 {
                     LC.Text = dRow[i].ToString();
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox1.Message = ex.Message;
         MessageBox1.Type = MessageBox.ShowType.Error;
     }
 }
    /// <summary>
    /// Loads the external edit control and sets visibility of other controls
    /// </summary>
    /// <param name="repeaterItem">Repeater item</param>
    /// <param name="type">Source type</param>
    private void LoadExternalEditControl(RepeaterItem repeaterItem, FileTypeEnum type)
    {
        var plcAttachmentActions = repeaterItem.FindControl("plcAttachmentActions") as PlaceHolder;
        var plcAttachmentUpdtAction = repeaterItem.FindControl("plcAttachmentUpdtAction") as PlaceHolder;
        var plcLibraryUpdtAction = repeaterItem.FindControl("plcLibraryUpdtAction") as PlaceHolder;
        var plcExt = repeaterItem.FindControl("plcExtEdit") as PlaceHolder;
        var plcExtMfi = repeaterItem.FindControl("plcExtEditMfi") as PlaceHolder;
        var pnlDisabledUpdate = (repeaterItem.FindControl("pnlDisabledUpdate") as Panel);
        var dfuLib = repeaterItem.FindControl("dfuElemLib") as DirectFileUploader;
        var dfu = repeaterItem.FindControl("dfuElem") as DirectFileUploader;
        var btnEdit = repeaterItem.FindControl("btnEdit") as WebControl;
        var btnDelete = repeaterItem.FindControl("btnDelete") as WebControl;

        if ((plcAttachmentActions != null) && (plcLibraryUpdtAction != null) && (plcAttachmentUpdtAction != null) && (plcExt != null)
            && (plcExtMfi != null) && (pnlDisabledUpdate != null) && (dfuLib != null) && (dfu != null) && (btnEdit != null) && (btnDelete != null))
        {
            var data = new DataRowContainer((DataRowView)repeaterItem.DataItem);

            plcAttachmentActions.Visible = true;
            plcAttachmentUpdtAction.Visible = false;
            pnlDisabledUpdate.Visible = false;
            dfuLib.Visible = false;
            dfu.Visible = false;
            btnEdit.Visible = false;
            btnDelete.Visible = false;
            plcExt.Visible = false;
            plcExtMfi.Visible = false;

            plcLibraryUpdtAction.Visible = (type == FileTypeEnum.MediaFile);

            ExternalEditHelper.LoadExternalEditControl(plcExt, type, null, data, IsLiveSite, TreeNodeObj, true);
        }
    }
Esempio n. 43
0
    private void BindContent(RepeaterItem item)
    {
        Label lblStudentName = (Label)item.FindControl("lblStudentName");
        lblStudentName.Text = studentList.Rows[item.ItemIndex]["FirstName"].ToString() + " " + studentList.Rows[item.ItemIndex]["LastName"].ToString();

        Label lblCurrGrade = (Label)item.FindControl("lblCurrGrade");
        lblCurrGrade.Text = "Grade " + portInfo.Rows[0]["GradeNumber"].ToString();

        strSQL = " select a.PathwayName" + SuffixCode() + ",b.ClusteName" + NonEngSuffixCode() + ",b.ClusterCode,b.ClusterType from ClusterPathways a JOIN ClusterCodes b ON a.ClusterID = b.ClusterID JOIN ClusterInstructions c ON b.ClusterType = c.ClusterName where PathwayID='" + strPathwayID + "'; ";
        strSQL += " select DiplomaNameShort" + SuffixCode() + ",convert(decimal(5,1),TotalCredits) TotalCredits from ClusterPOSDiploma where DiplomaID = " + strDiploma + "; ";

        string portfolioID = studentList.Rows[item.ItemIndex]["PortfolioID"].ToString();

        strSQL += " SELECT ui.InstitutionName FROM portfolio p inner join userinfo ui on p.schoolid = ui.schoolid ";
        strSQL += " WHERE p.portfolioID =" + portfolioID + ";";

        dtTables = CareerCruisingWeb.CCLib.Common.DataAccess.GetDataTables(strSQL);

        dtCluster = dtTables[0];
        dtDiploma = dtTables[1];
        dtSchool = dtTables[2];

        if (dtSchool.Rows.Count > 0)
        {
            Label lblSchool = (Label)item.FindControl("lblSchool");
            lblSchool.Text = dtSchool.Rows[0]["InstitutionName"].ToString();
        }
        if (dtCluster.Rows.Count > 0)
        {
            Label lblProgram = (Label)item.FindControl("lblProgram");
            lblProgram.Text = dtCluster.Rows[0]["PathwayName" + SuffixCode()].ToString();

            Label lblCluster = (Label)item.FindControl("lblCluster");
            lblCluster.Text = dtCluster.Rows[0]["ClusteName" + NonEngSuffixCode()].ToString();
        }
        if (dtDiploma.Rows.Count > 0)
        {
            Label lblDiploma = (Label)item.FindControl("lblDiploma");
            lblDiploma.Text = dtDiploma.Rows[0]["DiplomaNameShort_EN"].ToString();
        }
    }
Esempio n. 44
0
    private void BindContent(RepeaterItem rptMassPrintPLPItem)
    {
        strSQL = " select a.PathwayName" + CareerCruisingWeb.CCLib.Common.Strings.SuffixCode() + ",b.ClusteName" + CareerCruisingWeb.CCLib.Common.Strings.NonEngSuffixCode() + ",b.ClusterCode,b.ClusterType from ClusterPathways a JOIN ClusterCodes b ON a.ClusterID = b.ClusterID JOIN ClusterInstructions c ON b.ClusterType = c.ClusterName where PathwayID='" + strPathwayID + "'; ";
        strSQL += " select DiplomaNameShort" + CareerCruisingWeb.CCLib.Common.Strings.SuffixCode() + ",convert(decimal(5,1),TotalCredits) TotalCredits from ClusterPOSDiploma where DiplomaID = " + strDiplomaID + "; ";

        string portfolioID = studentList.Rows[rptMassPrintPLPItem.ItemIndex]["PortfolioID"].ToString();

        strSQL += " SELECT ui.InstitutionName FROM portfolio p inner join userinfo ui on p.schoolid = ui.schoolid ";
        strSQL += " WHERE p.portfolioID =" + portfolioID + ";";

        dtTables = CareerCruisingWeb.CCLib.Common.DataAccess.GetDataTables(strSQL);
        dtCluster = dtTables[0];
        dtDiploma = dtTables[1];
        dtSchool = dtTables[2];
        if (dtSchool.Rows.Count > 0)
        {
            Label lblSchool = (Label)rptMassPrintPLPItem.FindControl("lblSchool");
            lblSchool.Text = dtSchool.Rows[0]["InstitutionName"].ToString();
        }
        if (dtCluster.Rows.Count > 0)
        {
            Label lblProgram = (Label)rptMassPrintPLPItem.FindControl("lblProgram");
            lblProgram.Text = dtCluster.Rows[0]["PathwayName" + CareerCruisingWeb.CCLib.Common.Strings.SuffixCode()].ToString();

            Label lblCluster = (Label)rptMassPrintPLPItem.FindControl("lblCluster");
            lblCluster.Text = dtCluster.Rows[0]["ClusteName" + CareerCruisingWeb.CCLib.Common.Strings.NonEngSuffixCode()].ToString();
            strCluster = dtCluster.Rows[0]["ClusterCode"].ToString();
            strType = dtCluster.Rows[0]["ClusterType"].ToString();
        }
        if (dtDiploma.Rows.Count > 0)
        {
            Label lblDiploma = (Label)rptMassPrintPLPItem.FindControl("lblDiploma");
            lblDiploma.Text = dtDiploma.Rows[0]["DiplomaNameShort_EN"].ToString();
        }
        strSQL = " With CTE as ( ";
        strSQL += " SELECT POSSubjectID as Details, [9] as 'Grade 9',[10] as 'Grade 10',[11] as 'Grade 11',[12] as 'Grade 12' ";
        strSQL += " FROM (SELECT POSGridID,POSGrade,PosSubjectID FROM ClusterPOSGrid a join ClusterPOSSubjects b on a.PosSubjectID=b.PathwaySubjectID where b.ClusterName='" + strType + "') AS SourceTable ";
        strSQL += " PIVOT(max(POSGridID)FOR POSGrade IN ([9], [10], [11], [12])) AS PivotTable) ";
        strSQL += " select c.*,a.IsProgramOfStudy,a.PathwaySubjectName" + CareerCruisingWeb.CCLib.Common.Strings.SuffixCode() + ",a.Type,b.DetailDescr" + CareerCruisingWeb.CCLib.Common.Strings.SuffixCode() + ",case when isnull(b.credits,0)=0 then '&nbsp;' else 'Required: '+ convert(varchar(10),convert(decimal(5,1),b.Credits)) end Credits from CTE as c join ClusterPOSSubjects a on c.Details= a.PathwaySubjectID left join ClusterPOSDiplomaReq b on a.PathwaySubjectID = b.PathwaySubjectID where a.ClusterName='" + strType + "' and isnull(b.DiplomaID," + strDiplomaID + ")=" + strDiplomaID;
        strSQL += " order by Details ";
        dtSubject = CareerCruisingWeb.CCLib.Common.DataAccess.GetDataTable(strSQL);

        Repeater repeater = (Repeater)rptMassPrintPLPItem.FindControl("lstHS");

        repeater.DataSource = dtSubject;
        repeater.DataBind();
    }
Esempio n. 45
0
    void UpdateCart(int id, RepeaterItem item, CartType mode)
    {
        dsCart.CartRow drCart = da.Cart_GetDataByID(id);
        if (drCart != null)
        {
            #region Optional Items
            // Only applicable to machine
            if (mode == CartType.Machine)
            {
                Repeater repOptional = (Repeater)item.FindControl("repOptional");
                foreach (RepeaterItem itemOptional in repOptional.Items)
                {
                    HiddenField hidOptionalItemID = (HiddenField)itemOptional.FindControl("hidOptionalItemID");

                    TextBox txtOptionalQuantity = (TextBox)itemOptional.FindControl("txtOptionalQuantity");

                    dsCartOptionalItem.CartOptionalItemRow cartOptionalRow = da.CartOptionalItem_Get(int.Parse(hidOptionalItemID.Value));
                    if (Common.IsNum(txtOptionalQuantity.Text) && int.Parse(txtOptionalQuantity.Text) <= 9999)
                        cartOptionalRow.Quantity = int.Parse(txtOptionalQuantity.Text);
                    else
                        cartOptionalRow.Quantity = 1;

                    // Remove Item
                    if (cartOptionalRow.Quantity == 0)
                        cartOptionalRow.Delete();

                    da.CartOptionalItem_Update(cartOptionalRow);
                }
            }
            #endregion

            TextBox txtQuantity = (TextBox)item.FindControl("txtQuantity");
            if (Common.IsNum(txtQuantity.Text) && int.Parse(txtQuantity.Text) <= 9999)
                drCart.Quantity = int.Parse(txtQuantity.Text);
            else
                drCart.Quantity = 1;
            
            // Remove Item
            if (drCart.Quantity == 0)
                drCart.Delete();

            da.Cart_Update(drCart);

            MasterBase.Message = WebLib.UpdatedSuccessfullyMessage;
        }
    }
Esempio n. 46
0
    void appendChild(string rid, string pid, RepeaterItem pcontrols)
    {
        ArrayList pcheck = new ArrayList();
        purviewEntity[] childmenu = purviewBll.getChildida(pid);
        pcheck = purviewBll.getChildid(rid, pid);
        CheckBoxList chbl = (CheckBoxList)pcontrols.FindControl("chkchilds");

        chbl.DataSource = childmenu;
        chbl.DataTextField = "Menuname";
        chbl.DataValueField = "id";
        chbl.DataBind();

        for (int i = 0; i < childmenu.Length; i++)
        {
            chbl.Items[i].Selected = pcheck.Contains(childmenu[i].Id);
        }
    }
    private void ToggleElements(RepeaterItem item, bool isEdit)
    {
        //Toggle Buttons.
        item.FindControl("editLink").Visible = !isEdit;
        item.FindControl("updateLink").Visible = isEdit;
        item.FindControl("cancelLink").Visible = isEdit;

        if (LeadershipDisplay.Items.FindByValue("OutdoorsInfo").Selected == true)
        {
            item.FindControl("locationLabel").Visible = !isEdit;
            item.FindControl("EditLocation").Visible = isEdit;
            item.FindControl("nameLabel").Visible = !isEdit;
            item.FindControl("EditName").Visible = isEdit;
            item.FindControl("areaLabel").Visible = !isEdit;
            item.FindControl("EditArea").Visible = isEdit;
            item.FindControl("plaqueLabel").Visible = !isEdit;
            item.FindControl("EditPlaque").Visible = isEdit;
            item.FindControl("dedicationLabel").Visible = !isEdit;
            item.FindControl("EditDedication").Visible = isEdit;
        }
        else if (LeadershipDisplay.Items.FindByValue("ChapelInfo").Selected == true)
        {
            item.FindControl("levelLabel").Visible = !isEdit;
            item.FindControl("EditLevel").Visible = isEdit;
            item.FindControl("plaqueLabel").Visible = !isEdit;
            item.FindControl("EditPlaque").Visible = isEdit;
            item.FindControl("sortLabel").Visible = !isEdit;
            item.FindControl("EditSort").Visible = isEdit;
            item.FindControl("orderLabel").Visible = !isEdit;
            item.FindControl("EditOrder").Visible = isEdit;
        }
        else if (LeadershipDisplay.Items.FindByValue("ChapelInfo").Selected != true && LeadershipDisplay.Items.FindByValue("OutdoorsInfo").Selected != true)
        {
            item.FindControl("roomidLabel").Visible = !isEdit;
            item.FindControl("EditRoomId").Visible = isEdit;
            item.FindControl("nameLabel").Visible = !isEdit;
            item.FindControl("EditName").Visible = isEdit;
            item.FindControl("plaqueLabel").Visible = !isEdit;
            item.FindControl("EditPlaque").Visible = isEdit;
            item.FindControl("DateLabel").Visible = !isEdit;
            item.FindControl("EditDate").Visible = isEdit;
        }
    }