public static List <ISO19030RESULT> Analysis() { // Collect Data and Compilation if (!(DataRetrieval() && DataCompilation())) { return(null); } //Chauvent Filtering & Validation sailingData = Filters.BasicFilteringContorller(sailingData); //Create wind Resistance windResistance = WindResistance.CreateWindResistance(shipParticular, sailingData.Count()); //Environment Filtering sailingData = Filters.FilteringForReferenceCondition(sailingData, shipParticular, ballastValues, scantlingValues, windResistance); //Create Reference List <double[]> powerToSpeedTable = DataFunctions.PowerToSpeedTable(shipParticular, ballastValues, scantlingValues); //var nowDraft = sailingData.Where(d => d.DRAFT_FORE != -9999).Average(d => d.DRAFT_FORE); //var modelDraftMeanBallast = (ballastValues.DRAFT_FORE + ballastValues.DRAFT_AFT) / 2; //var modelDraftMeanScantling = (scantlingValues.DRAFT_FORE + scantlingValues.DRAFT_AFT) / 2; //Create Result Data var iso19030resultList = CreateResultData(sailingData, powerToSpeedTable); return(iso19030resultList); }
/// <summary> /// Saves the current project. /// </summary> /// <returns><c>true</c>, if current project was saved, <c>false</c> otherwise.</returns> private bool SaveCurrentProject() { // check to make sure name is present if (entryProjectName.Text is null || entryProjectName.Text.Equals("")) { DependencyService.Get <ICrossPlatformToast>().ShortAlert("Project name is required."); return(false); } project.ProjectName = entryProjectName.Text; project.PrimaryCollector = entryPrimaryCollectorProject.Text; project.CreatedDate = dpCreatedDate.Date; // check for duplicate names first if (DataFunctions.CheckExists(project, project.ProjectName)) { DependencyService.Get <ICrossPlatformToast>().ShortAlert($"'{project.ProjectName}' already exists..."); return(false); } // save project to database int autoKeyResult = DatabaseFile.GetConnection().Insert(project); Debug.WriteLine("inserted project, recordno is: " + autoKeyResult.ToString()); return(true); }
/// <summary> /// Saves the current trip. /// </summary> /// <returns><c>true</c>, if current trip was saved, <c>false</c> otherwise.</returns> private bool SaveCurrentTrip() { // check to make sure name is present if (entryTripName.Text is null || entryTripName.Text.Equals("")) { DependencyService.Get <ICrossPlatformToast>().ShortAlert("Trip name is required."); return(false); } trip.ProjectName = project.ProjectName; trip.TripName = entryTripName.Text; trip.AdditionalCollectors = (entryAdditionalCollectors.Text is null) ? "" : entryAdditionalCollectors.Text; trip.CollectionDate = dpCollectionDate.Date; // check for duplicate names before saving if (DataFunctions.CheckExists(trip, trip.TripName)) { DependencyService.Get <ICrossPlatformToast>().ShortAlert("You already have a trip with the same name!"); return(false); } // save trip to database int autoKeyResult = DatabaseFile.GetConnection().Insert(trip); Debug.WriteLine("inserted trip, recordno is: " + autoKeyResult.ToString()); return(true); }
internal static byte[] SendNicks(ref LoginSocketState state, Dictionary <string, string> keyValues) { if (!keyValues.ContainsKey("email") || (!keyValues.ContainsKey("passenc") && !keyValues.ContainsKey("pass"))) { return(DataFunctions.StringToBytes(@"\error\\err\0\fatal\\errmsg\Invalid Query!\id\1\final\")); } string password = PasswordFromKeyValues(keyValues); password = password.ToMD5(); var clientData = LoginDatabase.Instance.GetData(keyValues["email"], password); if (clientData == null) { return(DataFunctions.StringToBytes(@"\error\\err\551\fatal\\errmsg\Unable to get any associated profiles.\id\1\final\")); } List <string> nicks = new List <string>(); foreach (var client in clientData) { nicks.Add((string)client["name"]); } if (nicks.Count == 0) { return(DataFunctions.StringToBytes(@"\nr\0\ndone\\final\")); } state.State++; return(DataFunctions.StringToBytes(GenerateNicks(nicks.ToArray()))); }
public static List <string> UpdateTutorInfo(string Name, string Address, string Email, string Phone, string Avail, string TutorId, string Subjects) { DataSet dsResult = new DataSet(); DataFunctions df = new DataFunctions(); GenralFunction gf = new GenralFunction(); SqlParameter[] PM = new SqlParameter[7]; PM[0] = new SqlParameter("@Name", SqlDbType.VarChar); PM[0].Value = Name; PM[1] = new SqlParameter("@Address", SqlDbType.VarChar); PM[1].Value = Address; PM[2] = new SqlParameter("@Email", SqlDbType.VarChar); PM[2].Value = Email; PM[3] = new SqlParameter("@Phone", SqlDbType.VarChar); PM[3].Value = Phone; PM[4] = new SqlParameter("@Avail", SqlDbType.VarChar); PM[4].Value = Avail; PM[5] = new SqlParameter("@TutorId", SqlDbType.BigInt); PM[5].Value = TutorId; PM[6] = new SqlParameter("@Subjects", SqlDbType.VarChar); PM[6].Value = Subjects; dsResult = gf.Filldatasetvalue(PM, "USP_UpdateTutorInfo", dsResult, null); string tblUpdateMessage = Tutor_MailBox.DataTableToJSONWithJavaScriptSerializer(dsResult.Tables[0]); List <string> obj_list = new List <string>(); obj_list.Add(tblUpdateMessage); return(obj_list); }
/// <summary> /// Loads the default values for controls with corresponding App Variables. /// </summary> private void LoadDefaults() { entryPrimaryCollectorProject.Text = (AppVariables.CollectorName is null) ? "" : AppVariables.CollectorName; entryProjectName.Text = "Project-" + (DataFunctions.GetAllProjectsCount() + 1).ToString(); dpCreatedDate.Date = DateTime.Today; btnBack.IsVisible = userIsEditing; }
public static byte[] GenerateServerChallenge(ref LoginSocketState state) { state.ServerChallenge = _random.GetString(10); string message = String.Format(@"\lc\1\challenge\{0}\id\1\final\", state.ServerChallenge); return(DataFunctions.StringToBytes(message)); }
/// <summary> /// btnNewSpecimen Click event. /// Clears the Page for a new Specimen. /// </summary> /// <param name="sender">Sender.</param> /// <param name="e">E.</param> public void btnNewSpecimen_Clicked(object sender, EventArgs e) { specimen = new Specimen(); entryFieldID.Text = ""; entryOccurrenceNotes.Text = ""; entrySubstrate.Text = ""; pickerLifeStage.SelectedItem = null; switchCultivated.IsToggled = false; entryIndivCount.Text = ""; lblStatusMessage.IsVisible = false; lblStatusMessage.Text = ""; specimen.SiteName = site.SiteName; if (DataFunctions.CheckExists(specimen, site.RecordNo.ToString() + "-" + AppVariables.CollectionCount.ToString())) { Title = site.RecordNo.ToString() + "-" + (AppVariables.CollectionCount + 1).ToString(); } else { Title = site.RecordNo.ToString() + "-" + AppVariables.CollectionCount.ToString(); } }
public static List <string> InsertIntoCallLogs(object Obj_CallLogs) { JavaScriptSerializer jsonSerializer = new JavaScriptSerializer(); _CallLogs objCallLogs = jsonSerializer.Deserialize <_CallLogs>(Obj_CallLogs.ToString()); DataSet dsResult = new DataSet(); DataFunctions df = new DataFunctions(); GenralFunction gf = new GenralFunction(); SqlParameter[] PM = new SqlParameter[4]; PM[0] = new SqlParameter("@Inqueryid", SqlDbType.BigInt); PM[0].Value = objCallLogs._InquiryID; PM[1] = new SqlParameter("@Date", SqlDbType.DateTime); PM[1].Value = objCallLogs._Date; PM[2] = new SqlParameter("@Notes", SqlDbType.VarChar); PM[2].Value = objCallLogs._Notes; PM[3] = new SqlParameter("@UserId", SqlDbType.BigInt); PM[3].Value = HttpContext.Current.Session["UserId"]; dsResult = gf.Filldatasetvalue(PM, "USP_InsertIntoCallLogs", dsResult, null); string tblCallLogs = Enrollment_EnrolementAction.DataTableToJSONWithJavaScriptSerializer(dsResult.Tables[0]); List <string> obj_list = new List <string>(); obj_list.Add(tblCallLogs); return(obj_list); }
protected void rdoBedrooms_SelectedIndexChanged(object sender, EventArgs e) { if (Session["dt"] != null) { DataTable dtCategories = new DataTable(); DataFunctions obj = new DataFunctions(); DataTable dt = (DataTable)Session["dt"]; dtCategories = dt; string[] vTypeSelect = rdoBedrooms.SelectedItem.Text.Split('('); vTypeSelect[0] = vTypeSelect[0].Replace(" ", " "); List <string> vList = new List <string>(); DataFunctions obj1 = new DataFunctions(); var dt1 = obj1.PropertiesByCase(vList, countryid, "Country"); DataView dv = dt1.DefaultView; // dv.Sort = "minNightRate desc"; dt1 = dv.ToTable(); var categoryCondition = vTypeSelect[0].Trim(); string typeFilterCondition = string.Empty; if (categoryCondition != "Display All") { typeFilterCondition = "Category = '" + vTypeSelect[0].Trim() + "'"; } FillPropertiesBox(dt1, typeFilterCondition); rdoFilter.SelectedIndex = 3; } }
public async Task <ActionResult> Post([FromBody] JsonElement body, [FromRoute] string apikey) { try { if (apikey != _apiKey) { return(Unauthorized()); } var newtonBody = JObject.Parse(JsonSerializer.Serialize(body)); var now = DateTime.Now; var documentsAsStrings = DataFunctions.ProcessRequestData(newtonBody, _agentRegionName, now, out DateTime testTime); var list = documentsAsStrings.Select(d => new ElasticMessage { Content = d, Date = testTime }).ToList(); await _elasticConnector.BulkInsertToElastic(list); _logger.LogInformation("TestPost"); return(Ok()); } catch (ArgumentException ex) { return(BadRequest(ex.Message)); } catch (Exception ex) { return(StatusCode(500, ex)); } }
internal static byte[] SendCheck(ref LoginSocketState state, Dictionary <string, string> keyValues) { string name = String.Empty; if (String.IsNullOrWhiteSpace(name)) { if (keyValues.ContainsKey("uniquenick")) { name = keyValues["uniquenick"]; } } if (String.IsNullOrWhiteSpace(name)) { if (keyValues.ContainsKey("nick")) { name = keyValues["nick"]; } } if (String.IsNullOrWhiteSpace(name)) { return(DataFunctions.StringToBytes(@"\error\\err\0\fatal\\errmsg\Invalid Query!\id\1\final\")); } var clientData = LoginDatabase.Instance.GetData(name); if (clientData == null) { return(DataFunctions.StringToBytes(String.Format(@"\error\\err\265\fatal\\errmsg\Username [{0}] doesn't exist!\id\1\final\", name))); } string message = String.Format(@"\cur\0\pid\{0}\final\", clientData["profileid"]); return(DataFunctions.StringToBytes(message)); }
protected void btnFileUpload_Click(object sender, EventArgs e) { try { string FileName = txtFilename.Text.ToString(); String FilePath = MapPath("") + "/file/" + DateTime.Now.Year.ToString() + "_" + DateTime.Now.Month.ToString() + "_" + DateTime.Now.Day.ToString() + "_" + UploadFile.PostedFile.FileName.Replace(" ", ""); UploadFile.PostedFile.SaveAs(FilePath); DataSet dsResult = new DataSet(); DataFunctions df = new DataFunctions(); GenralFunction gf = new GenralFunction(); SqlParameter[] PM = new SqlParameter[5]; PM[0] = new SqlParameter("@Filename", SqlDbType.VarChar); PM[0].Value = FileName; PM[1] = new SqlParameter("@StudentId", SqlDbType.VarChar); PM[1].Value = Request["StudentId"].ToString(); PM[2] = new SqlParameter("@filepath ", SqlDbType.VarChar); PM[2].Value = FilePath; PM[3] = new SqlParameter("@FileTitle", SqlDbType.VarChar); PM[3].Value = FileName; PM[4] = new SqlParameter("@Author", SqlDbType.VarChar); PM[4].Value = Session["User"].ToString(); dsResult = gf.Filldatasetvalue(PM, "USP_Uploadfiles", dsResult, null); txtFilename.Text = ""; } catch (Exception ex) { Console.Write(ex.ToString()); } }
public static List <string> LogNote(string Type, string Priority, string Date, string StudentId, string Notes) { DataSet dsResult = new DataSet(); DataFunctions df = new DataFunctions(); GenralFunction gf = new GenralFunction(); SqlParameter[] PM = new SqlParameter[6]; PM[0] = new SqlParameter("@Type", SqlDbType.VarChar); PM[0].Value = Type; PM[1] = new SqlParameter("@Priority", SqlDbType.VarChar); PM[1].Value = Priority; PM[2] = new SqlParameter("@Date", SqlDbType.VarChar); PM[2].Value = Date; PM[3] = new SqlParameter("@StudentId", SqlDbType.VarChar); PM[3].Value = StudentId; PM[4] = new SqlParameter("@Notes", SqlDbType.VarChar); PM[4].Value = Notes; PM[5] = new SqlParameter("@Author", SqlDbType.VarChar); PM[5].Value = HttpContext.Current.Session["User"].ToString(); dsResult = gf.Filldatasetvalue(PM, "USP_LogNote", dsResult, null); string tblMessage = Manage_StudentDetails.DataTableToJSONWithJavaScriptSerializer(dsResult.Tables[0]); List <string> obj_list = new List <string>(); obj_list.Add(tblMessage); return(obj_list); }
public static List <string> UpdateStudentInlineH( string BalanceHours, string TokenBalance, string StudyHall_Hrs, string StudentId) { DataSet dsResult = new DataSet(); DataFunctions df = new DataFunctions(); GenralFunction gf = new GenralFunction(); SqlParameter[] PM = new SqlParameter[4]; PM[0] = new SqlParameter("@BalanceHours", SqlDbType.VarChar); PM[0].Value = BalanceHours; PM[1] = new SqlParameter("@TokenBalance", SqlDbType.VarChar); PM[1].Value = TokenBalance; PM[2] = new SqlParameter("@StudentId", SqlDbType.VarChar); PM[2].Value = StudentId; PM[3] = new SqlParameter("@HallHrs", SqlDbType.VarChar); PM[3].Value = StudyHall_Hrs; dsResult = gf.Filldatasetvalue(PM, "USP_UpdateStudentInline", dsResult, null); string tblMessage = Manage_StudentDetails.DataTableToJSONWithJavaScriptSerializer(dsResult.Tables[0]); List <string> obj_list = new List <string>(); obj_list.Add(tblMessage); return(obj_list); }
public static List <string> SaveFeedback(string SessionId, string CoverdstudentMaterials, string CoverdstudentMaterials_Text, string Studentattitude, string Studentattitude_Text, string OtherFeedback) { DataSet dsResult = new DataSet(); DataFunctions df = new DataFunctions(); GenralFunction gf = new GenralFunction(); SqlParameter[] PM = new SqlParameter[7]; PM[0] = new SqlParameter("@SessionId", SqlDbType.VarChar); PM[0].Value = SessionId; PM[1] = new SqlParameter("@CoverdstudentMaterials", SqlDbType.VarChar); PM[1].Value = CoverdstudentMaterials; PM[2] = new SqlParameter("@CoverdstudentMaterials_Text", SqlDbType.VarChar); PM[2].Value = CoverdstudentMaterials_Text; PM[3] = new SqlParameter("@Studentattitude", SqlDbType.VarChar); PM[3].Value = Studentattitude; PM[4] = new SqlParameter("@Studentattitude_Text", SqlDbType.VarChar); PM[4].Value = Studentattitude_Text; PM[5] = new SqlParameter("@OtherFeedback", SqlDbType.VarChar); PM[5].Value = OtherFeedback; PM[6] = new SqlParameter("@TutorId", SqlDbType.VarChar); PM[6].Value = HttpContext.Current.Session["Id"].ToString(); dsResult = gf.Filldatasetvalue(PM, "USP_SaveFeedback", dsResult, null); string tblMessage = Manage_StudentDetails.DataTableToJSONWithJavaScriptSerializer(dsResult.Tables[0]); List <string> obj_list = new List <string>(); obj_list.Add(tblMessage); return(obj_list); }
public static List <string> SaveMessage(string To, string From, string Message) { DataSet dsResult = new DataSet(); DataFunctions df = new DataFunctions(); GenralFunction gf = new GenralFunction(); SqlParameter[] PM = new SqlParameter[6]; PM[0] = new SqlParameter("@To", SqlDbType.VarChar); PM[0].Value = To; PM[1] = new SqlParameter("@From", SqlDbType.VarChar); PM[1].Value = ((HttpContext.Current.Session["Role"].ToString() == "3") ? HttpContext.Current.Session["Id"].ToString() : From); PM[2] = new SqlParameter("@Message", SqlDbType.VarChar); PM[2].Value = Message; PM[3] = new SqlParameter("@Author", SqlDbType.VarChar); PM[3].Value = HttpContext.Current.Session["User"].ToString(); PM[4] = new SqlParameter("@AuthorId", SqlDbType.VarChar); PM[4].Value = HttpContext.Current.Session["Id"].ToString(); PM[5] = new SqlParameter("@RoleId", SqlDbType.VarChar); PM[5].Value = HttpContext.Current.Session["Role"].ToString(); dsResult = gf.Filldatasetvalue(PM, "USP_SaveMessage", dsResult, null); string tblTransferReq = Tutor_Shifts.DataTableToJSONWithJavaScriptSerializer(dsResult.Tables[0]); List <string> obj_list = new List <string>(); obj_list.Add(tblTransferReq); return(obj_list); }
public static byte[] SendProfile(ref LoginSocketState state, Dictionary <string, string> keyValues, bool retrieve) { var clientData = LoginDatabase.Instance.GetData(state.Name); if (clientData == null) { return(DataFunctions.StringToBytes(String.Format(@"\error\\err\265\fatal\\errmsg\Username [{0}] doesn't exist!\id\1\final\", state.Name))); } string message = String.Format( @"\pi\\profileid\{0}\nick\{1}\userid\{2}\email\{3}\sig\{4}\uniquenick\{5}\pid\{6}" + @"\firstname\lastname\countrycode\{7}\birthday\{8}\lon\{9}\lat\{10}\loc\id\{11}\final\", clientData["profileid"], state.Name, clientData["userid"], clientData["email"], _random.GetString(32, "0123456789abcdef"), state.Name, 0, clientData["country"], 16844722, "0.000000", "0.000000", retrieve ? 5 : 2 ); if (!retrieve) { state.State++; } return(DataFunctions.StringToBytes(message)); }
public static List <string> MasterScheduling(string Time, string Day, string Date) { HttpContext.Current.Session["Time"] = Time; HttpContext.Current.Session["Day"] = Day; HttpContext.Current.Session["Date"] = Date; DataSet dsResult = new DataSet(); DataFunctions df = new DataFunctions(); GenralFunction gf = new GenralFunction(); SqlParameter[] PM = new SqlParameter[4]; PM[0] = new SqlParameter("@FranchiseId", SqlDbType.BigInt); PM[0].Value = HttpContext.Current.Session["TutorFranchiseID"].ToString(); PM[1] = new SqlParameter("@Time", SqlDbType.VarChar); PM[1].Value = Time; PM[2] = new SqlParameter("@Day", SqlDbType.VarChar); PM[2].Value = Day; PM[3] = new SqlParameter("@Date", SqlDbType.VarChar); PM[3].Value = Date; dsResult = gf.Filldatasetvalue(PM, "USP_SessionScheduling", dsResult, null); string tblTables = Tutor_Schedule.DataTableToJSONWithJavaScriptSerializer(dsResult.Tables[0]); string tblTutor = Tutor_Schedule.DataTableToJSONWithJavaScriptSerializer(dsResult.Tables[1]); string tblStudent = Tutor_Schedule.DataTableToJSONWithJavaScriptSerializer(dsResult.Tables[2]); List <string> obj_list = new List <string>(); obj_list.Add(tblTables); obj_list.Add(tblTutor); obj_list.Add(tblStudent); return(obj_list); }
public static List <string> Swipe_Tutor(string SID1, string SID2, string SID3, string TID1, string TID2, string TID3) { DataSet dsResult = new DataSet(); DataFunctions df = new DataFunctions(); GenralFunction gf = new GenralFunction(); SqlParameter[] PM = new SqlParameter[6]; PM[0] = new SqlParameter("@SourceStudent1", SqlDbType.VarChar); PM[0].Value = SID1; PM[1] = new SqlParameter("@SourceStudent2", SqlDbType.VarChar); PM[1].Value = SID2; PM[2] = new SqlParameter("@SourceStudent3", SqlDbType.VarChar); PM[2].Value = SID2; PM[3] = new SqlParameter("@TargetStudent1", SqlDbType.VarChar); PM[3].Value = TID1; PM[4] = new SqlParameter("@TargetStudent2", SqlDbType.VarChar); PM[4].Value = TID2; PM[5] = new SqlParameter("@TargetStudent3", SqlDbType.VarChar); PM[5].Value = TID3; dsResult = gf.Filldatasetvalue(PM, "USP_SwipeTutor_Session", dsResult, null); string tblMessage = Tutor_Schedule.DataTableToJSONWithJavaScriptSerializer(dsResult.Tables[0]); List <string> obj_list = new List <string>(); obj_list.Add(tblMessage); return(obj_list); }
void btnSaveSettings_Clicked(object sender, EventArgs e) { if (!entryStartingRecordNumber.Text.Equals("")) { int currentSpecimenCount = DataFunctions.GetSpecimenCount(); if (currentSpecimenCount > 0) { int userEntered = int.Parse(entryStartingRecordNumber.Text); if (userEntered < currentSpecimenCount) // the user should not be able to set the collection count to a value lower than the current total { DependencyService.Get <ICrossPlatformToast>().ShortAlert("You cannot set the Specimen Count lower than the current total."); return; } else { AppVariables.CollectionCount = userEntered; } } } if (!entryCollectorName.Text.Equals("")) { AppVariables.CollectorName = entryCollectorName.Text; } if (pickerExportFormat.SelectedIndex != -1) { AppVariables.DataExportFormat = pickerExportFormat.SelectedItem.ToString(); } AppVarsFile.WriteAppVars(); DependencyService.Get <ICrossPlatformToast>().ShortAlert("Saved settings"); // automatically go back to main page after save Navigation.PopAsync(); }
public static List <string> Swipe_Student_BlankMSID_Move(string ID1, string Tablenumber, string SchedulleDate_Day, string TimeId) { DataSet dsResult = new DataSet(); DataFunctions df = new DataFunctions(); GenralFunction gf = new GenralFunction(); SqlParameter[] PM = new SqlParameter[4]; PM[0] = new SqlParameter("@MasterScheduleID1", SqlDbType.VarChar); PM[0].Value = ID1; PM[1] = new SqlParameter("@TableNumber", SqlDbType.VarChar); PM[1].Value = Tablenumber; PM[2] = new SqlParameter("@SchedulleDate_Day", SqlDbType.VarChar); PM[2].Value = SchedulleDate_Day; PM[3] = new SqlParameter("@TimeId", SqlDbType.VarChar); PM[3].Value = TimeId; dsResult = gf.Filldatasetvalue(PM, "Swipe_Student_BlankMSID_Session_Move", dsResult, null); string tblMessage = Scheduling_WeeklySchedule.DataTableToJSONWithJavaScriptSerializer(dsResult.Tables[0]); List <string> obj_list = new List <string>(); obj_list.Add(tblMessage); return(obj_list); }
public static List <string> getMasterSchedule(string TimeSelected, string Subjects, string Gender) { DataSet dsResult = new DataSet(); DataFunctions df = new DataFunctions(); GenralFunction gf = new GenralFunction(); SqlParameter[] PM = new SqlParameter[4]; PM[0] = new SqlParameter("@FranchiseId", SqlDbType.BigInt); PM[0].Value = HttpContext.Current.Session["FranchiseID"].ToString(); PM[1] = new SqlParameter("@TimeSelected", SqlDbType.VarChar); PM[1].Value = TimeSelected; PM[2] = new SqlParameter("@Subjects", SqlDbType.VarChar); PM[2].Value = Subjects; PM[3] = new SqlParameter("@Gender", SqlDbType.VarChar); PM[3].Value = Gender; dsResult = gf.Filldatasetvalue(PM, "USP_getMasterSchedule", dsResult, null); string tblResults = Enrollment_Inquiry.DataTableToJSONWithJavaScriptSerializer(dsResult.Tables[0]); List <string> obj_list = new List <string>(); obj_list.Add(tblResults); return(obj_list); }
public void TestRemoveSensitiveVariables() { string content = GetJsonContent("payload.json"); var payload1 = JObject.Parse(content); payload1["removesensitive"] = "aa,bb,cc"; payload1["initial_variables"]["aa"] = 111; payload1["requests"][0]["variables"]["bb"] = 222; payload1["variables"]["cc"] = 333; payload1["initial_variables"]["dd"] = 444; payload1["requests"][0]["variables"]["ee"] = 555; payload1["variables"]["ff"] = 666; var payload2 = JObject.Parse(content); payload2["initial_variables"]["dd"] = 444; payload2["requests"][0]["variables"]["ee"] = 555; payload2["variables"]["ff"] = 666; DataFunctions.RemoveSensitiveVariables(payload1); Assert.AreEqual(payload1.ToString(), payload2.ToString()); }
public static List <string> StudentDetails(string StudentId) { DataSet dsResult = new DataSet(); DataFunctions df = new DataFunctions(); GenralFunction gf = new GenralFunction(); SqlParameter[] PM = new SqlParameter[1]; PM[0] = new SqlParameter("@StudentId", SqlDbType.BigInt); PM[0].Value = StudentId; dsResult = gf.Filldatasetvalue(PM, "USP_StudentDetails", dsResult, null); string tblStudent = Manage_StudentDetails.DataTableToJSONWithJavaScriptSerializer(dsResult.Tables[0]); string tblNotes = Manage_StudentDetails.DataTableToJSONWithJavaScriptSerializer(dsResult.Tables[1]); string tblFiles = Manage_StudentDetails.DataTableToJSONWithJavaScriptSerializer(dsResult.Tables[2]); string tblInvoice = Manage_StudentDetails.DataTableToJSONWithJavaScriptSerializer(dsResult.Tables[3]); string tblSubjects = Manage_StudentDetails.DataTableToJSONWithJavaScriptSerializer(dsResult.Tables[4]); string tblGrade = Manage_StudentDetails.DataTableToJSONWithJavaScriptSerializer(dsResult.Tables[5]); List <string> obj_list = new List <string>(); obj_list.Add(tblStudent); obj_list.Add(tblNotes); obj_list.Add(tblFiles); obj_list.Add(tblInvoice); obj_list.Add(tblSubjects); obj_list.Add(tblGrade); return(obj_list); }
public static List <string> GetTutor(string TutorId) { DataSet dsResult = new DataSet(); DataFunctions df = new DataFunctions(); GenralFunction gf = new GenralFunction(); SqlParameter[] PM = new SqlParameter[1]; PM[0] = new SqlParameter("@TutorId", SqlDbType.BigInt); PM[0].Value = HttpContext.Current.Session["Id"].ToString();; dsResult = gf.Filldatasetvalue(PM, "USP_Gettutor", dsResult, null); string tblTutor = Tutor_Shifts.DataTableToJSONWithJavaScriptSerializer(dsResult.Tables[0]); string tblTutorList = Tutor_Shifts.DataTableToJSONWithJavaScriptSerializer(dsResult.Tables[1]); string tblInbox = Tutor_Shifts.DataTableToJSONWithJavaScriptSerializer(dsResult.Tables[2]); string tblSend = Tutor_Shifts.DataTableToJSONWithJavaScriptSerializer(dsResult.Tables[3]); string tblSubjects = Tutor_Shifts.DataTableToJSONWithJavaScriptSerializer(dsResult.Tables[4]); List <string> obj_list = new List <string>(); obj_list.Add(tblTutor); obj_list.Add(tblTutorList); obj_list.Add(tblInbox); obj_list.Add(tblSend); obj_list.Add(tblSubjects); return(obj_list); }
public static byte[] NewUser(ref LoginSocketState state, Dictionary <string, string> keyValues) { string message = String.Empty; if (keyValues.ContainsKey("nick")) { state.Name = keyValues["nick"]; } else { return(DataFunctions.StringToBytes(@"\error\\err\0\fatal\\errmsg\Invalid Query!\id\1\final\")); } if (keyValues.ContainsKey("email")) { state.Email = keyValues["email"]; } else { return(DataFunctions.StringToBytes(@"\error\\err\0\fatal\\errmsg\Invalid Query!\id\1\final\")); } if (keyValues.ContainsKey("passwordenc")) { state.PasswordEncrypted = keyValues["passwordenc"]; } else { return(DataFunctions.StringToBytes(@"\error\\err\0\fatal\\errmsg\Invalid Query!\id\1\final\")); } if (keyValues.ContainsKey("steamid") && ulong.TryParse(keyValues["steamid"], out ulong id)) { state.SteamId = id; } else { return(DataFunctions.StringToBytes(@"\error\\err\0\fatal\\errmsg\Invalid Query!\id\1\final\")); } if (Database.UsersDBInstance.ProfileExists(state.Name)) { return(DataFunctions.StringToBytes(@"\error\\err\516\fatal\\errmsg\This account name is already in use!\id\1\final\")); } else { string password = DecryptPassword(state.PasswordEncrypted); var clientData = Database.UsersDBInstance.CreateProfile(state.Name, password.ToMD5(), state.SteamId, state.Email, "??", ((IPEndPoint)state.Socket.RemoteEndPoint).Address); if (clientData == null) { return(DataFunctions.StringToBytes(@"\error\\err\0\fatal\\errmsg\Error creating account!\id\1\final\")); } message = String.Format(@"\nur\\userid\{0}\profileid\{1}\id\1\final\", clientData.Id + 10000000, clientData.Id); } return(DataFunctions.StringToBytes(message)); }
public string FreeContainers(ushort N, string hangarId, out bool success, out string exceptionString) { bool exist; var hangar = DataFunctions.GetHangar(hangarId, out exist, out success, out exceptionString); if (!success) { return(exceptionString); } if (!exist) { return(Settings.HangarDoesNotExistMessage); } if (hangar.fullness < N) { return(Settings.NotEnoughContainersMessage); } else { DataFunctions.ModifyHangar(hangar.id, -N, out success, out exceptionString); if (!success) { return(exceptionString); } return(Settings.ContainersTakenAwayMessage); } }
public static List <string> UpdateTableNumber(string MSID1, string MSID2, string MSID3, string Tablenumber) { DataSet dsResult = new DataSet(); DataFunctions df = new DataFunctions(); GenralFunction gf = new GenralFunction(); SqlParameter[] PM = new SqlParameter[8]; PM[0] = new SqlParameter("@MSID1", SqlDbType.BigInt); PM[0].Value = ((MSID1 == "null" || MSID1 == "") ? "0" : MSID1); PM[1] = new SqlParameter("@MSID2", SqlDbType.BigInt); PM[1].Value = ((MSID2 == "null" || MSID2 == "") ? "0" : MSID2); PM[2] = new SqlParameter("@MSID3", SqlDbType.BigInt); PM[2].Value = ((MSID3 == "null" || MSID3 == "") ? "0" : MSID3); PM[3] = new SqlParameter("@Tablenumber", SqlDbType.BigInt); PM[3].Value = Tablenumber; dsResult = gf.Filldatasetvalue(PM, "USP_UpdateTableNumber_Session", dsResult, null); string tblMessage = Tutor_Schedule.DataTableToJSONWithJavaScriptSerializer(dsResult.Tables[0]); List <string> obj_list = new List <string>(); obj_list.Add(tblMessage); return(obj_list); }
public static List <string> LogTransferRequest(string Date, string StartTime, string Endtime, string Message, string TutorId) { DataSet dsResult = new DataSet(); DataFunctions df = new DataFunctions(); GenralFunction gf = new GenralFunction(); SqlParameter[] PM = new SqlParameter[6]; PM[0] = new SqlParameter("@Date", SqlDbType.VarChar); PM[0].Value = Date; PM[1] = new SqlParameter("@StartTime", SqlDbType.VarChar); PM[1].Value = StartTime; PM[2] = new SqlParameter("@Endtime", SqlDbType.VarChar); PM[2].Value = Endtime; PM[3] = new SqlParameter("@Message", SqlDbType.VarChar); PM[3].Value = Message; PM[4] = new SqlParameter("@TutorId", SqlDbType.VarChar); PM[4].Value = HttpContext.Current.Session["Id"].ToString(); PM[5] = new SqlParameter("@Author", SqlDbType.VarChar); PM[5].Value = HttpContext.Current.Session["User"].ToString(); //Session["User"] dsResult = gf.Filldatasetvalue(PM, "USP_LogTransferRequest", dsResult, null); string tblUpdateMessage = Tutor_Shifts.DataTableToJSONWithJavaScriptSerializer(dsResult.Tables[0]); string tblRequestLogged = Tutor_Shifts.DataTableToJSONWithJavaScriptSerializer(dsResult.Tables[1]); List <string> obj_list = new List <string>(); obj_list.Add(tblUpdateMessage); obj_list.Add(tblRequestLogged); return(obj_list); }
public BookingShareService() { dbContext = new DataFunctions(); }
public DriverCreditCardService() { dbContext = new DataFunctions(); }
public PassengerRatingService() { dbContext = new DataFunctions(); }
public DriverRatingService() { dbContext = new DataFunctions(); }
public BookingApplyService() { dbContext = new DataFunctions(); }
public OfferApplyService() { dbContext = new DataFunctions(); }
public StoreManagerService() { dbContext = new DataFunctions(); }
public UserService() { dbContext = new DataFunctions(); }
public PassengerNWaySaleService() { dbContext = new DataFunctions(); }
public DriverNWaySaleService() { dbContext = new DataFunctions(); }
public DriverFareOfferService() { dbContext = new DataFunctions(); }
public PassengerCreditCardService() { dbContext = new DataFunctions(); }
public PaneltyMasterService() { dbContext = new DataFunctions(); }