Ejemplo n.º 1
0
 public int Insert(M_WX_ReplyMsg model)
 {
     if (model.IsDefault == 1)
     {
         DBCenter.UpdateSQL(TbName, "IsDefault=0", "Appid=" + model.AppId + " AND ID!=" + model.ID);
     }
     return(Sql.insertID(TbName, model.GetParameters(model), BLLCommon.GetParas(model), BLLCommon.GetFields(model)));
 }
Ejemplo n.º 2
0
 public int Insert(M_MisProLevel model)
 {
     if (!string.IsNullOrEmpty(model.CCUser) && !string.IsNullOrEmpty(model.ReferUser))
     {
         model.CCUser = StringHelper.RemoveRepeat(model.CCUser.Split(','), model.ReferUser.Split(','));
     }
     return(Sql.insert(strTableName, model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model)));
 }
Ejemplo n.º 3
0
        /// <summary>
        /// 复制某个广告
        /// </summary>
        /// <param name="adid"></param>
        /// <returns></returns>
        public static bool Advertisement_Copy(int adid)
        {
            M_Advertisement model = new M_Advertisement();
            B_Advertisement bll   = new B_Advertisement();

            model        = bll.SelReturnModel(adid);
            model.ADName = "复制" + model.ADName;
            return(Sql.insert(strTableName, model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model)) > 0);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 添加模型数据
        /// </summary>
        public int AddContent(DataTable ContentDT, string tbname)
        {
            int itemid = 0;

            if (!string.IsNullOrEmpty(tbname) && ContentDT.Rows.Count > 0)
            {
                itemid = DBCenter.Insert(tbname, BLLCommon.GetFields(ContentDT), BLLCommon.GetParas(ContentDT), BLLCommon.GetParameters(ContentDT).ToArray());
            }
            return(itemid);
        }
Ejemplo n.º 5
0
 /// <summary>
 /// 添加或更新
 /// </summary>
 public bool AddTips(M_GuestBook model)
 {
     if (model.GID < 1)
     {
         Sql.insertID(model.TbName, model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model));
     }
     else
     {
         Sql.UpdateByID(model.TbName, model.PK, model.GID, BLLCommon.GetFieldAndPara(model), model.GetParameters());
     }
     return(true);
 }
Ejemplo n.º 6
0
 /// <summary>
 /// 更新分级选项
 /// </summary>
 /// <param name="GradeOption">分级选项实例</param>
 /// <returns>成功状态</returns>
 public static bool UpdateDic(M_Grade model)
 {
     if (model.GradeID > 0)
     {
         return(Sql.UpdateByIDs(model.TbName, model.PK, model.GradeID.ToString(), BLLCommon.GetFieldAndPara(model), model.GetParameters(model)));
     }
     else
     {
         Sql.insertID(model.TbName, model.GetParameters(model), BLLCommon.GetParas(model), BLLCommon.GetFields(model));
     }
     return(true);
 }
Ejemplo n.º 7
0
 public int Insert(M_WX_User model)
 {
     if (string.IsNullOrEmpty(model.OpenID))
     {
         throw new Exception("微信用户的OpenID不能为空");
     }
     if (DBCenter.IsExist(TbName, "OpenID=@openid", new List <SqlParameter>()
     {
         new SqlParameter("openid", model.OpenID)
     }))
     {
         throw new Exception("该OpenID已存在,不可重复加入");
     }
     return(Sql.insertID(TbName, model.GetParameters(model), BLLCommon.GetParas(model), BLLCommon.GetFields(model)));
 }
Ejemplo n.º 8
0
 //写入至SQL
 public static int ToSQL(Model.ZLEnum.Log type, M_Log model)
 {
     EmptyDeal(type, model);
     try
     {
         int id = Sql.insertID(model.TbName, model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model));
         if (id % 200 == 0)
         {
             string sql = "DELETE FROM " + model.TbName + " WHERE (SELECT COUNT(ID) FROM " + model.TbName + ")> 30000 AND ID IN (SELECT TOP 10000 ID FROM " + model.TbName + " ORDER BY CDate ASC)";
             SqlHelper.ExecuteSql(sql);
         }
         return(id);
     }
     catch { return(0); }
 }
Ejemplo n.º 9
0
        public bool AddStock(M_Stock model)
        {
            string sqlStrs = "";

            if (model.stocktype == 0)
            {
                sqlStrs = "Update ZL_Commodities set Stock=Stock+" + model.Pronum + " where ID=" + model.proid;
            }
            else
            {
                sqlStrs = "Update ZL_Commodities set Stock=Stock-" + model.Pronum + " where ID=" + model.proid;
            }
            SqlHelper.ExecuteSql(sqlStrs);
            return(Sql.insertID(TbName, model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model)) > 0);
        }
Ejemplo n.º 10
0
 /// <summary>
 /// 修改模型数据
 /// </summary>
 public void UpdateContent(DataTable ContentDT, string tbname, int itemid)
 {
     //需要重处理
     if (ContentDT != null && ContentDT.Rows.Count > 0)
     {
         List <SqlParameter> splist = new List <SqlParameter>();
         splist.AddRange(BLLCommon.GetParameters(ContentDT));
         if (DBCenter.IsExist(tbname, "ID=" + itemid))
         {
             DBCenter.UpdateSQL(tbname, BLLCommon.GetFieldAndPara(ContentDT), "ID=" + itemid, splist);
         }
         else
         {
             DBCenter.Insert(tbname, BLLCommon.GetFields(ContentDT), BLLCommon.GetParas(ContentDT), splist.ToArray());
         }
     }
 }
