public int Update(ChangePrimaryBus ChangePrimaryBusObj)
        {
            try
            {
                string strUpdate = "update " + strTableName + " set ";
                string strSets   = "";
                string strWhere  = " where 1=1" + "" + " and ID=" + ChangePrimaryBusObj.ID;
                if (ChangePrimaryBusObj.MSISDN != null)
                {
                    strSets += "MSISDN=" + DH.ToDBString(ChangePrimaryBusObj.MSISDN);
                }
                else
                {
                    strSets += "MSISDN=null";
                }

                if (ChangePrimaryBusObj.SMS_content != null)
                {
                    strSets += ",SMS_content=" + DH.ToDBString(ChangePrimaryBusObj.SMS_content);
                }
                else
                {
                    strSets += ",SMS_content=null";
                }
                if (ChangePrimaryBusObj.SMS_Options != null)
                {
                    strSets += ",SMS_Options=" + DH.ToDBString(ChangePrimaryBusObj.SMS_Options);
                }
                else
                {
                    strSets += ",SMS_Options=null";
                }
                if (ChangePrimaryBusObj.Reply_Option != null)
                {
                    strSets += ",Reply_Option=" + DH.ToDBString(ChangePrimaryBusObj.Reply_Option);
                }
                else
                {
                    strSets += ",Reply_Option=null";
                }
                if (ChangePrimaryBusObj.status >= 0)
                {
                    strSets += ",status=" + ChangePrimaryBusObj.status;
                }
                else
                {
                    strSets += ",status=null";
                }
                if (ChangePrimaryBusObj.error_desc != null)
                {
                    strSets += ",error_desc=" + DH.ToDBString(ChangePrimaryBusObj.error_desc);
                }
                else
                {
                    strSets += ",error_desc=null";
                }
                if (ChangePrimaryBusObj.request_type >= 0)
                {
                    strSets += ",request_type=" + ChangePrimaryBusObj.request_type;
                }
                else
                {
                    strSets += ",request_type=null";
                }
                if (strSets.Length > 0)
                {
                    DH.ExecuteNonQuery(strUpdate + strSets + strWhere);
                }
                return(1);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 2
0
 public int Update(VAT_SHOP_ECARE VAT_SHOP_ECAREObj)
 {
     try
     {
         string strUpdate = "update " + strTableName + " set ";
         string strSets   = "";
         string strWhere  = " where  SEQ_ID=" + VAT_SHOP_ECAREObj.SEQ_ID;
         if (VAT_SHOP_ECAREObj.REQ_XML != null)
         {
             strSets += ",REQ_XML=" + DH.ToDBString(VAT_SHOP_ECAREObj.REQ_XML);
         }
         else
         {
             strSets += ",REQ_XML=null";
         }
         if (VAT_SHOP_ECAREObj.SEQ_ID != null)
         {
             strSets += ",SEQ_ID=" + DH.ToDBString(VAT_SHOP_ECAREObj.SEQ_ID);
         }
         else
         {
             strSets += ",SEQ_ID=null";
         }
         if (VAT_SHOP_ECAREObj.ResultDesc != null)
         {
             strSets += ",ResultDesc=" + DH.ToDBString(VAT_SHOP_ECAREObj.ResultDesc);
         }
         else
         {
             strSets += ",ResultDesc=null";
         }
         if (VAT_SHOP_ECAREObj.OFFER_NAME != null)
         {
             strSets += ",OFFER_NAME=" + DH.ToDBString(VAT_SHOP_ECAREObj.OFFER_NAME);
         }
         else
         {
             strSets += ",OFFER_NAME=null";
         }
         if (VAT_SHOP_ECAREObj.STATUS > 0)
         {
             strSets += ",STATUS=" + VAT_SHOP_ECAREObj.STATUS;
         }
         else
         {
             strSets += ",STATUS=null";
         }
         if (VAT_SHOP_ECAREObj.CHANNEL != null)
         {
             strSets += ",CHANNEL=" + DH.ToDBString(VAT_SHOP_ECAREObj.CHANNEL);
         }
         else
         {
             strSets += ",CHANNEL=null";
         }
         if (VAT_SHOP_ECAREObj.VAT_AMOUNT > 0)
         {
             strSets += ",VAT_AMOUNT=" + VAT_SHOP_ECAREObj.VAT_AMOUNT;
         }
         else
         {
             strSets += ",VAT_AMOUNT=null";
         }
         if (VAT_SHOP_ECAREObj.RECHARGE_AMOUNT > 0)
         {
             strSets += ",RECHARGE_AMOUNT=" + VAT_SHOP_ECAREObj.RECHARGE_AMOUNT;
         }
         else
         {
             strSets += ",RECHARGE_AMOUNT=null";
         }
         if (VAT_SHOP_ECAREObj.MSISDN != null)
         {
             strSets += ",MSISDN=" + DH.ToDBString(VAT_SHOP_ECAREObj.MSISDN);
         }
         else
         {
             strSets += ",MSISDN=null";
         }
         if (VAT_SHOP_ECAREObj.TRANSDATE != null)
         {
             strSets += ",TRANSDATE=" + DH.ToDBString(VAT_SHOP_ECAREObj.TRANSDATE);
         }
         else
         {
             strSets += ",TRANSDATE=null";
         }
         if (VAT_SHOP_ECAREObj.TRACK_ID != null)
         {
             strSets += ",TRACK_ID=" + DH.ToDBString(VAT_SHOP_ECAREObj.TRACK_ID);
         }
         else
         {
             strSets += ",TRACK_ID=null";
         }
         if (strSets.Length > 0)
         {
             DH.ExecuteNonQuery(strUpdate + strSets + strWhere);
         }
         return(1);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }