public int UpdateMenuLef(MenuLeft news)
 {
     var dao = new MenuLeftDAO();
     DateTime datetime = DateTime.Now;
     news.ChangedOn = datetime;
     int res = dao.UpdateMenuLef(news);
     return res;
 }
 public int AddMenuLef(MenuLeft news)
 {
     var dao = new MenuLeftDAO();
     DateTime datetime = DateTime.Now;
     news.CreatedOn = news.CreatedOn = datetime;
     dao.AddMenuLef(news);
     return news.Id;
 }
        public void AddMenuLef(MenuLeft menuLeft)
        {
            var paramArrs = new[]
                                {
                                    new SqlParameter("@Type", menuLeft.Type),
                                    new SqlParameter("@SubType", menuLeft.SubType),
                                    new SqlParameter("@ParentId", menuLeft.ParentId),
                                    new SqlParameter("@Position", menuLeft.Position),
                                    new SqlParameter("@Name", menuLeft.Name),
                                    new SqlParameter("@Link", menuLeft.Link),
                                    new SqlParameter("@CreatedOn", menuLeft.CreatedOn)
                                };

            menuLeft.Id = ExecuteToSingleOrDefault<int>("MenuLeft_Insert", paramArrs);
        }
 private string CreateMenu(MenuLeft menuLeft)
 {
     var bo = new MenuLeftBO();
     int res = bo.AddMenuLef(menuLeft);
     return Utils.ConvertToJsonString(res);
 }
 private void GenerateMenuParent(MenuLeft parent, StringBuilder htmlMenu)
 {
     htmlMenu.AppendFormat("<li>" +
                           "<div style='height: 20px;'>" +
                           "<div style='float: left; text-transform: uppercase;padding-top: 5px;'>{0}</div>" +
                           "<div style='float: right;'>" +
                           "<img onclick='editMenu({1}, true)' src='../Images/iEdit.png' width='16' title='Sửa' />" +
                           "<img onclick='deleteMenu({2})' src='../Images/iDelete.png' width='16' title='Xóa' />" +
                           "</div>" +
                           "</div>",
                           parent.Name, parent.Id, parent.Id);
 }
        public int UpdateMenuLef(MenuLeft menuLeft)
        {
            var paramArrs = new[]
                                {
                                    new SqlParameter("@Id", menuLeft.Id),
                                    new SqlParameter("@Type", menuLeft.Type),
                                    new SqlParameter("@SubType", menuLeft.SubType),
                                    new SqlParameter("@ParentId", menuLeft.ParentId),
                                    new SqlParameter("@Position", menuLeft.Position),
                                    new SqlParameter("@Name", menuLeft.Name),
                                    new SqlParameter("@Link", menuLeft.Link),
                                    new SqlParameter("@ChangedOn", menuLeft.ChangedOn)
                                };

            int retVal = ExecuteCommand("MenuLeft_Update", paramArrs);
            return retVal;
        }