예제 #1
0
        /// <summary>
        /// 添加节点
        /// </summary>
        /// <param name="NodeName"></param>
        /// <param name="NodeIdentifier"></param>
        /// <param name="ParentID"></param>
        /// <param name="NodeMemo"></param>
        /// <param name="NodePic"></param>
        /// <param name="SortID"></param>
        /// <param name="IsRecom"></param>
        /// <param name="IsHtml"></param>
        /// <param name="HtmlPath"></param>
        /// <param name="NodeTemplate"></param>
        /// <param name="Meta_Description"></param>
        /// <param name="Meta_KeyWords"></param>
        /// <returns></returns>
        public int  AddNode(TNode Node)
        {
            int    stat             = 0;
            string Nodepath         = string.Empty;
            NameValueCollection nvc = new NameValueCollection();

            nvc.Add("@NodeName", Node.NodeName);
            nvc.Add("@NodeIdentifier", Node.NodeIdentifier);
            nvc.Add("@NodePath", Node.NodePath);
            nvc.Add("@NodeMemo", Node.NodeMemo);
            nvc.Add("@NodePic", Node.NodePic);
            nvc.Add("@SortID", Node.SortID.ToString());
            nvc.Add("@IsRecom", Node.IsRecom.ToString());
            nvc.Add("@IsHtml", Node.IsHtml.ToString());
            nvc.Add("@HtmlPath", Node.HtmlPath.ToString().Trim());
            nvc.Add("@NodeTemplate", Node.NodeTemplate.Trim());
            nvc.Add("@Meta_Description", Node.Meta_Description.Trim());
            nvc.Add("@Meta_KeyWords", Node.Meta_KeyWords.Trim());

            dh.Open();
            stat = dh.ExecuteNonQuery(CommandType.Text, "Insert into T_NodeList(NodeName,NodeIdentifier,NodePath,NodeMemo,NodePic,SortID,IsRecom,IsHtml,HtmlPath,NodeTemplate,Meta_Description,Meta_KeyWords) Values (@NodeName,@NodeIdentifier,@NodePath,@NodeMemo,@NodePic,@SortID,@IsRecom,@IsHtml,@HtmlPath,@NodeTemplate,@Meta_Description,@Meta_KeyWords)", nvc);
            dh.Close();

            UpdateNodePath(Node.ParentID, "", null);
            return(stat);
        }
예제 #2
0
        /// <summary>
        /// 添加管理员
        /// </summary>
        /// <param name="admin"></param>
        /// <returns></returns>
        public int AddAdmin(TAdmin admin)
        {
            #region 变量
            string Admin_UID = admin.Admin_UID;

            string   Admin_PWD      = admin.Admin_PWD;
            bool     Admin_Stat     = admin.Admin_Stat;
            string   Admin_RealName = admin.Admin_RealName;
            DateTime Admin_RegTime  = admin.Admin_RegTime;
            int      Admin_LogTimes = admin.Admin_LogTimes;
            string   Admin_Flag     = admin.Admin_Flag;
            int      sortid         = admin.SortID;
            #endregion
            string cmdtxt           = "Insert into T_Admin(Admin_UID,Admin_PWD,Admin_Stat,Admin_RealName,Admin_RegTime,Admin_LogTimes,Admin_Flag,SortID,IsDelete) values (@Admin_UID,@Admin_PWD,@Admin_Stat,@Admin_RealName,@Admin_RegTime,@Admin_LogTimes,@Admin_Flag,@SortID,0)";
            NameValueCollection nvc = new NameValueCollection();
            nvc.Add("@Admin_UID", Admin_UID);
            nvc.Add("@Admin_PWD", Admin_PWD);
            nvc.Add("@Admin_Stat", Admin_Stat.ToString());
            nvc.Add("@Admin_RealName", Admin_RealName);
            nvc.Add("@Admin_RegTime", Admin_RegTime.ToString());
            nvc.Add("@Admin_LogTimes", Admin_LogTimes.ToString());
            nvc.Add("@Admin_Flag", Admin_Flag);
            nvc.Add("@SortID", sortid.ToString());
            dh.Open();
            int stat = dh.ExecuteNonQuery(CommandType.Text, cmdtxt, nvc);
            dh.Close();
            return(stat);
        }
