/// <summary> /// 判断优惠券是否存在 /// </summary> /// <param name="couponCode"></param> /// <returns></returns> public bool isExistCoupon(string couponCode) { AdjDBObject adjDbObject = new AdjDBObject(); adjDbObject.GetSqlStringCommand("select count(1) from d_youhui where Youhuima = @Youhuima"); adjDbObject.AddInParameter("@Youhuima", System.Data.DbType.String, couponCode); return Convert.ToInt32(adjDbObject.ExecuteScalar()) > 0; }
/// <summary> /// 获取订单预约种子数 /// </summary> /// <returns></returns> public int SelectSeqOrder() { AdjDBObject adjdbobject = new AdjDBObject(); try { string cmdtext = "INSERT INTO D_SeqOrder DEFAULT VALUES SELECT @@IDENTITY"; adjdbobject.GetSqlStringCommand(cmdtext); return int.Parse(adjdbobject.ExecuteScalar().ToString()); } catch (Exception ex) { return 0; } }
/// <summary> /// 根据sign获取当天访问量 /// </summary> /// <param name="sign"></param> /// <returns></returns> public int GetcountBysign(string sign) { int cou = 0; try { AdjDBObject adjDbObject = new AdjDBObject(); string cmdtext = "select count(*) as counts from T_ParterDyLog where sign=@sign and addtime between'" + DateTime.Now.ToString("yyyy-MM-dd") + "' and '" + DateTime.Now.AddDays(1).ToString("yyyy-MM-dd") + "' "; adjDbObject.GetSqlStringCommand(cmdtext); adjDbObject.AddInParameter("@sign", DbType.String, sign); cou = int.Parse(adjDbObject.ExecuteScalar().ToString()); } catch (Exception ex) { cou = 0; } return cou; }
/// <summary> /// 获取派单编号种子 /// </summary> /// <returns></returns> public int SelectSeqOrder() { AdjDBObject adjDbObject = new AdjDBObject(); try { adjDbObject.GetSqlStringCommand("INSERT INTO D_SeqOrder DEFAULT VALUES SELECT @@IDENTITY"); object obj = adjDbObject.ExecuteScalar(); if (obj != null) return Convert.ToInt32(obj); else return 0; } catch (Exception) { return 0; } }