Exemple #1
0
        public DataSet GetSuCaiPageList(string strWhere, int c, int pagesize, string cols)
        {
            DAL.WxSuCaiInfoDAL dal = new DAL.WxSuCaiInfoDAL();
            DataSet            ds  = dal.GetPageList(strWhere, c, pagesize, cols);
            DataTable          dt  = ds.Tables[2];

            if (dt.Rows.Count == 0)
            {
                return(ds);
            }

            dt.Columns.Add("DetailJson");
            List <string> li = new List <string>();

            foreach (DataRow dr in dt.Rows)
            {
                li.Add(dr["WxSuCaiInfoId"].ToString());
            }
            string WxSuCaiInfoIdStr = string.Join(",", li);

            DAL.WxSuCaiDetailDAL detailDal = new DAL.WxSuCaiDetailDAL();
            DataSet   dsDetail             = detailDal.GetList(" WxSuCaiInfoId in (" + WxSuCaiInfoIdStr + ") ");
            DataTable dtDetail             = dsDetail.Tables[0];

            foreach (DataRow dr in dt.Rows)
            {
                DataTable dj = Common.DataSetting.TableSelect(" WxSuCaiInfoId='" + dr["WxSuCaiInfoId"] + "' ", dtDetail);

                dr["DetailJson"] = Common.JsonHelper.ToJson(dj);
            }
            return(ds);
        }
Exemple #2
0
        /// <summary>
        /// 保存一个素材主体
        /// </summary>
        /// <param name="model"></param>
        public void SaveSuCaiInfo(Model.WxSuCaiInfoModel model)
        {
            DAL.WxSuCaiInfoDAL dal = new DAL.WxSuCaiInfoDAL();



            if (model.WxSuCaiInfoId == 0)
            {
                //新增
                model.CreateTime = DateTime.Now;

                dal.Add(model);
            }
            else
            {
                //修改
                dal.Update(model);
            }
        }
Exemple #3
0
 public Model.WxSuCaiInfoModel GetSuCaiInfoModel(decimal WxSuCaiInfoId)
 {
     DAL.WxSuCaiInfoDAL dal = new DAL.WxSuCaiInfoDAL();
     return(dal.GetModel(WxSuCaiInfoId));
 }