예제 #3
0
        /// <summary>
        /// 插入商家信息
        /// </summary>
        /// <param name="Shop"></param>
        /// <returns></returns>
        public int AddShop(TShop Shop)
        {
            int stat = 0;
            NameValueCollection nvc = new NameValueCollection();

            nvc.Add("@ShopTitle", Shop.ShopTitle);
            nvc.Add("@ShopETitle", Shop.ShopETitle);
            nvc.Add("@ShopPic", Shop.ShopPic);
            nvc.Add("@ShopMemo", Shop.ShopMemo);
            nvc.Add("@ShopProvince", Shop.ShopProvince);
            nvc.Add("@ShopCity", Shop.ShopCity);
            nvc.Add("@ShopArea", Shop.ShopArea);
            nvc.Add("@ShopLongitude", Shop.ShopLongitude);
            nvc.Add("@ShopLatitude", Shop.ShopLatitude);
            nvc.Add("@ShopRoute", Shop.ShopRoute);
            nvc.Add("@ShopOpenTime", Shop.ShopOpenTime);
            nvc.Add("@ShopTemplate", Shop.ShopTemplate);
            nvc.Add("@ShopAddtime", Shop.ShopAddtime.ToString());
            nvc.Add("@ShopAdder", Shop.ShopAdder);
            nvc.Add("@SortID", Shop.SortID.ToString());
            nvc.Add("@IsRecom", Shop.IsRecom.ToString());
            nvc.Add("@IsHtml", Shop.IsHtml.ToString());
            nvc.Add("@HtmlPath", Shop.HtmlPath);
            nvc.Add("@IsRemote", Shop.IsRemote.ToString());
            dh.Open();
            stat = dh.ExecuteNonQuery(CommandType.Text, "Insert into T_Shop(ShopTitle,ShopETitle,ShopPic,ShopMemo,ShopProvince,ShopCity,ShopArea,ShopLongitude,ShopLatitude,ShopRoute,ShopOpenTime,ShopTemplate,ShopAddtime,ShopAdder,SortID,IsRecom,IsHtml,HtmlPath,IsRemote) values(@ShopTitle,@ShopETitle,@ShopPic,@ShopMemo,@ShopProvince,@ShopCity,@ShopArea,@ShopLongitude,@ShopLatitude,@ShopRoute,@ShopOpenTime,@ShopTemplate,@ShopAddtime,@ShopAdder,@SortID,@IsRecom,@IsHtml,@HtmlPath,@IsRemote)", nvc);
            dh.Close();
            return(stat);
        }
예제 #4
0
        /// <summary>
        /// 添加省份
        /// </summary>
        /// <param name="province"></param>
        /// <returns></returns>
        public int AddProvince(TProvince province)
        {
            int stat = 0;

            #region 变量
            string code = province.code;
            string name = province.name;
            #endregion
            NameValueCollection nvc = new NameValueCollection();
            nvc.Add("@code", code);
            nvc.Add("@name", name);
            dh.Open();
            dh.ExecuteNonQuery(CommandType.Text, "Insert into province(code,name)values(@code,@name)", nvc);
            dh.Close();
            return(stat);
        }
