protected void lvTopicCategoryList_ItemDataBound(object sender, ListViewItemEventArgs e)
 {
     try
     {
         DBLL.OptionSysDBLL option = new DBLL.OptionSysDBLL();
         if (e.Item.ItemType == ListViewItemType.DataItem)
         {
             DBLL.clsTopic Topic       = new DBLL.clsTopic();
             int           nType       = 0;
             Label         lblnTopicID = (Label)e.Item.FindControl("lblnTopicID");
             if (int.TryParse(lblnTopicID.Text, out nType))
             {
                 nType = int.Parse(lblnTopicID.Text);
                 string sTopicName = Topic.Select_tb_TopicBynTopicID(nType).Rows[0]["sTopicNameCN"].ToString();
                 lblnTopicID.Text = sTopicName;
             }
             Label lblsTCategoryNameCN = (Label)e.Item.FindControl("lblsTCategoryNameCN");
             if (lblsTCategoryNameCN.Text.Length > 5)
             {
                 lblsTCategoryNameCN.Text = lblsTCategoryNameCN.Text.Substring(0, 5).ToString() + "....";
             }
             Label lblsTCategoryNameEN = (Label)e.Item.FindControl("lblsTCategoryNameEN");
             if (lblsTCategoryNameEN.Text.Length > 6)
             {
                 lblsTCategoryNameEN.Text = lblsTCategoryNameEN.Text.Substring(0, 6).ToString() + "....";
             }
         }
         ImageButton imgDelete = (ImageButton)e.Item.FindControl("imgDelete");
         imgDelete.OnClientClick = "javascript:if (confirm('" + option.GetOptionValue("FormatSetting", "CommandControl", "bIsDelete") + "')){$('#EntryForm').block({ message: null });}else{return false;}";
     }
     catch (Exception)
     {
     }
 }
Пример #2
0
    protected void lvTopicList_SelectedIndexChanging(object sender, ListViewSelectEventArgs e)
    {
        Label lblnID = (Label)lvTopicList.Items[e.NewSelectedIndex].FindControl("lblnTopicID");
        int   _nID   = 0;

        DBLL.clsTopic Topic = new DBLL.clsTopic();
        if (int.TryParse(lblnID.Text.Trim(), out _nID) && _nID > 0)
        {
            MultiView1.ActiveViewIndex = 1;
            DataTable dt = Topic.Select_tb_TopicBynTopicID(_nID);
            txtsTopicNameCN.Text      = dt.Rows[0]["sTopicNameCN"].ToString();
            txtsTopicNameEN.Text      = dt.Rows[0]["sTopicNameEN"].ToString();
            ddlnSorting.SelectedValue = dt.Rows[0]["nSorting"].ToString();
            hfTopicUpdateID.Value     = _nID.ToString();
        }
    }