private void pageHeader_Format(object sender, EventArgs e) { lblWarehouse.Text = Warehouse.ToString(); lblWBServiceProvider.Text = WBServiceProvider.ToString(); lblFromDate.Text = DateFrom.ToString(); lblToDate.Text = DateTo.ToString(); }
private void buttonGo_Click(object sender, EventArgs e) { if (textBoxYear.Text != "") { if (CorrectDate(textBoxYear.Text.ToString()) == true) { date = textBoxYear.Text.ToString(); if (CheckDate(date) == true) { MessageBox.Show("Дата входит в диапазон", "Отлично", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("Дата не входит в диапазон", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { date = DateFrom.ToString(); MessageBox.Show("Неверный формат введеной даты", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { date = DateFrom.ToString(); MessageBox.Show("Не введена дата. Пожалуйста, заполните поле даты", "Ошибка", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private string BuildSubtitle() { string dateFormat = "dd.MM.yyyy HH:mm"; StringBuilder text = new StringBuilder("Период: "); text.Append(DateFrom.ToString(dateFormat) + " - "); text.Append(DateTo.ToString(dateFormat)); text.Append(", подразделение: "); text.Append(SelectedUnit.Name); if (LicensePlate.Trim().Length > 0) { text.Append(", номер т/с: "); text.Append(LicensePlate.Trim()); } if (Cargo.Trim().Length > 0) { text.Append(", груз: "); text.Append(Cargo.Trim()); } return(text.ToString()); }
public override string ToString() { var typeNames = new Dictionary <int, string> { { 0, "" }, { 1, "Bef. " }, { 2, "" }, { 3, "Abt. " }, { 4, "Cal. " }, { 5, "Bet. " }, { 6, "From " }, { 7, "Aft. " } }; var rangeJoin = new Dictionary <int, string> { { 5, " - " }, { 6, " to " } }; if (!IsValid) { return(DatePhrase); } var result = typeNames[(int)DateType]; result += DateFrom.ToString(); if (DateType == GenDateType.Between || DateType == GenDateType.FromTo) { result += rangeJoin[(int)DateType] + DateTo; } return(result); }
private void pageHeader_Format(object sender, EventArgs e) { lblWarehouse.Text = Warehouse.ToString(); lblShed.Text = Shed.ToString(); lblLIC.Text = LIC.ToString(); lblFromDate.Text = DateFrom.ToString(); lblToDate.Text = DateTo.ToString(); }
private string GetValueForPeriodCell() { var dateFormat = new GetDateFormat().GetDateFormaDotNetById(DateFormatId); //value = DateTime.Parse(value).ToString(dateFormat, ); var valueForPeriodCell = "Period: " + DateFrom.ToString(dateFormat, CultureInfo.InvariantCulture) + " - " + DateTo.ToString(dateFormat, CultureInfo.InvariantCulture); return(valueForPeriodCell); }
private void SaveDateSession() { List <string> list = Session["ReportSession"] as List <string>; list[0] = DateFrom.ToString("yyyy-MM-dd"); list[1] = DateTo.ToString("yyyy-MM-dd"); Session["ReportSession"] = list; }
public override string ToString() { return($"[Type={Type}, " + $"DateFrom={DateFrom.ToString(CultureInfo.CurrentCulture)}, " + $"DateTo={DateTo.ToString(CultureInfo.CurrentCulture)}, " + $"Span={Span.ToString()}, " + $"HasTime={HasTime}, " + $"StartIndex={StartIndex}, " + $"EndIndex={EndIndex}]"); }
public IDictionary <string, string> ToQueryStrings() { return(new Dictionary <string, string>() { { "to", DateTo.ToString("yyyy-MM-dd") }, { "from", DateFrom.ToString("yyyy-MM-dd") }, { "page", Page?.ToString() }, { "size", Size?.ToString() }, }); }
public override string ToString() { if ((ID_pos ?? UID_pos ?? SID_pos) == null) { return($"ID: {ID,4} User: {UID,4} Server: {SID,4}\nFrom: {DateFrom?.ToString("yyyy-MM-dd"),10} To: {DateTo?.ToString("yyyy-MM-dd"),10}"); } return($"ID: {ID,4}{(ID_pos != null ? ":" + ID_pos : "")}" + //Only for OrientDB $" User: {UID,4}{(UID_pos != null ? ":" + UID_pos : "")}" + $" Server: {SID,4}{(SID_pos != null ? ":" + SID_pos : "")}" + $"\nFrom: {DateFrom?.ToString("yyyy-MM-dd"),10} To: {DateTo?.ToString("yyyy-MM-dd"),10}"); }
public override string ToString() { StringBuilder sb = new StringBuilder(); sb.AppendLine($"{EmpID}"); sb.AppendLine($"{ProjectID}"); sb.AppendLine($"{DateFrom.ToString("yyyy-MM-dd")}"); sb.AppendLine($"{DateTo.ToString("yyyy-MM-dd")}"); return(sb.ToString()); }
public override string ToString() { return(string.Format( "{0} - {1} {2} {3} {4} {5}", DateFrom.ToString("MMM d yyyy", CultureInfo.InvariantCulture), DateTo.ToString("MMM d yyyy", CultureInfo.InvariantCulture), RegistrationNo, Name, SourceID, InternalID )); } // ToString
private PDFCell GetPeriodPDFCell() { var dateFormat = new GetDateFormat().GetDateFormaDotNetById(DateFormatId); var pdfCell = new PDFCell { NameDefault = "PeriodName", NameDisplay = "Period: ", Value = DateFrom.ToString(dateFormat) + " - " + DateTo.ToString(dateFormat), }; return(pdfCell); }
} // ToString public virtual string ToString(string sPrefix) { sPrefix = sPrefix ?? ""; var os = new StringBuilder(); os.AppendFormat( "{0} - {1}", DateFrom.ToString("dd-MMM-yyyy", CultureInfo.InvariantCulture), DateTo.ToString("dd-MMM-yyyy", CultureInfo.InvariantCulture) ); ToString(os, sPrefix); return(os.ToString()); } // ToString
public override string ToString() { return(string.Format( "Record ID: {7}{8} internal id: {9}\n" + "{0}: {1} - {2} at {3}\n" + "{4}: {5} at {6}\n{10}", Period, DateFrom.ToString("MMM d yyyy", CultureInfo.InvariantCulture), DateTo.ToString("MMM d yyyy", CultureInfo.InvariantCulture), DateDue.ToString("MMM d yyyy", CultureInfo.InvariantCulture), RegistrationNo, BusinessName, string.Join(" ", BusinessAddress), RecordID, IsDeleted ? " DELETED" : "", InternalID, string.Join("\n", Data.Select(pair => string.Format("{0}: {1}", pair.Key, pair.Value))) )); } // ToString
} // ToString public string ToString(string sPrefix) { sPrefix = sPrefix ?? ""; var os = new StringBuilder(); os.AppendFormat( "{0} - {1}", DateFrom.ToString("dd-MMM-yyyy", CultureInfo.InvariantCulture), DateTo.ToString("dd-MMM-yyyy", CultureInfo.InvariantCulture) ); foreach (KeyValuePair <int, decimal> pair in Boxes) { os.AppendFormat("\n{2}{0}: {1}", pair.Key, pair.Value, sPrefix); } ToString(os, sPrefix); return(os.ToString()); } // ToString
public override void FillSelectedRecordInContent(object RecordToFill) { EmployeeSalaryIncrementID = ((EmployeeSalaryIncrementEditListModel)RecordToFill).EmployeeSalaryIncrementID; tblEmployeeSalaryIncrement SaveModel = DALObj.FindSaveModelByPrimeKey(EmployeeSalaryIncrementID); if (SaveModel == null) { return; } txtEmployee.EditValue = SaveModel.EmployeeID; txtTransectionNo.EditValue = SaveModel.EmployeeSalaryIncrementNo; txtCurrentBasicSalary.EditValue = SaveModel.CurrentBasicSalary; cmbIncrementType.SelectedIndex = SaveModel.IncrementType; txtIncrementAmount.EditValue = SaveModel.IncrementAmount; txtIncrementPercentage.EditValue = SaveModel.IncrementPercentage; dtpTransectionDate.EditValue = SaveModel.EmployeeSalaryIncrementDate; dtpEffectiveMonth.EditValue = DateFrom.ToString("MMMM-yyyy"); txtNewBasicSalary.EditValue = SaveModel.NewBasicSalary; txtLastIncAmount.EditValue = SaveModel.LastIncAmount; dtpLastIncDate.Text = SaveModel.LastIncDate == null ? "" : SaveModel.LastIncDate.Value.ToString("dd-MM-yyyy"); txtRemarks.EditValue = SaveModel.Remarks; base.FillSelectedRecordInContent(RecordToFill); }
public ViewResult ClientsList(string search, DateTime DateFrom, DateTime DateTo) { var date = new DateTime(2000, 1, 1, 0, 00, 00); if (search is null) { search = ""; } if (DateFrom < date) { DateFrom = new DateTime(2020, 6, 20, 0, 00, 00); } if (DateTo < date) { DateTo = DateTime.Now; } ViewBag.search = search + ";" + DateFrom.ToString() + ";" + DateTo.ToString(); AdminUserList aulist = new AdminUserList(mainDBContext, applicationDbContext, userManager); var selUsers = aulist.SelectedUsers(search, DateFrom, DateTo); return(View(selUsers)); }
public string AddSchedule(string Municipality, string TaxType, string Date) { string MunID, TaxID; DateTime DateFrom, DateTo; if (!DateTime.TryParse(Date, out DateFrom)) { return("Date value invalid"); } switch (TaxType.ToLower()) { case "yearly": DateTo = DateFrom.AddYears(1); break; case "monthly": DateTo = DateFrom.AddMonths(1); break; case "weekly": DateTo = DateFrom.AddDays(7); break; case "daily": DateTo = DateFrom.AddDays(1); break; default: return("Tax Type parameter invalid"); } SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["Connectas"].ConnectionString); try { conn.Open(); DataSet ds = new DataSet(); SqlDataAdapter konektas = new SqlDataAdapter("Select ID from Municipality where [Municipality] = '" + Municipality + "'", conn); konektas.Fill(ds); konektas.Dispose(); if (ds.Tables[0].Rows.Count == 0) { return("Municipality not defined"); } MunID = ds.Tables[0].Rows[0]["ID"].ToString(); ds = new DataSet(); konektas = new SqlDataAdapter("Select ID from TaxesConfig where [TaxTypeString] = '" + TaxType + "'", conn); konektas.Fill(ds); konektas.Dispose(); if (ds.Tables[0].Rows.Count == 0) { return("TaxesConfig not defined"); } TaxID = ds.Tables[0].Rows[0]["ID"].ToString(); SqlCommand cmd = new SqlCommand("INSERT INTO [Taxes] values (" + MunID + "," + TaxID + ",'" + DateFrom.ToString("yyyy-MM-dd") + "','" + DateTo.ToString("yyyy-MM-dd") + "')", conn); cmd.ExecuteNonQuery(); conn.Close(); return("OK"); } catch (Exception ex) { return(ex.Message); } }
private void LoadReport(string path, List <DailySummary> _Summary, string rptName) { string _Header = rptName; this.ReportViewer1.LocalReport.DisplayName = rptName; ReportViewer1.ProcessingMode = ProcessingMode.Local; ReportViewer1.LocalReport.ReportPath = Server.MapPath(path); System.Security.PermissionSet sec = new System.Security.PermissionSet(System.Security.Permissions.PermissionState.Unrestricted); ReportViewer1.LocalReport.SetBasePermissionsForSandboxAppDomain(sec); ReportDataSource datasource1 = new ReportDataSource("DataSet1", _Summary); ReportViewer1.LocalReport.DataSources.Clear(); ReportViewer1.LocalReport.DataSources.Add(datasource1); ReportParameter rp = new ReportParameter("CompanyName", "National Highway Authority", false); ReportParameter rp1 = new ReportParameter("Title", rptName, false); ReportParameter rp2 = new ReportParameter("Date", DateTo.ToString("dd-MMM-yyyy") + " to " + DateFrom.ToString("dd-MMM-yyyy"), false); this.ReportViewer1.LocalReport.SetParameters(new ReportParameter[] { rp, rp1, rp2 }); ReportViewer1.LocalReport.Refresh(); }
public override string ToString() { return("ID: " + ID + "\tFrom: " + DateFrom.ToString() + "\tTo: " + DateTo.ToString() + "\tTime Span: " + timeSpan.ToString() + "\tTitle: " + Title); }
/// <summary>Returns a string that represents the current object.</summary> public override string ToString() { return($"{RecordType} from {Source} from ${DateFrom?.ToString("d") ?? "unknown"} to {DateTo?.ToString("d" ?? "unknown")}"); }
public override string ToString() { return(string.Format("{0}-{1} {2}% rate in {3} (Id {4}), Type {5}", DateFrom.ToString("yyyy.MM.dd"), DateTo.ToString("yyyy.MM.dd"), Rate, MunicipalityName, MunicipalityId, Type)); }
/// <summary> /// ToString methode, mostly for debugging purposes /// </summary> /// <returns></returns> public override string ToString() { return(StationKE + " " + DateFrom.ToString() + " " + Latitude + " " + GetDataFromDateTime().ToString("yyyy-MM-dd mm:ss") + " | " + DateFrom); }