Esempio n. 1
0
        public string DataTrigger_Delete(Iinterface Entity)
        {
            try
            {
                // Get Command object with Stored procedure
                ObjCmd = Entity.Delete();
                // to Command object for a pending local transaction
                ObjCmd.Connection  = Conn;
                ObjCmd.Transaction = DbTrans;



                ObjCmd.ExecuteNonQuery();

                strmsg = "False";
            }
            catch (Exception e)
            {
                OperationError = (e.Message) + "Sorry, Record can not be deleted.";
                strmsg         = "True";
                return(strmsg);
            }

            return(strmsg);
        }
Esempio n. 2
0
        public DataView DataTrigger_Get_All(Iinterface Entity)
        {
            Conn              = Objconn.Odbc_SQL_Connection;
            ObjCmd            = Entity.Get_All();
            ObjCmd.Connection = Conn;
            MySqlDataAdapter da = new MySqlDataAdapter(ObjCmd);
            DataSet          DS = new DataSet();

            da.Fill(DS);
            ObjCmd.Connection.Close();
            ObjCmd.Connection.Dispose();
            ObjCmd.Connection = null;

            DataView DV = new DataView(DS.Tables[0]);

            DS.Dispose();
            DS = null;                  //null
            da = null;                  //null
            Objconn.Dispose();          //null
            Conn.Close();               //null
            Conn.Dispose();             //null
            Conn   = null;              //null
            ObjCmd = null;              //null

            return(DV);
        }
Esempio n. 3
0
        public string DataTrigger_Get_Max(Iinterface Entity)
        {
            try
            {
                // Get Database connection
                ObjCmd             = Entity.Get_Max();
                ObjCmd.Connection  = DbTrans.Connection;
                ObjCmd.Transaction = DbTrans;


                // Dataadapter
                MySqlDataAdapter da = new MySqlDataAdapter(ObjCmd);
                // fill dataset
                DataSet DS = new DataSet();
                da.Fill(DS);
                //ObjCmd.Connection.Close();

                return(DS.Tables[0].Rows[0]["MaxID"].ToString());
            }
            catch (Exception e)
            {
                OperationError = (e.Message) + "Sorry, Maximum Primary Key can not be extracted.";
                strmsg         = "True";
            }

            return(strmsg);
        }
        public static void PrintListOfFiles(this DirectoryInfo dir, Iinterface ui)
        {
            var files = dir.GetFiles();

            foreach (var file in files)
            {
                ui.Write("File name: " + file.Name + "\tCreation time: " + file.CreationTime.ToString() + "\n");
            }
        }
Esempio n. 5
0
        public static void Run()
        {
            Bderived   b = new Bderived();
            ABase      a = b;
            Iinterface i = b;

            a.hello();
            b.hello();
            i.hello();
        }
Esempio n. 6
0
        public static void PrintMasivZ(MasivZ arr, Iinterface ui)
        {
            foreach (var symb in arr.Symbols)
            {
                ui.Write(symb + " ");
            }

            ui.Write("\n");

            foreach (var code in arr.Codes)
            {
                ui.Write(code + " ");
            }
            ui.Write("\n");
        }
Esempio n. 7
0
        public DataView Transaction_Get_Single(Iinterface Entity)
        {
            ObjCmd = Entity.Get_Single();
            //ObjCmd.Connection = Conn;
            ObjCmd.Connection  = DbTrans.Connection;
            ObjCmd.Transaction = DbTrans;
            // Dataadapter
            MySqlDataAdapter da = new MySqlDataAdapter(ObjCmd);
            // fill dataset
            DataSet DS = new DataSet();

            da.Fill(DS);

            // Create the DataView Object
            DataView DV = new DataView(DS.Tables[0]);

            return(DV);
        }
Esempio n. 8
0
        //		public DataView Transaction_Get_All(Iinterface Entity)
        //		{
        //			ObjCmd = Entity.Get_All();
        //			ObjCmd.Transaction = DbTrans;
        //			ObjCmd.Connection = Conn;
        //
        //			// Dataadapter
        //			OdbcDataAdapter da = new OdbcDataAdapter(ObjCmd);
        //			// fill dataset
        //			DataSet DS = new DataSet();
        //			da.Fill(DS);
        //
        //			// Create the DataView Object
        //			DataView DV = new DataView(DS.Tables[0]);
        //
        //			return DV;
        //		}

        public DataView DataTrigger_Get_Single(Iinterface Entity)
        {
            // Get Database connection
            Conn              = Objconn.Odbc_SQL_Connection;
            ObjCmd            = Entity.Get_Single();
            ObjCmd.Connection = Conn;
            // Dataadapter
            MySqlDataAdapter da = new MySqlDataAdapter(ObjCmd);
            // fill dataset
            DataSet DS = new DataSet();

            da.Fill(DS);
            ObjCmd.Connection.Close();
            ObjCmd.Connection.Dispose();
            ObjCmd.Connection = null;
            // Create the DataView Object
            DataView DV = new DataView(DS.Tables[0]);

            return(DV);
        }
Esempio n. 9
0
        /*public string DataTrigger_Delete(Iinterface Entity)
         * {
         *  // Get Command object with Stored procedure
         *  ObjCmd = Entity.Delete();
         *  // to Command object for a pending local transaction
         *  ObjCmd.Transaction = DbTrans;
         *
         *  try
         *  {
         *      ObjCmd.Connection = Conn;
         *      ObjCmd.ExecuteNonQuery();
         *  }
         *  catch(Exception e)
         *  {
         *      OperationError = (e.Message) + "Sorry, Record can not be deleted.";
         *      strmsg="True";
         *  }
         *
         *  return strmsg ;
         * }*/
        public string DataTrigger_Update(Iinterface Entity)
        {
            // Get Command object with Stored procedure
            ObjCmd = Entity.Update();
            // to Command object for a pending local transaction
            ObjCmd.Connection  = DbTrans.Connection;
            ObjCmd.Transaction = DbTrans;

            try
            {
                ObjCmd.ExecuteNonQuery();
            }

            catch (Exception e)
            {
                // Rollback transaction
                //DbTrans.Rollback();
                OperationError = (e.Message) + "Sorry, Record can not be updated.";
                strmsg         = "True";
            }

            return(strmsg);
        }
Esempio n. 10
0
 public ArrayPrinter(Iinterface ui)
 {
     UserInterface = ui;
 }
Esempio n. 11
0
 public DependencyLogic(Iinterface inter)
 {
     this._inter = inter;
     _inter.Execute();
 }
 Iinterface c;     //I removed the default new since it will get assigned in constructor
 public AnotherClass(Iinterface obj)
 {
     c = obj;
 }
Esempio n. 13
0
 public StringsTasksRunner(Iinterface ui)
 {
     UserInterface = ui;
 }
Esempio n. 14
0
 public ArraysTasksRunner(Iinterface ui)
 {
     UserInterface = ui;
 }
Esempio n. 15
0
 public PrimitiveTaskRunner(Iinterface ui)
 {
     UserInterface = ui;
 }
Esempio n. 16
0
 public FilesTasksRunner(Iinterface ui)
 {
     UserInterface = ui;
 }