Exemplo n.º 1
0
 public int Bus_Feeticket_pnoInsertOrUpdate(Bus_Feeticket_pno businfo)
 {
     using (var sql = new SqlHelper())
     {
         try
         {
             var internalData = new InternalBus_Feeticket(sql);
             int result       = internalData.Bus_Feeticket_pnoInsertOrUpdate(businfo);
             return(result);
         }
         catch
         {
             throw;
         }
     }
 }
Exemplo n.º 2
0
        //导入大巴车免费券
        internal int Bus_Feeticket_pnoInsertOrUpdate(Bus_Feeticket_pno businfo)
        {
            string sql = "insert Bus_Feeticket_pno (Busid,Pno,Num)values(@Busid,@Pno,@Num)";

            if (businfo.Id != 0)//如果有ID不为0则为修改
            {
                sql = "update Bus_Feeticket_pno set Busid=@Busid,Pno=@Pno,Num=@Num where id =@id ";
            }
            var cmd = sqlHelper.PrepareTextSqlCommand(sql);

            cmd.AddParam("@id", businfo.Id);
            cmd.AddParam("@Busid", businfo.Busid);
            cmd.AddParam("@Pno", businfo.Pno);
            cmd.AddParam("@Num", businfo.Num);

            return(cmd.ExecuteNonQuery());
        }