public long EkleSiparisDetay(TBLSIPARISDETAY ptSDetay) { try { DbCommand dbCommand = db.GetSqlStringCommand("INSERT INTO TBLSIPARISDETAY(SIPARISID, URUNID,MIKTAR,TUTAR) VALUES(@SIPARISID,@URUNID,@MIKTAR,@TUTAR) SELECT @@IDENTITY"); db.AddInParameter(dbCommand, "SIPARISID", DbType.Int64, ptSDetay.SIPARISID); db.AddInParameter(dbCommand, "URUNID", DbType.Int32, ptSDetay.URUNID); db.AddInParameter(dbCommand, "MIKTAR", DbType.Decimal, ptSDetay.MIKTAR); db.AddInParameter(dbCommand, "TUTAR", DbType.Decimal, ptSDetay.TUTAR); return(db.ExecuteScalar(dbCommand).ToLong(0)); } catch (Exception ex) { cLog.Write(ex, _iKullaniciID); return(0); } }
public short DuzenleSiparisDetay(TBLSIPARISDETAY ptSDetay) { try { DbCommand dbCommand = db.GetSqlStringCommand("UPDATE TBLSIPARISDETAY SET SIPARISID=@SIPARISID,URUNID=@URUNID,MIKTAR=@MIKTAR,TUTAR=@TUTAR WHERE ID=@ID"); db.AddInParameter(dbCommand, "ID", DbType.Int64, ptSDetay.ID); db.AddInParameter(dbCommand, "SIPARISID", DbType.Int64, ptSDetay.SIPARISID); db.AddInParameter(dbCommand, "URUNID", DbType.Int32, ptSDetay.URUNID); db.AddInParameter(dbCommand, "MIKTAR", DbType.Decimal, ptSDetay.MIKTAR); db.AddInParameter(dbCommand, "TUTAR", DbType.Decimal, ptSDetay.TUTAR); db.ExecuteNonQuery(dbCommand); return(1); } catch (Exception ex) { cLog.Write(ex, _iKullaniciID); return(0); } }