예제 #5
0
        /// <summary>
        /// 添加品牌
        /// </summary>
        /// <param name="brand"></param>
        /// <returns></returns>
        public int AddBrand(TBrand brand)
        {
            int stat = 0;
            NameValueCollection nvc = new NameValueCollection();

            nvc.Add("@BrandName", brand.BrandName);
            nvc.Add("@IsRecom", brand.IsRecom.ToString());
            nvc.Add("@BrandMemo", brand.BrandMemo);
            nvc.Add("@BrandPic", brand.BrandPic);
            nvc.Add("@BrandTemplate", brand.BrandTemplate);
            nvc.Add("@IsHtml", brand.IsHtml.ToString());
            nvc.Add("@BrandHtmlPath", brand.BrandHtmlPath);
            nvc.Add("@IsRemote", brand.IsRemote.ToString());
            nvc.Add("@BrandAddtime", brand.BrandAddtime.ToString());
            nvc.Add("@BrandAdder", brand.BrandAdder.ToString());
            nvc.Add("@SortID", brand.SortID.ToString());
            dh.Open();
            stat = dh.ExecuteNonQuery(CommandType.Text, "Insert into T_Brand(BrandName,IsRecom,BrandMemo,BrandPic,BrandTemplate,IsHtml,BrandHtmlPath,IsRemote,BrandAddtime,BrandAdder,SortID) values(@BrandName,@IsRecom,@BrandMemo,@BrandPic,@BrandTemplate,@IsHtml,@BrandHtmlPath,@IsRemote,@BrandAddtime,@BrandAdder,@SortID)", nvc);
            dh.Close();
            return(stat);
        }
예제 #6
0
        /// <summary>
        /// 添加信息
        /// </summary>
        /// <param name="info"></param>
        /// <returns></returns>
        public int AddInfo(TInformation info)
        {
            #region  变量
            NameValueCollection nvc = new NameValueCollection();
            nvc.Add("@InfoTitle", info.InfoTitle);
            nvc.Add("@InfoSubMemo", info.InfoSubMemo);
            nvc.Add("@InfoMemo", info.InfoMemo);
            nvc.Add("@InfoPic", info.InfoPic);
            nvc.Add("@InfoType", info.InfoType.ToString());
            nvc.Add("@BrandID", info.BrandID.ToString());
            nvc.Add("@ShopID", info.ShopID.ToString());
            nvc.Add("@InfoStartTime", info.InfoStartTime);
            nvc.Add("@InfoEndTime", info.InfoEndTime);
            nvc.Add("@InfoFrom", info.InfoFrom);
            nvc.Add("@InfoAddTime", info.InfoAddTime.ToString());
            nvc.Add("@InfoAdder", info.InfoAdder);
            nvc.Add("@InfoClicks", info.InfoClicks.ToString());
            nvc.Add("@IsRecom", info.IsRecom.ToString());
            nvc.Add("@SortID", info.SortID.ToString());
            nvc.Add("@IsHtml", false.ToString());//默认没有生成html
            nvc.Add("@HtmlPath", info.HtmlPath);
            nvc.Add("@IsRemote", info.IsRemote.ToString());
            nvc.Add("@IsCheck", info.IsCheck.ToString());
            nvc.Add("@InfoCateID", info.InfoCateID.ToString());
            nvc.Add("@InfoETitle", info.InfoETitle);
            nvc.Add("@InfoTag", info.InfoTag);

            #endregion

            string cmdtxt = @"Insert into T_InfoList (InfoTitle,InfoSubMemo,InfoMemo,InfoPic,InfoType,BrandID,ShopID,InfoStartTime,InfoEndTime,InfoFrom,InfoAddTime,InfoAdder,InfoClicks,IsRecom,SortID,IsHtml,HtmlPath,IsRemote,IsCheck,InfoCateID,InfoETitle,InfoTag,IsDelete)
                            values
                            (@InfoTitle,@InfoSubMemo,@InfoMemo,@InfoPic,@InfoType,@BrandID,@ShopID,@InfoStartTime,@InfoEndTime,@InfoFrom,@InfoAddTime,@InfoAdder,@InfoClicks,@IsRecom,@SortID,@IsHtml,@HtmlPath,@IsRemote,@IsCheck,@InfoCateID,@InfoETitle,@InfoTag,0);
                           ";
            dh.Open();
            int stat = dh.ExecuteNonQuery(CommandType.Text, cmdtxt, nvc);
            dh.Close();

            return(stat);
        }