コード例 #1
0
 public int EkleGrupTanimi(TBLURUN_GRUP_TANIMLARI ptGrup)
 {
     try
     {
         DbCommand dbcommand = db.GetSqlStringCommand("INSERT INTO TBLURUN_GRUP_TANIMLARI(GRUP_ADI,ACIKLAMA,GRUP_TIPI) VALUES(@GRUP_ADI,@ACIKLAMA,@GRUP_TIPI) SELECT @@IDENTITY");
         db.AddInParameter(dbcommand, "GRUP_ADI", DbType.String, ptGrup.GRUP_ADI);
         db.AddInParameter(dbcommand, "ACIKLAMA", DbType.String, ptGrup.ACIKLAMA);
         db.AddInParameter(dbcommand, "GRUP_TIPI", DbType.Int16, (short)ptGrup.GRUP_TIPI);
         return(db.ExecuteScalar(dbcommand).ToInt(0));
     }
     catch (Exception ex)
     {
         cLog.Write(ex, _iKullaniciID);
         return(0);
     }
 }
コード例 #2
0
 public int DuzenleGrupTanimi(TBLURUN_GRUP_TANIMLARI ptGrup)
 {
     try
     {
         DbCommand dbcommand = db.GetSqlStringCommand("UPDATE TBLURUN_GRUP_TANIMLARI SET GRUP_ADI=@GRUP_ADI, ACIKLAMA=@ACIKLAMA,GRUP_TIPI=@GRUP_TIPI WHERE ID=@ID");
         db.AddInParameter(dbcommand, "ID", DbType.Int32, ptGrup.ID);
         db.AddInParameter(dbcommand, "GRUP_ADI", DbType.String, ptGrup.GRUP_ADI);
         db.AddInParameter(dbcommand, "ACIKLAMA", DbType.String, ptGrup.ACIKLAMA);
         db.AddInParameter(dbcommand, "GRUP_TIPI", DbType.Int16, (short)ptGrup.GRUP_TIPI);
         db.ExecuteNonQuery(dbcommand);
         return(1);
     }
     catch (Exception ex)
     {
         cLog.Write(ex, _iKullaniciID);
         return(0);
     }
 }