protected void ASPxTreeList1_HtmlDataCellPrepared(object sender, TreeListHtmlDataCellEventArgs e)
        {
            if (e.Column.FieldName == "Status")
            {
                string fileName = string.Empty;
                switch ((string)e.CellValue)
                {
                case "deleted":
                    fileName = "~/Images/deleted.png";
                    break;

                case "saved":
                    fileName = "~/Images/saved.png";
                    break;
                }
                ASPxImage img = (ASPxImage)ASPxTreeList1.FindDataCellTemplateControl(e.NodeKey, e.Column, "ASPxImage1");
                if (fileName != string.Empty)
                {
                    img.ImageUrl = fileName;
                }
                else
                {
                    img.Visible = false;
                }
            }
        }
Esempio n. 2
0
 protected void treeList_HtmlDataCellPrepared(object sender, TreeListHtmlDataCellEventArgs e)
 {
     if (Object.Equals(e.GetValue("IsNew"), true))
     {
         e.Cell.Font.Bold = true;
     }
 }
Esempio n. 3
0
        protected void treelistCurrency_HtmlDataCellPrepared(object sender, TreeListHtmlDataCellEventArgs e)
        {
            try
            {
                ASPxTreeList tree = sender as ASPxTreeList;
                TreeListNode node = tree.FindNodeByKeyValue(e.NodeKey);
                NAS.DAL.Accounting.Currency.Currency currency = node.DataItem as NAS.DAL.Accounting.Currency.Currency;

                if (currency != null)
                {
                    //Setting Description for node
                    if (e.Column.Name == "Description" && e.Level > 1)
                    {
                        e.Cell.Text = String.Format("1 {0} = {1} {2}",
                                                    currency.ParentCurrencyId.Name,
                                                    currency.NumRequired,
                                                    currency.Name);
                    }
                    else if (e.Column.Name == "Description" && e.Level == 1)
                    {
                        e.Cell.Text = String.Format("Là đơn vị cao nhất");
                    }

                    if (e.Column.FieldName == "NumRequired" && e.Level == 1)
                    {
                        e.Cell.Text = string.Empty;
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
Esempio n. 4
0
        protected void grdProductUnit_HtmlDataCellPrepared(object sender, TreeListHtmlDataCellEventArgs e)
        {
            //Setting numberRequired
            ASPxTreeList tree = sender as ASPxTreeList;

            if (e.Column.FieldName == "NumRequired" && e.Level == 1)
            {
                e.Cell.Text = "";
            }

            //Setting Description for node
            if (e.Column.Name == "Description")
            {
                TreeListNode node = tree.FindNodeByKeyValue(e.NodeKey);

                NAS.DAL.Nomenclature.Item.ItemUnit currentItem = (NAS.DAL.Nomenclature.Item.ItemUnit)node.DataItem;
                if (e.Level > 1)
                {
                    NAS.DAL.Nomenclature.Item.ItemUnit parentItem = (NAS.DAL.Nomenclature.Item.ItemUnit)node.ParentNode.DataItem;
                    e.Cell.Text = String.Format("1 {0} bao gồm {1} {2}",
                                                parentItem.UnitId.Name,
                                                currentItem.NumRequired,
                                                currentItem.UnitId.Name);
                }
                else
                {
                    e.Cell.Text = String.Format("{0} là đơn vị tính cao nhất",
                                                currentItem.UnitId.Name);
                }
            }
        }
 protected void tree_HtmlDataCellPrepared(object sender, TreeListHtmlDataCellEventArgs e)
 {
     if (MyProvider.EditList.Contains(e.NodeKey))
     {
         e.Cell.Style["padding"] = "1px";
     }
 }
Esempio n. 6
0
 protected void ASPxTreeList1_HtmlDataCellPrepared(object sender, TreeListHtmlDataCellEventArgs e)
 {
     if (e.Column.Caption == "Loại Tài Khoản")
     {
         try
         {
             e.Cell.Text = session.GetObjectByKey <AccountType>(Guid.Parse(e.CellValue.ToString())).Name;
         }
         catch (Exception)
         {
             e.Cell.Text = "";
         }
     }
 }
Esempio n. 7
0
        protected void treeList_HtmlDataCellPrepared(object sender, TreeListHtmlDataCellEventArgs e)
        {
            TreeListNode node       = treeList.FindNodeByKeyValue(e.NodeKey);
            TreeListNode parentNode = node.ParentNode;
            bool         canRestore = true;

            if (parentNode != null && parentNode["status"] != null)
            {
                int pstatus = -1;
                int.TryParse(parentNode["status"].ToString(), out pstatus);

                if (pstatus >= 4)
                {
                    canRestore = false;
                }
            }
            string status = node["status"].ToString();

            if (e.Column.FieldName == "VisibleText")
            {
                string    fileName   = string.Empty;
                ASPxImage imgTrash   = null;
                ASPxImage imgRestore = null;
                ASPxImage imgNew     = null;

                e.Cell.ToolTip = e.NodeKey;

                if (e.NodeKey == "*")  //place holder for the trash icon
                {
                    fileName         = "~/Images/recycle1.png";
                    imgTrash         = (ASPxImage)treeList.FindDataCellTemplateControl(e.NodeKey, e.Column, "Trash");
                    imgTrash.Visible = true;
                }
                else if (e.NodeKey.Contains("*") & e.NodeKey != "*")  //deleted items
                {
                    //make restore visible
                    if (canRestore)
                    {
                        imgRestore         = (ASPxImage)treeList.FindDataCellTemplateControl(e.NodeKey, e.Column, "Restore");
                        imgRestore.Visible = true;
                    }
                }
                else if (status == "1") //status =1 - new item
                {
                    imgNew         = (ASPxImage)treeList.FindDataCellTemplateControl(e.NodeKey, e.Column, "New");
                    imgNew.Visible = true;
                }
            }
        }
Esempio n. 8
0
    protected void ASPxTreeList1_HtmlDataCellPrepared(object sender, TreeListHtmlDataCellEventArgs e)
    {
        if (e.Column.FieldName.Equals("LastName"))
        {
            String filterText = SearchText.Text;
            String value      = e.CellValue.ToString();
            int    startPos   = GetStartPos(filterText, value);
            if (startPos < 0)
            {
                return;
            }

            e.Cell.Text = GetHighlightedText(startPos, filterText, value);
        }
    }
Esempio n. 9
0
 protected void InfoTree_HtmlDataCellPrepared(object sender, TreeListHtmlDataCellEventArgs e)
 {
     if (e.Column.Caption == "状态")
     {
         string value = e.CellValue.ToString().Trim();
         if (value == "编辑")
         {
             e.Cell.ForeColor = Color.Blue;
         }
         if (value == "启用")
         {
             e.Cell.ForeColor = Color.Red;
         }
         if (value == "禁用")
         {
             e.Cell.ForeColor = Color.Cornsilk;
         }
     }
 }
Esempio n. 10
0
        protected void treelstMaterialUnits_HtmlDataCellPrepared(object sender, TreeListHtmlDataCellEventArgs e)
        {
            //Setting numberRequired
            ASPxTreeList tree = sender as ASPxTreeList;

            if (e.Column.FieldName == "NumRequired" && e.Level == 1)
            {
                e.Cell.Text = "";
            }

            //Setting Description for node
            if (e.Column.FieldName == "Description" && e.Level > 2)
            {
                TreeListNode node = tree.FindNodeByKeyValue(e.NodeKey);
                //ViewMaterialUnitConstruction parentItem = (ViewMaterialUnitConstruction)node.ParentNode.DataItem;
                //ViewMaterialUnitConstruction currentItem = (ViewMaterialUnitConstruction)node.DataItem;
                //e.Cell.Text = String.Format("1 {0} bao gồm {1} {2}", parentItem.Name, currentItem.NumRequired, currentItem.Name);
            }
        }
Esempio n. 11
0
        void treeList_HtmlDataCellPrepared(object sender, TreeListHtmlDataCellEventArgs e)
        {
            string textToSearch = findNodeAction.Value as String;

            if (!String.IsNullOrEmpty(textToSearch) && e.CellValue != null)
            {
                string propertyValue = e.CellValue.ToString();
                int    textIndex     = propertyValue.ToLower().IndexOf(textToSearch.ToLower());
                if (textIndex >= 0)
                {
                    int spanLength = ("<span class='highlight'>").Length;
                    propertyValue = propertyValue.Insert(textIndex, "<span class='highlight'>");
                    propertyValue = propertyValue.Insert(textIndex + spanLength + textToSearch.Length, "</span>");
                    Label label = new Label();
                    label.Text = propertyValue;
                    e.Cell.Controls.Clear();
                    e.Cell.Controls.Add(label);
                }
            }
        }
Esempio n. 12
0
        protected void treelstToolUnits_HtmlDataCellPrepared(object sender, TreeListHtmlDataCellEventArgs e)
        {
            ASPxTreeList tree = sender as ASPxTreeList;

            if (e.Column.FieldName == "NumRequired" && (e.Level == 1 || e.Level == 2))
            {
                e.Cell.Text = "1";
            }

            if (e.Column.FieldName == "Description" && e.Level == 2)
            {
                TreeListNode node = tree.FindNodeByKeyValue(e.NodeKey);
                //ViewToolUnitConstruction parentItem = (ViewToolUnitConstruction)node.ParentNode.DataItem;
                //ViewToolUnitConstruction currentItem = (ViewToolUnitConstruction)node.DataItem;
                //e.Cell.Text = String.Format("CCDC có Đơn vị tính cao nhất là {0}", currentItem.Name);
            }
            else if (e.Column.FieldName == "Description" && (e.Level != 1 && e.Level != 2))
            {
                TreeListNode node = tree.FindNodeByKeyValue(e.NodeKey);
                //ViewToolUnitConstruction parentItem = (ViewToolUnitConstruction)node.ParentNode.DataItem;
                //ViewToolUnitConstruction currentItem = (ViewToolUnitConstruction)node.DataItem;
                //e.Cell.Text = String.Format("1 {0} bao gồm {1} {2}", parentItem.Name, currentItem.NumRequired, currentItem.Name);
            }
        }
Esempio n. 13
0
 protected void RegCompList_HtmlDataCellPrepared(object sender, TreeListHtmlDataCellEventArgs e)
 {
     if (e.Column.Name == "Etl")
     {
         TreeListNode node = RegCompTreeList.FindNodeByKeyValue(e.NodeKey);
         if (Convert.ToInt32(node["EtlID"]) > -1) e.Cell.BackColor = Color.DarkSeaGreen;
         else e.Cell.BackColor = Color.DarkSalmon;
     }
     else if (e.Column.Name == "Reg")
     {
         TreeListNode node = RegCompTreeList.FindNodeByKeyValue(e.NodeKey);
         if (Convert.ToInt32(node["RegID"]) > -1)
         {
             if ((node["Reg"] == null && node["Etl"] == null) || (node["Reg"] != null && node["Etl"] != null && node["Reg"].ToString() == node["Etl"].ToString())) e.Cell.BackColor = Color.DarkSeaGreen;
             else e.Cell.BackColor = Color.Gold;
         }
         else e.Cell.BackColor = Color.DarkSalmon;
     }
 }
Esempio n. 14
0
 protected void RegTreeList_HtmlDataCellPrepared(object sender, TreeListHtmlDataCellEventArgs e)
 {
     TreeListNode node = RegTreeList.FindNodeByKeyValue(e.NodeKey);
     if (node == null) return;
     switch (e.Column.Name)
     {
         case "Text":
             List<long> rschparids = Session["rschparids"] != null ? (List<long>)Session["rschparids"] : null;
             List<long> rschparids2 = Session["rschparids2"] != null ? (List<long>)Session["rschparids2"] : null;
             if ((rschparids != null && rschparids.Contains(Convert.ToInt64(node["EtlID"]))) || (rschparids2 != null && rschparids2.Contains(Convert.ToInt64(node["EtlID"])))) e.Cell.BackColor = Color.LightBlue;
             break;
         case "Etl":
             if (Convert.ToInt32(node["EtlID"])>-1) e.Cell.BackColor = Color.DarkSeaGreen;
             else e.Cell.BackColor = Color.DarkSalmon;
             break;
         case "Reg":
             if (Convert.ToInt32(node["RegID"]) > -1)
             {
                 if ((node["Reg"] == null && node["Etl"] == null)||(node["Reg"] != null && node["Etl"] != null && node["Reg"].ToString() == node["Etl"].ToString())) e.Cell.BackColor = Color.DarkSeaGreen;
                 else e.Cell.BackColor = Color.Gold;
             }
             else e.Cell.BackColor = Color.DarkSalmon;
             break;
         case "Reg2":
             if (Convert.ToInt32(node["RegID2"]) > -1)
             {
                 if ((node["Reg2"] == null && node["Etl"] == null) || (node["Reg2"] != null && node["Etl"] != null && node["Reg2"].ToString() == node["Etl"].ToString())) e.Cell.BackColor = Color.DarkSeaGreen;
                 else e.Cell.BackColor = Color.Gold;
             }
             else e.Cell.BackColor = Color.DarkSalmon;
             break;
     }
 }
    protected void treeList_HtmlDataCellPrepared(object sender, TreeListHtmlDataCellEventArgs e)
    {
        if (e.Column.FieldName == "ORG_NAME")
        {
            if (e.CellValue != null)
            {
                string cellValue = e.CellValue.ToString();
                e.Cell.ToolTip = cellValue;
                if (cellValue.Length > TextMaxLength_ORG)
                {
                    e.Cell.Text = cellValue.Substring(0, TextMaxLength_ORG) + "...";
                }
            }
        }
        if (e.Column.FieldName == "POS_NAME")
        {
            if (e.CellValue != null)
            {
                string cellValue = e.CellValue.ToString();
                e.Cell.ToolTip = cellValue;
                if (cellValue.Length > TextMaxLength_POS)
                {
                    string strText = cellValue.Substring(0, TextMaxLength_POS) + "...";
                    e.Cell.Text = cellValue.Replace(cellValue.ToString(), strText);

                    //e.Cell.Text = cellValue.Substring(0, TextMaxLength_POS) + "...";

                }
            }
        }
    }
 protected void ASPxTreeList1_HtmlDataCellPrepared(object sender, TreeListHtmlDataCellEventArgs e)
 {
     e.Cell.CssClass = "customClass";
 }
 protected void ASPxTreeList1_HtmlDataCellPrepared(object sender, TreeListHtmlDataCellEventArgs e)
 {
     e.Cell.Attributes.Add("onclick", "onCellClick(" + e.NodeKey + ", '" + e.Column.FieldName + "')");
 }