///////////// #endregion //// 2006-09-11 public DataSetSIGNIN GetDataSet(SqlClass sC, string sTableName) { DataSetSIGNIN ds = new DataSetSIGNIN(); db.FillDataSet(sC, ds, sTableName); return(ds); }
///////////// #endregion //// 2006-09-11 public DataSetTJ_PACKAGE GetDataSet(SqlClass sC, string sTableName) { DataSetTJ_PACKAGE ds = new DataSetTJ_PACKAGE(); db.FillDataSet(sC, ds, sTableName); return(ds); }
///////////// #endregion //// 2006-09-11 public DataSetGHSF_NOTEMANAGE GetDataSet(SqlClass sC, string sTableName) { DataSetGHSF_NOTEMANAGE ds = new DataSetGHSF_NOTEMANAGE(); db.FillDataSet(sC, ds, sTableName); return(ds); }
///////////// #endregion //// 2006-09-11 public DataSetCHAT_RECORD GetDataSet(SqlClass sC, string sTableName) { DataSetCHAT_RECORD ds = new DataSetCHAT_RECORD(); db.FillDataSet(sC, ds, sTableName); return(ds); }
///////////// #endregion //// 2006-09-11 public DataSetWJ_DICTITLE GetDataSet(SqlClass sC, string sTableName) { DataSetWJ_DICTITLE ds = new DataSetWJ_DICTITLE(); db.FillDataSet(sC, ds, sTableName); return(ds); }
///////////// #endregion //// 2006-09-11 public DataSetWJ_DICANSWER GetDataSet(SqlClass sC, string sTableName) { DataSetWJ_DICANSWER ds = new DataSetWJ_DICANSWER(); db.FillDataSet(sC, ds, sTableName); return(ds); }
///////////// #endregion //// 2006-09-11 public DataSetGHSF_PATIENTINFO GetDataSet(SqlClass sC, string sTableName) { DataSetGHSF_PATIENTINFO ds = new DataSetGHSF_PATIENTINFO(); db.FillDataSet(sC, ds, sTableName); return(ds); }
///////////// #endregion //// 2006-09-11 public DataSetIN_NAVIGATION_DETAILS GetDataSet(SqlClass sC, string sTableName) { DataSetIN_NAVIGATION_DETAILS ds = new DataSetIN_NAVIGATION_DETAILS(); db.FillDataSet(sC, ds, sTableName); return(ds); }
///////////// #endregion //// 2006-09-11 public DataSetHOSPITALINTRODUCTION GetDataSet(SqlClass sC, string sTableName) { DataSetHOSPITALINTRODUCTION ds = new DataSetHOSPITALINTRODUCTION(); db.FillDataSet(sC, ds, sTableName); return(ds); }
///////////// #endregion //// 2006-09-11 public DataSetXT_DICDEPART GetDataSet(SqlClass sC, string sTableName) { DataSetXT_DICDEPART ds = new DataSetXT_DICDEPART(); db.FillDataSet(sC, ds, sTableName); return(ds); }
///////////// #endregion //// 2006-09-11 public DataSetTJ_DICNODRUGITEM GetDataSet(SqlClass sC, string sTableName) { DataSetTJ_DICNODRUGITEM ds = new DataSetTJ_DICNODRUGITEM(); db.FillDataSet(sC, ds, sTableName); return(ds); }
///////////// #endregion //// 2006-09-11 public DataSetGHSF_CHARGEDETAIL GetDataSet(SqlClass sC, string sTableName) { DataSetGHSF_CHARGEDETAIL ds = new DataSetGHSF_CHARGEDETAIL(); db.FillDataSet(sC, ds, sTableName); return(ds); }
public string InsertApprovalQueue(ApprovalQueue approvalQueue) { string environment = ConfigurationManager.AppSettings["dbname"].ToString(); StringBuilder sql = new StringBuilder(); //sql.Append(" IF NOT EXISTS(SELECT Company FROM Ice.UD24 WHERE Company = " + Escape(approvalQueue.CompanyID) + " AND ShortChar02 = " + Escape(approvalQueue.DocumentNo) + " AND Key1 = " + Escape(approvalQueue.ApprovalQueueID) + ") "); sql.Append($" IF NOT EXISTS(SELECT Company FROM {environment}.Ice.UD24 WHERE Company = " + Escape(approvalQueue.CompanyID) + " AND ShortChar02 = " + Escape(approvalQueue.DocumentNo) + " AND Character01 = " + Escape(approvalQueue.Remarks) + ") "); sql.Append(" BEGIN "); sql.Append($" INSERT INTO {environment}.Ice.UD24(Company, Key1, ShortChar01, ShortChar02, ShortChar03, ShortChar04, ShortChar05, Character01, Date01, Date03) "); sql.Append(" VALUES( " + Escape(approvalQueue.CompanyID) + ", "); sql.Append(" " + Escape(approvalQueue.ApprovalQueueID) + ", "); sql.Append(" " + Escape(approvalQueue.ModuleID) + ", "); sql.Append(" " + Escape(approvalQueue.DocumentNo) + ", "); sql.Append(" " + Escape(approvalQueue.ApprovalStatus) + ", "); sql.Append(" " + Escape(approvalQueue.ApprovalStage) + ", "); sql.Append(" " + Escape(approvalQueue.SupplierID) + ", "); sql.Append(" " + Escape(approvalQueue.Remarks) + ", "); sql.Append(" " + Escape(CommonClasses.ConvertDateToYMD(approvalQueue.SubmitDate.ToString())) + ", "); sql.Append(" " + Escape(CommonClasses.ConvertDateToYMD(approvalQueue.ProceedDate.ToString())) + ") "); sql.Append(" END "); SqlClass.Conn = ConfigurationManager.ConnectionStrings["Finsoft"].ToString(); string errMsg = null; int count = (int)SqlClass.ExecuteCmdQry(sql.ToString(), ref errMsg); return(errMsg); }
///////////// #endregion //// 2006-09-11 public DataSetGHSF_REGHIS GetDataSet(SqlClass sC, string sTableName) { DataSetGHSF_REGHIS ds = new DataSetGHSF_REGHIS(); db.FillDataSet(sC, ds, sTableName); return(ds); }
///////////// #endregion //// 2006-09-11 public DataSetTW_QUESTION GetDataSet(SqlClass sC, string sTableName) { DataSetTW_QUESTION ds = new DataSetTW_QUESTION(); db.FillDataSet(sC, ds, sTableName); return(ds); }
///////////// #endregion //// 2006-09-11 public DataSetPAYMENT GetDataSet(SqlClass sC, string sTableName) { DataSetPAYMENT ds = new DataSetPAYMENT(); db.FillDataSet(sC, ds, sTableName); return(ds); }
///////////// #endregion //// 2006-09-11 public DataSetJZHZ GetDataSet(SqlClass sC, string sTableName) { DataSetJZHZ ds = new DataSetJZHZ(); db.FillDataSet(sC, ds, sTableName); return(ds); }
///////////// #endregion //// 2006-09-11 public DataSetXT_STAFF GetDataSet(SqlClass sC, string sTableName) { DataSetXT_STAFF ds = new DataSetXT_STAFF(); db.FillDataSet(sC, ds, sTableName); return(ds); }
private void Form1_Load(object sender, EventArgs e) { FileInfo curFile = new FileInfo(Process.GetCurrentProcess().MainModule.FileName); string defFile = string.Format("{0}\\backup.def", curFile.DirectoryName); readDef(defFile); sql = SqlClass.GetInstance(); }
private static void TestarData() { //Leitura Escrita String Texto e XML //TextoDataClass.TestarWriterReaderXML(); //TextoDataClass.TestarStreamString(); //SQL DataAccess SqlClass.TestarConsultaReader(); SqlClass.TestarConsultaTable(); }
public void TestGetEvents() { DateTime now = DateTime.Now; SqlClass.AddTestEvent(new Event("e1", now)); SqlClass.AddTestEvent(new Event("e2", now)); SqlClass.AddTestEvent(new Event("e3", now.AddDays(1))); Assert.AreEqual(SqlClass.GetTestEvents(now).Count, 2); Assert.AreEqual(SqlClass.GetTestEvents(now.AddDays(1)).Count, 1); }
private static void ListReservations() { Console.Clear(); SqlClass.GetAllReservations(); Console.WriteLine("Registration Number:\t\tDate:"); Console.WriteLine("--------------------------------------------------------"); foreach (var reservation in Engine.reservationList) { Console.WriteLine($"{reservation.RegistrationNumber}\t\t\t\t{reservation.Date}"); } Console.ReadKey(true); }
private static void ConductInspection() { Reservation makeAInspection; SqlClass.GetAllReservations(); Console.Clear(); Console.WriteLine("Registration number: "); Console.SetCursorPosition(25, 0); string regNumber = Console.ReadLine(); bool isBooked = false; foreach (var reservation in Engine.reservationList) { if (reservation.RegistrationNumber == regNumber) { isBooked = true; makeAInspection = new Reservation(reservation.RegistrationNumber, reservation.Date); break; } } if (isBooked) { Console.Clear(); Console.WriteLine("Was the vehicle accepted? (Y/N)"); ConsoleKeyInfo input = Console.ReadKey(true); Inspection inspectionPlaceHolder = null; switch (input.Key) { case ConsoleKey.Y: inspectionPlaceHolder = new Inspection(regNumber); inspectionPlaceHolder.Approve(); break; case ConsoleKey.N: inspectionPlaceHolder = new Inspection(regNumber); inspectionPlaceHolder.Failed(); break; } Console.Clear(); Console.WriteLine("The Inspections has been made"); SqlClass.SaveInspection(inspectionPlaceHolder); Thread.Sleep(2000); } else { Console.Clear(); Console.WriteLine("There is no booking in that particular registration number"); Thread.Sleep(2000); } }
private static void ListInspections() { Console.Clear(); SqlClass.GetAllInspections(); Console.WriteLine("Registration number:\tPerformedAt:\tIsApproved"); Console.WriteLine("--------------------------------------------------"); foreach (var inspections in Engine.inspectionList) { Console.WriteLine($"{inspections.RegistrationNumber}\t\t{inspections.PerformedAt}\t\t{inspections.IsApproved}"); } Console.ReadKey(true); }
public void TestAddEvent() { DateTime now = DateTime.Now; DateTime dt = new DateTime(now.Year, now.Month, now.Day, now.Hour, now.Minute, 0); // important to use 0 for seconds since dbmanager doesn't store seconds Event e = new Event("testEvent", dt, "testDescription"); List <Event> events_before = SqlClass.GetTestEvents(dt); SqlClass.AddTestEvent(e); List <Event> events_after = SqlClass.GetTestEvents(dt); Assert.AreEqual(events_before.Count + 1, events_after.Count); //Assert.AreEqual(events_after[0], e); }
static void Main(string[] args) { var config = new JobHostConfiguration(); Console.WriteLine("Am intrat"); SqlClass test = new SqlClass(); test.Verify(); Console.WriteLine("Am iesit"); Console.ReadKey(); var host = new JobHost(); // The following code ensures that the WebJob will be running continuously // host.RunAndBlock(); }
public int GetMaxApprovalQueuesID() { StringBuilder sql = new StringBuilder(); //sql.Append(" SELECT COUNT(Company) "); sql.Append(" Select MaxQueId "); sql.Append(" FROM vwGetMaxApprovalQueId "); SqlClass.Conn = ConfigurationManager.ConnectionStrings["Finsoft"].ToString(); string errMsg = null; int count = (int)SqlClass.ExecutScalarQry(sql.ToString(), ref errMsg); return(count); }
public void TestAddProject() { SqlClass.DestroyDB(); SqlClass.InitializeDB(); DateTime now = DateTime.Now; DateTime dt = new DateTime(now.Year, now.Month, now.Day, now.Hour, now.Minute, 0); // important to use 0 for seconds since dbmanager doesn't store seconds System.Drawing.Color testColor = System.Drawing.Color.Red; DateTime dt2 = new DateTime(2019, 12, 25, 0, 0, 0); Project p = new Project("test proj", dt, dt2, testColor, "test description"); List <Project> projs_before = SqlClass.GetProjects(dt); Console.WriteLine(projs_before.Count); SqlClass.AddProject(p); List <Project> projs_after = SqlClass.GetProjects(dt); Assert.AreEqual(projs_before.Count + 1, projs_after.Count); }
private static void CreateReservation() { Console.Clear(); SqlClass.GetAllReservations(); Console.WriteLine("Registration number: "); Console.WriteLine("Date for inspection: "); Console.SetCursorPosition(25, 0); string regNumber = Console.ReadLine(); Console.SetCursorPosition(25, 1); DateTime date = DateTime.Parse(Console.ReadLine()); Reservation reservationPlaceHolder = new Reservation(regNumber, date); Engine.reservationList.Add(reservationPlaceHolder); SqlClass.AddReservation(reservationPlaceHolder); Console.Clear(); Console.WriteLine("Reservation created"); Thread.Sleep(2000); }
static void Main(string[] args) { bool shouldRun = true; SqlClass.GetAllReservations(); while (shouldRun) { Console.Clear(); Console.WriteLine("1. Ny reservation\n2. Lista reservationer\n3. Utför besiktning\n4. Lista besiktningar\n5. Avsluta"); ConsoleKeyInfo input = Console.ReadKey(true); switch (input.Key) { case ConsoleKey.D1: CreateReservation(); break; case ConsoleKey.D2: ListReservations(); break; case ConsoleKey.D3: ConductInspection(); break; case ConsoleKey.D4: ListInspections(); break; case ConsoleKey.D5: SqlClass.sqlconn.Close(); shouldRun = false; break; } } }