예제 #1
0
 public static int SaveAliPayBaoYangItem(AliPayBaoYangItem model)
 {
     using (var dbhelper = new SqlDbHelper(ConnectionHelper.GetDecryptConn("ThirdParty")))
     {
         var cmd = new SqlCommand(@"INSERT INTO [dbo].[AliPayBaoYangItem]
    ([KeyWord] ,[IsDisabled],[CreateTime],[UpdateTime]) values
     (@keyword,@isdisabled,@createtime,@updatetime)");
         cmd.CommandType = CommandType.Text;
         DateTime datetime = DateTime.Now;
         cmd.Parameters.AddWithValue("@keyword", model.KeyWord);
         cmd.Parameters.AddWithValue("@isdisabled", model.IsDisabled);
         cmd.Parameters.AddWithValue("@createtime", datetime);
         cmd.Parameters.AddWithValue("@updatetime", datetime);
         return(Convert.ToInt32(dbhelper.ExecuteNonQuery(cmd)));
     }
 }
예제 #2
0
 public static int UpdateAliPayBaoYangItem(AliPayBaoYangItem model)
 {
     using (var dbhelper = new SqlDbHelper(ConnectionHelper.GetDecryptConn("ThirdParty")))
     {
         var cmd = new SqlCommand(@"update [dbo].[AliPayBaoYangItem]
       set KeyWord=@keyword,
       IsDisabled=@isdisabled,
       UpdateTime=@updatetime where PKID=@pkid");
         cmd.CommandType = CommandType.Text;
         DateTime datetime = DateTime.Now;
         cmd.Parameters.AddWithValue("@pkid", model.PKID);
         cmd.Parameters.AddWithValue("@keyword", model.KeyWord);
         cmd.Parameters.AddWithValue("@isdisabled", model.IsDisabled);
         cmd.Parameters.AddWithValue("@updatetime", datetime);
         return(Convert.ToInt32(dbhelper.ExecuteNonQuery(cmd)));
     }
 }
        public ActionResult AddAlipayBaoYangItem(AliPayBaoYangItem item)
        {
            bool flag = false;

            try
            {
                List <AliPayBaoYangItem> items = AliPayBaoYangManage.GetAliPayBaoYangItem(-1);
                if (items != null)
                {
                    if (!items.Where(q => q != null).Any(p => p.KeyWord.Equals(item.KeyWord, StringComparison.OrdinalIgnoreCase)))
                    {
                        AliPayBaoYangManage.SaveAliPayBaoYangItem(item);
                        flag = true;
                    }
                }
            }
            catch (Exception ex)
            {
                WebLog.LogException(ex);
            }
            return(Json(flag, JsonRequestBehavior.AllowGet));
        }
        public ActionResult UpdateAlipayBaoYangItem(AliPayBaoYangItem item)
        {
            int result = AliPayBaoYangManage.UpdateAliPayBaoYangItem(item);

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
예제 #5
0
 public static int UpdateAliPayBaoYangItem(AliPayBaoYangItem model)
 {
     return(DALAliPayBaoYang.UpdateAliPayBaoYangItem(model));
 }
예제 #6
0
 public static int SaveAliPayBaoYangItem(AliPayBaoYangItem model)
 {
     return(DALAliPayBaoYang.SaveAliPayBaoYangItem(model));
 }