Beispiel #1
0
        /// <summary>
        /// 删除Goodsparam
        /// </summary>
        /// <param name="GoodsParamId"></param>
        /// <returns></returns>
        public bool DeleteGoodsParam(int GoodsParamId)
        {
            GoodsParam gp = new GoodsParam();

            gp.Id = GoodsParamId;
            return(gp.Delete());
        }
Beispiel #2
0
        /// <summary>
        /// 批量导入数据
        /// </summary>
        /// <param name="TypeId"></param>
        /// <param name="dtParams"></param>
        public void SaveTypeParams(int TypeId, DataTable dtParams)
        {
            string sql = string.Format(" delete from GoodsParam where typeId={0} ", TypeId);

            if (m_dbo.ExecuteNonQuery(sql))
            {
                foreach (DataRow row in dtParams.Rows)
                {
                    GoodsParam gp = new GoodsParam();
                    gp.IsGroup = DBTool.GetIntFromRow(row, "IsGroup", 0);
                    gp.Name    = DBTool.GetStringFromRow(row, "Name", "");
                    gp.Sort    = DBTool.GetIntFromRow(row, "Sort", 0);
                    gp.TypeId  = TypeId;
                    gp.Save();
                }
            }
        }