private string Get4gPart(NodeVO vo)
    {
        StringBuilder sb = new StringBuilder();

        //搜尋條件
        Dictionary<string, string> conditions = new Dictionary<string, string>();
        conditions.Add("NodeId", "5");
        conditions.Add("WarrantySuppliers", vo.Name);
        conditions.Add("Type", "1");
        conditions.Add("Flag", "1");
        conditions.Add("Order", string.Format("order by {0}", "p.WarrantySuppliers, p.Type, p.SortNo, p.PostId"));

        IList<PostVO> list = m_PostService.GetPostList(conditions);

        if (list != null && list.Count > 0)
        {
            sb.AppendFormat("<tr class='discount_list_contant'><td rowspan='{0}' class='discount_list_type discount_list_type_4G' >4G</td></tr>"
                , (list.Count + 1));

            for (int i = 0; i < list.Count; i++)
            {
                PostVO post = list[i];
                string lastCss = "";
                if (i <= list.Count - 1)
                {
                    lastCss = " discount_list_contant-last";
                }
                sb.AppendFormat("<tr class='discount_list_contant {0}'><td class='discount_list_pro'>{1}</td><td class='discount_list_dis'>{2}</td><td class='discount_list_pre'>{3}</td><td class='discount_list_tran'>{4}</td><td class='discount_list_con'>{5}</td></tr>"
                    , lastCss, post.Title, post.CustomField1, post.CustomField2, post.Summary, post.HtmlContent);
            }
        }

        return sb.ToString();
    }
    private string GetProductList(NodeVO vo)
    {
        StringBuilder sb = new StringBuilder();

        //搜尋條件
        string keyword = Request["keyword"];
        Dictionary<string, string> conditions = new Dictionary<string, string>();
        conditions.Add("NodeId", "4");
        conditions.Add("Flag", "1");
        conditions.Add("ProductKeyWord", keyword);
        conditions.Add("WarrantySuppliers", vo.Name);
        conditions.Add("Order", string.Format("order by {0}", "p.WarrantySuppliers, p.SortNo, p.PostId"));

        IList<PostVO> list = m_PostService.GetPostList(conditions);

        if (list != null && list.Count > 0)
        {
            for (int i = 0; i < list.Count; i++)
            {
                PostVO post = list[i];
                sb.AppendFormat("<tr onclick=\"window.location='product.aspx?id={0}';\" style='cursor:pointer;'><td class='product_ov_type'>{1}</td><td class='product_ov_price'>${2}</td></tr>"
                    , post.PostId, post.Title, post.SellPrice);
            }
        }

        return sb.ToString();
    }
 protected void btnAdd_Click(object sender, EventArgs e)
 {
     NodeVO nodeVO = new NodeVO();
     nodeVO.Name = txtNodeName.Text.Trim();
     nodeVO.SortNo = int.Parse(txtSortNo.Text.Trim());
     nodeVO.ParentNode = m_PostService.GetNodeById(m_NodeId); ;
     m_PostService.CreateNode(nodeVO);
     m_WebLogService.AddSystemLog(MsgVO.Action.新增, nodeVO);
     ClearUI();
     GetList();
 }
 /// <summary>
 /// 新增Node
 /// </summary>
 /// <param name="nodeVO">被新增的Node</param>
 /// <returns>新增後的Node</returns>
 public NodeVO CreateNode(NodeVO nodeVO)
 {
     //return PostDao.CreateNode(nodeVO);
     nodeVO = PostDao.CreateNode(nodeVO);
     if (nodeVO.SortNo == 0)
     {
         nodeVO.SortNo = nodeVO.NodeId;
         nodeVO = PostDao.UpdateNode(nodeVO);
     }
     return nodeVO;
 }
 private string GetSupplierTable(NodeVO vo)
 {
     StringBuilder sb = new StringBuilder();
     sb.AppendFormat("<div class='product_ov_br' id='pro_{0}'>", vo.NodeId);
     sb.AppendFormat("<div class='product_ovlogo' style=\"background-image:url('upload/{0}')\"></div>"
         , vo.PicFileName);
     sb.Append("<table class='product_ov'><tr><th class='product_ov_thtype'></th><th class='product_ov_thprice'></th></tr>");
     sb.Append("{0}");
     sb.Append("</table>");
     sb.Append("</div>");
     return sb.ToString();
 }
    private bool HasProduct(NodeVO vo)
    {
        StringBuilder sb = new StringBuilder();

        //搜尋條件
        string keyword = Request["keyword"];
        Dictionary<string, string> conditions = new Dictionary<string, string>();
        conditions.Add("NodeId", "4");
        conditions.Add("Flag", "1");
        conditions.Add("ProductKeyWord", keyword);
        conditions.Add("WarrantySuppliers", vo.Name);

        return m_PostService.GetPostCount(conditions) > 0;
    }
    private string GetProductList(NodeVO vo, IList<PromoteVO> promoteList)
    {
        StringBuilder sb = new StringBuilder();

        IList<PromoteVO> list = promoteList.Where(p => p.WarrantySuppliers.Equals(vo.Name)).ToList();

        if (list != null && list.Count > 0)
        {
            for (int i = 0; i < list.Count; i++)
            {
                PromoteVO promoteVO = list[i];
                sb.AppendFormat("<tr onclick=\"window.location='product.aspx?id={7}';\" style='cursor:pointer;'><td class='product_ov_type'>{0}</td><td class='product_ov_price'>${1}</td><td class='product_ov_price'>${2}</td><td class='product_ov_price'>${3}</td><td class='product_ov_price'>${4}</td><td class='product_ov_price'>${5}</td><td class='product_ov_price'>${6}</td></tr>"
                    , promoteVO.Title, promoteVO.SellPrice
                    , promoteVO.SellPriceW1
                    , promoteVO.SellPriceW2
                    , promoteVO.SellPriceW3
                    , promoteVO.SellPriceW4
                    , promoteVO.SellPriceW5
                    , promoteVO.Id);
            }
        }

        return sb.ToString();
    }
 private string GetSupplierTable2(NodeVO vo)
 {
     StringBuilder sb = new StringBuilder();
     sb.AppendFormat("<div class='product_ov_br' id='pro_{0}'>", vo.NodeId);
     sb.Append("<table class='product_ov' style='width: 100%;'><tr>");
     sb.AppendFormat("<th><div style='position: relative; height: 25px;'><img src='upload/{0}' width='94' height='42' style='position: absolute;' /></div></th>"
         , vo.PicFileName);
     sb.Append("<th class='promote_title'>單機價</th>");
     sb.AppendFormat("<th class='promote_title'>{0}</th>", GetPromoteTitle("中華電信"));
     sb.AppendFormat("<th class='promote_title'>{0}</th>", GetPromoteTitle("遠傳"));
     sb.AppendFormat("<th class='promote_title'>{0}</th>", GetPromoteTitle("台哥大"));
     sb.AppendFormat("<th class='promote_title'>{0}</th>", GetPromoteTitle("亞太電信"));
     sb.AppendFormat("<th class='promote_title'>{0}</th></tr>", GetPromoteTitle("台灣之星"));
     sb.Append("{0}");
     sb.Append("</table>");
     sb.Append("</div>");
     return sb.ToString();
 }
        private NodeVO CreateNode(string name, NodeVO parentNode, int sort, NodeVO.UnitType unitType, string filePath)
        {
            NodeVO rootNodeVO = new NodeVO();
            rootNodeVO.Name = name;
            rootNodeVO.ParentNode = parentNode;
            rootNodeVO.SortNo = sort;
            rootNodeVO.Flag = 1;
            rootNodeVO.CreatedBy = "admin";
            rootNodeVO.UpdatedBy = "admin";
            rootNodeVO.CreatedDate = DateTime.Now;
            rootNodeVO.UpdatedDate = DateTime.Now;
            rootNodeVO.UType = unitType;
            rootNodeVO.PicFileName = filePath;

            return m_PostService.CreateNode(rootNodeVO);
        }
