public List <SalesOrderDTO> GetListOfAllSalesOrders(string SqlQuery) { salesOrderList = new List <SalesOrderDTO>(); //Get the records from database datarows = GetRecords.GetRecordsFromDatabase(connection, command, dataAdapter, jenkinsHandle(this.SwitchEnvironment27.pEnvironment, SqlQuery, jenkinsDataSource)); foreach (DataRow dataRow in datarows) { salesOrder = new SalesOrderDTO(); rowObject = dataRow.ItemArray; salesOrder.sale_key = rowObject[0].ToString(); salesOrder.Cust_Key = rowObject[1].ToString(); salesOrder.order_Date = rowObject[2].ToString(); salesOrder.Order_Code = rowObject[3].ToString(); salesOrder.sale_Acct = rowObject[4].ToString(); salesOrder.sale_Id = rowObject[5].ToString(); salesOrder.job_Name = rowObject[6].ToString(); salesOrder.bmi_bud_cust_type = rowObject[7].ToString(); salesOrder.total_amount = rowObject[8].ToString(); salesOrder.Bid_Expire_Date = rowObject[9].ToString(); salesOrder.srcSysCode = rowObject[10].ToString(); salesOrder.custPoNum = rowObject[11].ToString(); salesOrder.created_By = rowObject[12].ToString(); salesOrder.Company_Name = rowObject[13].ToString(); salesOrder.user_Email = rowObject[14].ToString(); salesOrderList.Add(salesOrder); } return(salesOrderList); }
//custom function to retrive the records from database also validte the jenkins code public DataRowCollection GetRecordsFromDB(string sqlQuery, STActivityBase activity) { DataRowCollection dbRows = null; string environment = this.SwitchEnvironment14.pEnvironment.ToString(); //jenkins code check (if env values are coming from jenkins) switch (environment.ToLower()) { case "Development_Trunk": sqlQuery = sqlQuery.ToLower().Replace("serv_user.", "").ToString(); sqlQuery = sqlQuery.ToLower().Replace("ods_manager.", "").ToString(); break; case "Development_Branch": sqlQuery = sqlQuery.ToLower().Replace("serv_user.", "").ToString(); sqlQuery = sqlQuery.ToLower().Replace("ods_manager.", "").ToString(); break; } //get the records from DB dbRows = GetRecords.GetRecordsFromDatabase(dbConnection, command, dataAdapter, sqlQuery); //checking of DB row count if (dbRows.Count == 0) { activity.Report("DB records returned : " + dbRows.Count.ToString(), "Zero Data rows returned"); string s = null; s.ToLower(); } return(dbRows); }
/// <summary> /// Reterive specific Requirement info from requirement repo /// </summary> /// <param name="id">Identify</param> /// <returns>Requirement Model</returns> public static Requirement GetRequirement(int id) { GetRecords gr = new GetRecords(); getRequirementValues grv = new getRequirementValues(); Requirement requirement = gr.GetValues(grv, id); return(requirement); }
/// <summary> /// Reterive specific Diploma info from diploma repo /// </summary> /// <param name="id">Identify</param> /// <returns>Diploma Model</returns> public static Diploma GetDiploma(int id) { GetRecords gr = new GetRecords(); getDiplomaValues gdv = new getDiplomaValues(); Diploma diploma = gr.GetValues(gdv, id); return(diploma); }
/// <summary> /// Reterive specific Student info from diploma repo /// </summary> /// <param name="id">identity key</param> /// <returns>Student Model</returns> public static Student GetStudent(int id) { GetRecords gr = new GetRecords(); GetStudentValues gsv = new GetStudentValues(); Student student = gr.GetValues(gsv, id); return(student); }
public PopulateGenders() { _context = new MongoDBContext(); _table = "Genders"; if (GetRecords.Count() == 0) { Populate(); } }
public PopulateRaysTypes() { _context = new MongoDBContext(); _table = "RaysTypes"; if (GetRecords.Count() == 0) { Populate(); } }
public PopulateNurseDegrees() { _context = new MongoDBContext(); _table = "NurseDegrees"; if (GetRecords.Count() == 0) { Populate(); } }
public PopulateDepartments() { _context = new MongoDBContext(); _table = "specilizations"; if (GetRecords.Count() == 0) { Populate(); } }
public PopulateMedicalTest() { _context = new MongoDBContext(); table = "MedicalTest"; if (GetRecords.Count() == 0) { Populate(); } }
public PopulateMedicalType() { _context = new MongoDBContext(); table = "MedicalType"; // Populate Table in DB and not every time Populated it if (GetRecords.Count() == 0) { Populate(); } }
/// <summary> /// Handler for the CodeActivity21 Activity’s ExecuteEvent event. /// </summary> /// <param name=\"sender\">The activity object that raised the ExecuteEvent event.</param> /// <param name=\"args\">The event arguments passed to the activity.</param> /// Use this.CodeActivity21 to access the CodeActivity21 Activity's context, including input and output properties. public void CodeActivity21_OnExecuteEvent(object sender, STActivityBaseEventArgs args) { //Initialize checkArgsPoint object checkArgs = new CheckpointEventArgs(this.CodeActivity21); //open Database connection OpenDBConnection(this.CodeActivity21.Input.connectionString); //Get the record from the database datarowsMaster = GetRecords.GetRecordsFromDatabase(connection, command, dataAdapter, jenkinsHandle(this.SwitchEnvironment27.pEnvironment, this.CodeActivity21.Input.sqlQueryMaster, jenkinsDataSource)); //check record count CheckDataRowsCount(datarowsMaster.Count, this.CodeActivity21); // Get the Master customer Id this.CodeActivity21.Output.Mstr_Cust_Id = datarowsMaster[0].ItemArray[0].ToString(); //Replace placeholders in request body string requestBody = this.CodeActivity21.Input.requestBody.Replace("Master_Cust_Id_value", this.CodeActivity21.Output.Mstr_Cust_Id).ToString(); if (this.CodeActivity21.Input.caseType.ToUpper() == "MASTERANDBRANCH") { datarowsBranch = GetRecords.GetRecordsFromDatabase(connection, command, dataAdapter, jenkinsHandle(this.SwitchEnvironment27.pEnvironment, this.CodeActivity21.Input.sqlQueryBranch.Replace("mstr_cust_id_value", datarowsMaster[0].ItemArray[0].ToString()), jenkinsDataSource)); CheckDataRowsCount(datarowsBranch.Count, this.CodeActivity21); //Replace placeholders in request body requestBody = requestBody.Replace("Branch_Cust_Id_value", datarowsBranch[0].ItemArray[0].ToString().Split('*')[1]). Replace("Branch_Cust_Acct", datarowsBranch[0].ItemArray[0].ToString().Split('*')[0]); } this.CodeActivity21.Output.requestBodyOut = requestBody; //Close database connection CloseDBConnection(); }