Exemplo n.º 1
0
 /// <summary>
 /// 更新商户Staff
 /// </summary>
 /// <returns></returns>
 public int UpdateShopStaff(ShopStaffModel model)
 {
     var sqlStr = new StringBuilder("update coupon_shop_staff set ");
     sqlStr.Append(Helper.CreateField(model).Trim().TrimEnd(','));
     sqlStr.Append(" where innerid = @innerid");
     using (var conn = Helper.GetConnection())
     {
         var tran = conn.BeginTransaction();
         try
         {
             conn.Execute(sqlStr.ToString(), model, tran);
             tran.Commit();
             return 1;
         }
         catch (Exception ex)
         {
             LoggerFactories.CreateLogger().Write("更新商户Staff异常:", TraceEventType.Error, ex);
             tran.Rollback();
             return 0;
         }
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// 添加职员
 /// </summary>
 /// <returns></returns>
 public int AddShopStaff(ShopStaffModel model)
 {
     const string sql = "insert into coupon_shop_staff (innerid,shopid, loginname, staffname, sex, mobile, email, status, createdtime, modifiedtime) " +
                        "values (@innerid,@shopid, @loginname, @staffname, @sex, @mobile, @email, @status, @createdtime, @modifiedtime);";
     try
     {
         Helper.Execute(sql, model);
         return 1;
     }
     catch (Exception ex)
     {
         LoggerFactories.CreateLogger().Write("添加职员异常:", TraceEventType.Error, ex);
         return 0;
     }
 }