Example #10
0
        /// <summary>
        /// 更新Node
        /// </summary>
        /// <param name="nodeVO">被更新的Node</param>
        /// <returns>更新後的Node</returns>
        public NodeVO UpdateNode(NodeVO nodeVO)
        {
            NHibernateDao.Update(nodeVO);

            return nodeVO;
        }
    private string GetProductList2(NodeVO vo, IList<PromoteVO> promoteList)
    {
        StringBuilder sb = new StringBuilder();

        IList<PromoteVO> list = promoteList.Where(p => p.WarrantySuppliers.Equals(vo.Name)).ToList();

        if (list != null && list.Count > 0)
        {
            for (int i = 0; i < list.Count; i++)
            {
                PromoteVO promoteVO = list[i];
                sb.AppendFormat("<tr><td class='product_ov_type'>{0}</td><td class='product_ov_price'>${1}</td><td class='product_ov_price'>${2}</td><td class='product_ov_price'>${3}</td><td class='product_ov_price'>${4}</td><td class='product_ov_price'>${5}</td><td class='product_ov_price'>${6}</td></tr>"
                    , promoteVO.Title, promoteVO.SellPrice
                    , promoteVO.SellPriceW1
                    , promoteVO.SellPriceW2
                    , promoteVO.SellPriceW3
                    , promoteVO.SellPriceW4
                    , promoteVO.SellPriceW5);
            }
        }

        return sb.ToString();
    }
 /// <summary>
 /// 更新Node
 /// </summary>
 /// <param name="nodeVO">被更新的Node</param>
 /// <returns>更新後的Node</returns>
 public NodeVO UpdateNode(NodeVO nodeVO)
 {
     return PostDao.UpdateNode(nodeVO);
 }
 /// <summary>
 /// 刪除Node
 /// </summary>
 /// <param name="nodeVO">被刪除的Node</param>
 public void DeleteNode(NodeVO nodeVO)
 {
     PostDao.DeleteNode(nodeVO);
 }
        private PostVO CreatePost(string title, NodeVO nodeVO, int sort, string linkUrl, string picFileName)
        {
            PostVO postVO = new PostVO();
            postVO.Node = nodeVO;
            postVO.Title = title;
            postVO.SortNo = sort;
            postVO.Flag = 1;
            postVO.CreatedBy = "admin";
            postVO.UpdatedBy = "admin";
            postVO.CreatedDate = DateTime.Now;
            postVO.UpdatedDate = DateTime.Now;
            postVO.ShowDate = DateTime.Today;
            postVO.LinkUrl = linkUrl;
            postVO.PicFileName = picFileName;

            return m_PostService.CreatePost(postVO);
        }
        private PostVO CreatePost(string title, NodeVO nodeVO, int sort, int type, string warrantySuppliers, string customField1, string customField2, string summary, string content)
        {
            PostVO postVO = new PostVO();
            postVO.Node = nodeVO;
            postVO.Title = title;
            postVO.SortNo = sort;
            postVO.Type = type;
            postVO.WarrantySuppliers = warrantySuppliers;
            postVO.CustomField1 = customField1;
            postVO.CustomField2 = customField2;
            postVO.Summary = summary;
            postVO.HtmlContent = content;
            postVO.Flag = 1;
            postVO.CreatedBy = "admin";
            postVO.UpdatedBy = "admin";
            postVO.CreatedDate = DateTime.Now;
            postVO.UpdatedDate = DateTime.Now;
            postVO.ShowDate = DateTime.Today;

            return m_PostService.CreatePost(postVO);
        }
        private PostVO CreatePost(string title, NodeVO nodeVO, int sort)
        {
            PostVO postVO = new PostVO();
            postVO.Node = nodeVO;
            postVO.Title = title;
            postVO.SortNo = sort;
            postVO.Flag = 1;
            postVO.CreatedBy = "admin";
            postVO.UpdatedBy = "admin";
            postVO.CreatedDate = DateTime.Now;
            postVO.UpdatedDate = DateTime.Now;
            postVO.ShowDate = DateTime.Today;

            return m_PostService.CreatePost(postVO);
        }