Ejemplo n.º 11
0
 public static void ToCE(Model.ZLEnum.Log type, M_Log model)
 {
     try
     {
         string tbname = "ZL_Log4";
         EmptyDeal(type, model);
         SqlCEHelper.InsertID(constr, tbname, BLLCommon.GetFields(model), BLLCommon.GetParas(model), GetCESP(model));
         int ran = new Random().Next(0, 151);
         if (ran == 150)
         {
             int count = Convert.ToInt32(SqlCEHelper.ExecuteTable(constr, "SELECT COUNT(*) FROM " + tbname).Rows[0][0]);
             if (count > 30000)//如果数据大于3万条,则删除1万条
             {
                 string midsql = "SELECT * FROM " + tbname + " ORDER BY CDate DESC OFFSET 20000 ROWS FETCH NEXT 1 ROWS ONLY;";
                 int    id     = Convert.ToInt32(SqlCEHelper.ExecuteTable(constr, midsql).Rows[0][0]);
                 string delsql = "DELETE FROM " + tbname + " WHERE ID<" + id;
                 SqlCEHelper.ExecuteSql(constr, delsql);
             }
         }
     }
     catch { }
 }
Ejemplo n.º 12
0
 public int Insert(M_APP_APPTlp model)
 {
     return(Sql.insertID(TbName, model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model)));
 }
Ejemplo n.º 13
0
 //-----------------Insert
 public int Insert(M_Site_SiteList model)
 {
     return(Sql.insert(strTableName, model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model)));
 }
Ejemplo n.º 14
0
 public int GetInsert(M_Arrive model)
 {
     return(Sql.insert(TbName, model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model)));
 }
Ejemplo n.º 15
0
 public int Add(M_Payment model)
 {
     Check(model);
     return(Sql.insertID(TbName, model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model)));
 }
Ejemplo n.º 16
0
 public bool GetInsert(M_Card model)
 {
     return(Sql.insertID(TbName, model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model)) > 0);
 }
Ejemplo n.º 17
0
 public bool Add(M_Promotions model)
 {
     Sql.insertID(TbName, model.GetParameters(model), BLLCommon.GetParas(model), BLLCommon.GetFields(model));
     return(true);
 }
Ejemplo n.º 18
0
 public int insert(M_GiftCard_shop model)
 {
     return(Sql.insert(strTableName, model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model)));
 }
Ejemplo n.º 19
0
 /// <summary>
 /// 添加店铺模板
 /// </summary>
 /// <param name="sst"></param>
 public void InsertStoreStyle(M_StoreStyleTable model)
 {
     Sql.insert(strTableName, model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model));
 }
Ejemplo n.º 20
0
 /// <summary>
 /// 添加收藏信息到收藏夹
 /// </summary>
 /// <param name="favorite">收藏信息实例</param>
 public void AddFavorite(M_Favorite model)
 {
     Sql.insertID(TbName, model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model));
 }
Ejemplo n.º 21
0
 public int insert(M_MoneyManage model)
 {
     return(Sql.insertID(TbName, model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model)));
 }
Ejemplo n.º 22
0
 /// <summary>
 /// 添加数据字典分类
 /// </summary>
 /// <param name="info"></param>
 /// <returns></returns>
 public static bool AddCate(M_DicCategory model)
 {
     return(Sql.insertID(model.TbName, model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model)) > 0);
 }
Ejemplo n.º 23
0
 public int insert(M_Promotions model)
 {
     return(Sql.insertID(TbName, model.GetParameters(model), BLLCommon.GetParas(model), BLLCommon.GetFields(model)));
 }
Ejemplo n.º 24
0
 public bool Add(M_OrderList model)
 {
     Sql.insertID(TbName, model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model));
     return(true);
 }
Ejemplo n.º 25
0
 public int Insert(M_User_Plat model)
 {
     SyncUB(model);
     model.PK = "";
     return(Sql.insert(TbName, model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model)));
 }
Ejemplo n.º 26
0
 public int Adds(M_OrderList model)
 {
     return(Sql.insertID(TbName, model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model)));
 }
Ejemplo n.º 27
0
 public int insert(M_Flow model)
 {
     return(Sql.insert(strTableName, model.GetParameters(model), BLLCommon.GetParas(model), BLLCommon.GetFields(model)));
 }
Ejemplo n.º 28
0
 public int insert(M_GroupBuyList model)
 {
     return(Sql.insert(strTableName, initMod.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model)));
 }
Ejemplo n.º 29
0
 /// <summary>
 ///添加记录
 /// </summary>
 /// <param name="RoomActiveJoin"></param>
 /// <returns></returns>
 public bool GetInsert(M_RoomActiveJoin model)
 {
     return(Sql.insertID(TbName, model.GetParameters(model), BLLCommon.GetParas(model), BLLCommon.GetFields(model)) > 0);
 }
Ejemplo n.º 30
0
 public int insert(M_ChangeProduct model)
 {
     return(Sql.insert(strTableName, model.GetParameters(), BLLCommon.GetParas(model), BLLCommon.GetFields(model)));
 }