Exemple #1
0
        public int Insert(SaleGiftInfo oParam)
        {
            string sql = @"INSERT INTO Sale_Gift
                           (
                           ProductSysNo, GiftSysNo, ListOrder,
                           CreateUserSysNo)
                           VALUES (
                           @ProductSysNo, @GiftSysNo, @ListOrder,
                           @CreateUserSysNo)";

            SqlCommand cmd = new SqlCommand(sql);

            SqlParameter paramProductSysNo = new SqlParameter("@ProductSysNo", SqlDbType.Int,4);
            SqlParameter paramGiftSysNo = new SqlParameter("@GiftSysNo", SqlDbType.Int,4);
            SqlParameter paramListOrder = new SqlParameter("@ListOrder", SqlDbType.NVarChar,10);
            SqlParameter paramCreateUserSysNo = new SqlParameter("@CreateUserSysNo", SqlDbType.Int,4);

            if ( oParam.ProductSysNo != AppConst.IntNull)
                paramProductSysNo.Value = oParam.ProductSysNo;
            else
                paramProductSysNo.Value = System.DBNull.Value;
            if ( oParam.GiftSysNo != AppConst.IntNull)
                paramGiftSysNo.Value = oParam.GiftSysNo;
            else
                paramGiftSysNo.Value = System.DBNull.Value;
            if ( oParam.ListOrder != AppConst.StringNull)
                paramListOrder.Value = oParam.ListOrder;
            else
                paramListOrder.Value = System.DBNull.Value;
            if ( oParam.CreateUserSysNo != AppConst.IntNull)
                paramCreateUserSysNo.Value = oParam.CreateUserSysNo;
            else
                paramCreateUserSysNo.Value = System.DBNull.Value;

            cmd.Parameters.Add(paramProductSysNo);
            cmd.Parameters.Add(paramGiftSysNo);
            cmd.Parameters.Add(paramListOrder);
            cmd.Parameters.Add(paramCreateUserSysNo);

            return SqlHelper.ExecuteNonQuery(cmd);
        }
Exemple #2
0
        public int Update(SaleGiftInfo oParam)
        {
            string sql = @"UPDATE Sale_Gift SET
                           Status=@Status,AbandonUserSysNo=@AbandonUserSysNo,
                           AbandonTime=@AbandonTime
                           WHERE SysNo=@SysNo";
            SqlCommand cmd = new SqlCommand(sql);

            SqlParameter paramSysNo = new SqlParameter("@SysNo", SqlDbType.Int,4);
            SqlParameter paramStatus = new SqlParameter("@Status", SqlDbType.Int,4);
            SqlParameter paramAbandonUserSysNo = new SqlParameter("@AbandonUserSysNo", SqlDbType.Int,4);
            SqlParameter paramAbandonTime = new SqlParameter("@AbandonTime", SqlDbType.DateTime);

            if ( oParam.SysNo != AppConst.IntNull)
                paramSysNo.Value = oParam.SysNo;
            else
                paramSysNo.Value = System.DBNull.Value;
            if ( oParam.Status != AppConst.IntNull)
                paramStatus.Value = oParam.Status;
            else
                paramStatus.Value = System.DBNull.Value;
            if ( oParam.AbandonUserSysNo != AppConst.IntNull)
                paramAbandonUserSysNo.Value = oParam.AbandonUserSysNo;
            else
                paramAbandonUserSysNo.Value = System.DBNull.Value;
            if ( oParam.AbandonTime != AppConst.DateTimeNull)
                paramAbandonTime.Value = oParam.AbandonTime;
            else
                paramAbandonTime.Value = System.DBNull.Value;

            cmd.Parameters.Add(paramSysNo);
            cmd.Parameters.Add(paramStatus);
            cmd.Parameters.Add(paramAbandonUserSysNo);
            cmd.Parameters.Add(paramAbandonTime);

            return SqlHelper.ExecuteNonQuery(cmd);
        }
Exemple #3
0
 private void map(SaleGiftInfo oParam, DataRow tempdr)
 {
     oParam.SysNo = Util.TrimIntNull(tempdr["SysNo"]);
     oParam.ProductSysNo = Util.TrimIntNull(tempdr["ProductSysNo"]);
     oParam.GiftSysNo = Util.TrimIntNull(tempdr["GiftSysNo"]);
     oParam.ListOrder = Util.TrimNull(tempdr["ListOrder"]);
     oParam.Status = Util.TrimIntNull(tempdr["Status"]);
     oParam.CreateUserSysNo = Util.TrimIntNull(tempdr["CreateUserSysNo"]);
     oParam.CreateTime = Util.TrimDateNull(tempdr["CreateTime"]);
     oParam.AbandonUserSysNo = Util.TrimIntNull(tempdr["AbandonUserSysNo"]);
     oParam.AbandonTime = Util.TrimDateNull(tempdr["AbandonTime"]);
 }
Exemple #4
0
 public void UpdateSaleGift(SaleGiftInfo oParam)
 {
     new SaleGiftDac().Update(oParam);
 }
Exemple #5
0
 //������Ʒ��Ϣ��������������
 public void UpdateAllGiftInfo(SaleGiftInfo oParam)
 {
     new SaleGiftDac().UpdateGift(oParam);
 }
Exemple #6
0
 public int InsertSaleGift(SaleGiftInfo oParam)
 {
     return new SaleGiftDac().Insert(oParam);
 }
Exemple #7
0
 public Hashtable GetSaleGiftHash(Hashtable sysNoHash)
 {
     Hashtable sgInfoHash = new Hashtable(2);
     if(sysNoHash.Count!=0)
     {
         string strSysNo = "(";
         foreach(int sysNo in sysNoHash.Keys)
         {
             strSysNo += "'"+sysNo+"',";
         }
         strSysNo = strSysNo.TrimEnd(',');
         strSysNo += ")";
         string sql = @"select
                         *
                     from
                         sale_gift
                     where
                         status = "+(int)AppEnum.BiStatus.Valid+" and sysno in "+strSysNo;
         DataSet ds = SqlHelper.ExecuteDataSet(sql);
         if(Util.HasMoreRow(ds))
         {
             foreach(DataRow dr in ds.Tables[0].Rows)
             {
                 SaleGiftInfo sgInfo = new SaleGiftInfo();
                 this.map(sgInfo,dr);
                 sgInfoHash.Add(sgInfo.SysNo,sgInfo);
             }
         }
     }
     return sgInfoHash;
 }