Example #17
0
 /// <summary>
 /// 刪除Node
 /// </summary>
 /// <param name="nodeVO">被刪除的Node</param>
 public void DeleteNode(NodeVO nodeVO)
 {
     NHibernateDao.Delete(nodeVO);
 }
 private string GetSupplierTable(NodeVO vo)
 {
     StringBuilder sb = new StringBuilder();
     sb.Append("<table class='discount_list border'>");
     sb.Append("<tr class='discount_list_title border'>");
     sb.AppendFormat("<th class='discount_list_img' style=\"background-image:url('upload/{1}')\"><a name='pro_{0}' id='pro_{0}'></a></th>"
         , vo.NodeId, vo.PicFileName);
     sb.Append("<th class='discount_list_pro bg_disfrom_pro'></th>");
     sb.Append("<th class='discount_list_dis bg_disfrom_dis'></th>");
     sb.Append("<th class='discount_list_pre bg_disfrom_pre'></th>");
     sb.Append("<th class='discount_list_tran bg_disfrom_tran'></th>");
     sb.Append("<th class='discount_list_con bg_disfrom_con'></th>");
     sb.Append("</tr>");
     sb.Append("{0}");
     sb.Append("{1}");
     sb.Append("</table>");
     return sb.ToString();
 }
Example #19
0
        /// <summary>
        /// 新增Node
        /// </summary>
        /// <param name="nodeVO">被新增的Node</param>
        /// <returns>新增後的Node</returns>
        public NodeVO CreateNode(NodeVO nodeVO)
        {
            NHibernateDao.Insert(nodeVO);

            return nodeVO;
        }
        private NodeVO CreateNode(string name, NodeVO parentNode, int sort)
        {
            NodeVO rootNodeVO = new NodeVO();
            rootNodeVO.Name = name;
            rootNodeVO.ParentNode = parentNode;
            rootNodeVO.SortNo = sort;
            rootNodeVO.Flag = 1;
            rootNodeVO.CreatedBy = "admin";
            rootNodeVO.UpdatedBy = "admin";
            rootNodeVO.CreatedDate = DateTime.Now;
            rootNodeVO.UpdatedDate = DateTime.Now;

            return m_PostService.CreateNode(rootNodeVO);
        }