protected void GetShoppingData(int Rno) { string Sql = string.Format( "Select * " + "From ShoppingLists s Inner Join Vendors v On s.VendorRno = v.VendorRno " + "Where ShoppingListRno = {0}", Rno); ClearData(); try { DataRow dr = db.DataRow(Sql); if (dr != null) { hfShoppingListRno.Value = Rno.ToString(); txtPurchaseDate.Text = Fmt.Dt(DateTime.Today); hfVendorRno.Value = DB.Int32(dr["VendorRno"]).ToString(); txtVendor.Text = DB.Str(dr["Name"]); btnDelete.Enabled = false; FocusField = "txtPurchaseDate"; LoadShoppingDetails(Rno); } } catch (Exception Ex) { Err Err = new Err(Ex, Sql); Response.Write(Err.Html()); } }
public static bool IsValid(char[] input, int maxLength, Fmt allowed) { if (input.Length > maxLength) return false; for (int i = 0; i < input.Length; i++) { if ((allowed & Fmt.Letter) == Fmt.Letter) { if (char.IsLetter(input[i])) continue; } if ((allowed & Fmt.Number) == Fmt.Number) { if (char.IsNumber(input[i])) continue; } if ((allowed & Fmt.Space) == Fmt.Space) { if (input[i] == Space) { if ((allowed & Fmt.RepeatWhitespace) == Fmt.RepeatWhitespace) continue; if (i == 0 || !char.IsWhiteSpace(input[i - 1])) continue; } } if ((allowed & Fmt.Punctuation) == Fmt.Punctuation) { if (char.IsPunctuation(input[i])) continue; } if ((allowed & Fmt.Tab) == Fmt.Tab) { if (input[i] == Tab) { if ((allowed & Fmt.RepeatWhitespace) == Fmt.RepeatWhitespace) continue; if (i == 0 || !char.IsWhiteSpace(input[i - 1])) continue; } } if ((allowed & Fmt.NewLine) == Fmt.NewLine) { if (input[i] == NewLine) continue; } return false; } return true; }
private void Crew(int JobRno) { bool fFirst = true; string Sql = "Select * " + "From mcJobCrew Where JobRno = " + JobRno + " " + "Order By ReportTime, CrewSeq"; try { DataTable dt = db.DataTable(Sql); foreach (DataRow dr in dt.Rows) { if (fFirst) { fFirst = false; Response.Write( WebPage.HorizLine(6, "60%", 5) + WebPage.Tabs(6) + WebPage.Table("width='300'") + WebPage.Tabs(7) + "<tr>\n" + WebPage.Tabs(8) + WebPage.Space(80, 1) + WebPage.Tabs(8) + WebPage.Space(10, 1) + WebPage.Tabs(8) + WebPage.Space(120, 1) + WebPage.Tabs(8) + WebPage.Space(10, 1) + WebPage.Tabs(8) + WebPage.Space(80, 1) + WebPage.Tabs(7) + "</tr>\n" + WebPage.Tabs(7) + "<tr><td colspan='5' align='left'><b>Crew Assignments</b></td></tr>\n" ); } string Html = WebPage.Tabs(7) + "<tr>\n" + WebPage.Tabs(8) + "<td align='right'>" + Fmt.Tm12Hr(DB.DtTm(dr["ReportTime"])) + "</td>\n" + WebPage.Tabs(8) + "<td></td>\n" + WebPage.Tabs(8) + "<td>" + DB.Str(dr["CrewMember"]) + "</td>\n" + WebPage.Tabs(8) + "<td></td>\n" + WebPage.Tabs(8) + "<td>" + DB.Str(dr["CrewAssignment"]) + "</td>\n" + WebPage.Tabs(7) + "</tr>\n"; string Note = DB.Str(dr["Note"]); if (Note.Length > 0) { Html += WebPage.Tabs(7) + "<tr><td colspan='2'></td><td colspan='3' align='center'><i>" + Note + "</i></td></tr>\n"; } Response.Write(Html); } } catch (Exception Ex) { Err Err = new Err(Ex, Sql); Response.Write(Err.Html()); } Response.Write( WebPage.Tabs(6) + WebPage.TableEnd()); }
/// <summary> /// Return a display version of the value. /// String = as is /// Bool = yes/no /// Date = formatted /// Foreign key = lookup field and get name using GetName() /// </summary> /// <returns></returns> public string ToStringNice() { string displayText = ""; if (IsForeignKey) { var lookup = GetForeignRecord(); if (lookup != null) { displayText = lookup.GetName(); } } else if (IsBooleanField) { displayText = Fmt.YesNo(ValueObject.ToBool()); } else if (IsNumericField) { displayText = Fmt.Number(ValueObject, DecimalPlaces ?? -1, true); } else { displayText = ToString(); } return(displayText); }
private void Setup() { DateTime Today = DateTime.Today; txtDayDate.Text = Fmt.Dt(Today); txtWeekDate.Text = txtDayDate.Text; txtMonthDate.Text = Fmt.Dt(Today.AddDays(1 - Today.Day).AddMonths(1)); txtBegDateRange.Text = txtEndDateRange.Text = txtDayDate.Text; CustomerJobs(); txtDayDate.Attributes.Add("onChange", "iSetChk('rdoDay', true);"); txtWeekDate.Attributes.Add("onChange", "iSetChk('rdoWeek', true);"); txtMonthDate.Attributes.Add("onChange", "iSetChk('rdoMonth', true);"); txtBegDateRange.Attributes.Add("onChange", "iSetChk('rdoRange', true);"); txtEndDateRange.Attributes.Add("onChange", "iSetChk('rdoRange', true);"); ddlCustomerDate.Attributes.Add("onChange", "iSetChk('rdoCustomerDate', true);"); lbJobs.Attributes.Add("onChange", "iSetChk('rdoCustomerDate', true);"); chkSummaryOnly.Attributes.Add("onClick", "OptionSet(this.checked, 'tdSummaryOnly');"); chkIncludeAll.Attributes.Add("onClick", "SameWindow();"); btnReport.Attributes.Add("onClick", "NewWindow();"); }
private void DayHeader(DateTime dtRpt, bool fAM, bool fPM, string KitchenLocation) { int cJobs = 0; int cServings = 0; string Sql = "Select Count(*) As Cnt, " + "(IsNull(Sum(NumMenServing), 0) + IsNull(Sum(NumWomenServing), 0) + IsNull(Sum(NumChildServing), 0)) As NumServings " + "From mcJobs Where JobDate = " + DB.PutDtTm(dtRpt) + " " + (fAM ? "And Datepart(hour, Coalesce(DepartureTime, MealTime, '1/1/1 00:00:01')) < 12 " : string.Empty) + (fPM ? "And Datepart(hour, Coalesce(DepartureTime, MealTime, '1/1/1 00:00:01')) >= 12 " : string.Empty) + "And CancelledDtTm Is Null"; try { DataTable dt = db.DataTable(Sql); DataRow dr = dt.Rows[0]; cJobs = DB.Int32(dr["Cnt"]); cServings = DB.Int32(dr["NumServings"]); } catch (Exception Ex) { Err Err = new Err(Ex, Sql); Response.Write(Err.Html()); } if (cJobs > 0) { if (fNewPage) { Response.Write( "<div style='page-break-before: always;'><img width='1' height='1' src='Images/Space.gif' alt='' /></div>"); } string Desc = KitchenLocation; Response.Write( //WebPage.Table("width='760' align='center'" + (fNewPage ? " style='page-break-before: always;" : "") + "'") + WebPage.Table("width='500' align='center'") + WebPage.Tabs(1) + "<tr>\n" + WebPage.Tabs(2) + "<td width='30%' valign='bottom'>\n" + WebPage.Tabs(3) + WebPage.Span(Desc, "RptNotice") + "\n" + WebPage.Tabs(2) + "</td>\n" + WebPage.Tabs(2) + "<td align='center'>\n" + WebPage.Tabs(3) + WebPage.Div("Production Sheets", "center", "RptTitle") + WebPage.Tabs(4) + WebPage.Table("class='RptSubTitleBorder' style='padding-left: 2px; padding-right: 2px;'") + WebPage.Tabs(5) + "<tr><td class='RptSubTitle'>" + (fAM ? "AM " : string.Empty) + (fPM ? "PM " : string.Empty) + Fmt.DayOfWeek(dtRpt) + ", " + Fmt.Dt(dtRpt) + "</td></tr>\n" + WebPage.Tabs(3) + WebPage.TableEnd() + WebPage.Tabs(2) + "</td>\n" + WebPage.Tabs(2) + "<td width='30%' valign='bottom' align='right'>" + WebPage.Span(Fmt.Num(cJobs), "RptNotice") + " Jobs, " + WebPage.Span(Fmt.Num(cServings), "RptNotice") + " Servings</td>\n" + WebPage.Tabs(1) + "</tr>\n" + WebPage.TableEnd() + WebPage.SpaceTable(1, 40) ); fNewPage = true; } }
/// <summary> /// if the HelpText doesn't exist, create it with the default value supplied /// </summary> /// <param name="helpTextCode"></param> /// <param name="defaultTitle"></param> /// <param name="defaultBodyText"></param> protected void init(string helpTextCode, string defaultTitle, string defaultBodyText) { this.HelpTextCode = helpTextCode; DataBlock db = new DataBlock(); db.OpenDB(); if (Web.Request["dropHelpTexts"] != null && Util.IsBewebOffice) { db.execute("delete from HelpText where HelpTextCode='" + Fmt.SqlString(helpTextCode) + "'"); } DataBlock rs = db.execute("select * from HelpText where HelpTextCode='" + Fmt.SqlString(helpTextCode) + "'"); if (rs.eof()) { defaultTitle = (defaultTitle.IsBlank()) ? helpTextCode + " Help" : defaultTitle; //autocreate empty HelpText db.execute("insert into HelpText(HelpTextCode,title,bodytexthtml,dateadded)values('" + Fmt.SqlString(helpTextCode) + "','" + Fmt.SqlString(defaultTitle) + "','" + Fmt.SqlString(defaultBodyText) + "', " + Fmt.SqlDate(DateTime.Now) + ")"); rs.close(); //close previous rs //reopen newly created block rs = db.open("select * from HelpText where HelpTextCode='" + Fmt.SqlString(helpTextCode) + "'"); } _ID = rs.GetValueInt("HelpTextID"); _BodyTextHTML = rs.GetValue("BodyTextHTML"); _Title = rs.GetValue("Title"); rs.close(); db.CloseDB(); }
private static string GetFanXml(Fan fan, bool updatePassword) { var xml = new HtmlTag("request"); var contact = new HtmlTag("contact"); //contact.AddTag("name", fan.FirstName+" "+fan.LastName); -- not needed will generate from firstname and last name attributes in extention attributes //contact.AddTag("userid", fan.Email); -- not needed if (updatePassword) { contact.AddTag("userpassword", Security.DecryptPassword(fan.Password)); //decrypt before sending to Touchpoint } contact.AddTag("emailpermission", fan.EmailPermission.ToStringLower()); contact.AddTag("mobilepermission", fan.MobilePermission.ToStringLower()); var ext = new HtmlTag("extensionattributes"); //extention attributes ext.AddTag("firstname", fan.FirstName); ext.AddTag("lastname", fan.LastName); ext.AddTag("email", fan.Email); ext.AddTag("mobile", fan.Mobile); ext.AddTag("city", fan.City); ext.AddTag("postcode", fan.PostCode); ext.AddTag("country", fan.Country); ext.AddTag("gender", fan.Gender); ext.AddTag("birthdate", Fmt.DateTimeISOZ(fan.DateOfBirth)); contact.AddTag(ext); contact.AddRawHtml("<lists><list><alphaid>Steinlager</alphaid><status>S</status></list></lists>"); xml.AddTag(contact); string data = "<?xml version=\"1.0\"?>\n" + xml.ToString(); return(data); }
protected override void SkipValue() { if (Fmt.Skip <string>()) { Fmt.Skip <string>(); } }
//protected void CompressAttachments() { // MagickImage image = new MagickImage(Web.MapPath("~/attachments/bigfoimage.png")); // image.CompressionMethod = ImageMagick.CompressionMethod.ZipS; // image.Resize(50); // FileSystem.Delete(Web.MapPath("~/attachments/newbigfoimage.png")); // image.Write(Web.MapPath("~/attachments/newbigfoimage.png")); //} protected void CompressMultiplePng() { var files = Directory.GetFiles(Web.MapPath(Web.Attachments), "*.*", SearchOption.AllDirectories); Web.Flush("Compressing Images into folder attachments/compressed/ <br>"); foreach (var oldFile in files) { var attachmentName = oldFile.RightFrom(Web.MapPath(Web.Attachments)).ToLower(); var ext = FileSystem.GetExtension(attachmentName); if (ext == ".png" || ext == ".jpeg" || ext == ".jpg") { if (!attachmentName.Contains("compressed\\")) { if (oldFile.Contains("nature_wallpaper")) { var originalFileSize = FileSystem.GetFileSize(oldFile); Web.Flush("Filename " + attachmentName + "... Orig File Size: " + originalFileSize + "kb"); //FileSystem.CopyFile(file, Web.MapPath("~/attachments/originals/" + attachmentName)); var newFile = Web.MapPath("~/attachments/compressed/" + attachmentName); ImageProcessing.CompressImage(oldFile, newFile); var fileSize = FileSystem.GetFileSize(newFile); Web.Flush(" New File Size: " + fileSize + "kb (" + Fmt.Number(Numbers.SafeDivide(fileSize, originalFileSize) * 100, 0) + "%) <br>"); } } } } }
void UpdateTimer(Text text, int team, float time) { float ntime = time - startTime; ntime += Settings.Get(team == 1 ? "Team1Time" : "Team2Time"); text.text = Fmt.time(ntime); }
public static Models.TextBlock GetPlain(string sectionCode, string defaultTextHtml = null, string defaultTitle = null) { CheckForDrop(sectionCode); var tb = All.Filter(textBlock => textBlock.SectionCode == sectionCode).FirstOrDefault(); if (tb == null) { // add it to the database tb = new Models.TextBlock(); tb.SectionCode = sectionCode; if (defaultTitle != null) { tb.IsTitleAvailable = true; tb.Title = defaultTitle; } else { tb.IsTitleAvailable = false; } tb.IsBodyPlainText = true; tb.IsUrlAvailable = false; tb.IsPictureAvailable = false; tb.BodyTextHtml = defaultTextHtml ?? Fmt.SplitTitleCase(sectionCode) + " content goes here"; tb.Save(); All.Add(tb); } return(tb); }
private void LoadListSql(string Sql, string NextCurrItem) { try { DataTable dt = db.DataTable(Sql); foreach (DataRow r in dt.Rows) { string userName = DB.Str(r["userName"]); string userCommonName = DB.Str(r["UserCommonName"]); bool fHidden = DB.Bool(r["DisabledFlg"]); ListItem Item = new ListItem(listFormatStyle(userCommonName, userName)); if (fHidden) { Item.Attributes.Add("class", "Hidden"); } if (Item.Value == NextCurrItem) { Item.Selected = true; userName = Item.Value; GetData(userName); } lstList.Items.Add(Item); } lblRecCount.Text = Fmt.Num(lstList.Items.Count, true) + " Users"; } catch (Exception Ex) { Err Err = new Err(Ex, Sql); Response.Write(Err.Html()); } }
public static Page LoadOrCreatePageCode(System.String pageCodeValue) { Page page = PageCache.GetByPageCode(pageCodeValue); if (page == null || page.IsNewRecord) { page = new Page() { PageCode = pageCodeValue, TemplateCode = "special", DateAdded = DateTime.Now, PublishDate = DateTime.Now, Title = Fmt.SplitTitleCase(pageCodeValue), BodyTextHtml = "Copy to be written for [" + pageCodeValue + "]<br>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diem nonummy nibh euismod tincidunt ut lacreet dolore magna aliguam erat volutpat. Ut wisis enim ad minim veniam, quis nostrud exerci tution ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis te feugifacilisi. Duis autem dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto.", RevisionStatus = "Live", PageIsALink = false, ShowInMainNav = false, ShowInFooterNav = false, SortPosition = 999 }; page.Save(); PageCache.Rebuild(); } return(page); }
private void LoadList() { string Sql = "Select ServiceItem From mcJobServices Where JobRno = 0 Order By ServiceSeq"; string CurrItem = (lstList.SelectedIndex >= 0 ? lstList.SelectedItem.Value : ""); lstList.Items.Clear(); try { DataTable dt = db.DataTable(Sql); foreach (DataRow r in dt.Rows) { ListItem Item = new ListItem(DB.Str(r["ServiceItem"])); if (Item.Value.Length > 0) { Item.Selected = (Item.Value == CurrItem); lstList.Items.Add(Item); } } lblRecCount.Text = Fmt.Num(lstList.Items.Count, true) + " Services"; } catch (Exception Ex) { Err Err = new Err(Ex); Response.Write(Err.Html()); } }
protected override void SkipValue(ReadOnlySpan <byte> source) { if (Fmt.Skip <LineItemKey>(source)) { Fmt.Skip <int>(source); } }
protected override void DeserializeMembers(ReadOnlySpan <byte> source, Order instance) { instance.Id = Fmt.DeserializeStructDefault <int>(source); instance.CustomerId = Fmt.DeserializeStructDefault <int>(source); // we ignore itemnsIsNull here as our class does not allow a null LineItems property Fmt.DeserializeObjects <LineItem>(source, (item) => instance.LineItems.Add(item), out bool itemsIsNull); }
protected override void SkipValue(ReadOnlySpan <byte> source) { if (Fmt.Skip <int>(source)) { Fmt.Skip <string>(source); } }
private void LoadList() { string Sql = "Select Distinct CrewMember From mcJobCrew " + "Where CrewMember Is Not Null Order By CrewMember"; string CurrItem = (lstList.SelectedIndex >= 0 ? lstList.SelectedItem.Value : ""); lstList.Items.Clear(); try { DataTable dt = db.DataTable(Sql); foreach (DataRow r in dt.Rows) { ListItem Item = new ListItem(DB.Str(r["CrewMember"])); Item.Selected = (Item.Value == CurrItem); lstList.Items.Add(Item); } lblRecCount.Text = Fmt.Num(lstList.Items.Count, true) + " Crew Members"; } catch (Exception Ex) { Err Err = new Err(Ex); Response.Write(Err.Html()); } }
private void LoadList(bool fNext) { string Sql = "Select CustomerRno, Name, InactiveDtTm " + "From Customers c"; if (!chkShowHidden.Checked) { Sql += " Where (InactiveDtTm Is Null)"; } Sql += " Order by Name"; string CurrItem = (lstList.SelectedIndex >= 0 ? lstList.SelectedItem.Value : ""); string NextCurrItem = (lstList.SelectedIndex >= 0 && lstList.SelectedIndex + 1 < lstList.Items.Count ? lstList.Items[lstList.SelectedIndex + 1].Value : string.Empty); if (!fNext && CurrItem.Length > 0) { NextCurrItem = CurrItem; } if (!fNext && fStartHere) { NextCurrItem = StartHere; } lstList.Items.Clear(); LoadListSql(Sql, NextCurrItem); lblRecCount.Text = Fmt.Num(lstList.Items.Count, true) + " Customers"; }
protected void btnReport_Click(object sender, System.EventArgs e) { if (rdoWeek.Checked) { dtBeg = Convert.ToDateTime(txtWeekDate.Text); dtEnd = EndDate(dtBeg.AddDays(6)); CalPeriod = CalSched.ViewPeriod.Week; sPeriod = "Week Beginning " + Fmt.Dt(dtBeg); } if (rdoMonth.Checked) { dtBeg = Convert.ToDateTime(txtMonthDate.Text); dtBeg = dtBeg.AddDays(1 - dtBeg.Day); dtEnd = EndDate(dtBeg.AddMonths(1).AddDays(-1)); CalPeriod = CalSched.ViewPeriod.Month; sPeriod = "Month of " + dtBeg.ToString("MMMM yyyy"); } if (rdoRange.Checked) { dtBeg = Convert.ToDateTime(txtBegDateRange.Text); dtEnd = Convert.ToDateTime(txtEndDateRange.Text); CalPeriod = ((dtEnd.Ticks - dtBeg.Ticks) / TimeSpan.TicksPerDay < 7 ? CalSched.ViewPeriod.Week : CalSched.ViewPeriod.Month); dtEnd = EndDate(dtEnd); sPeriod = "Date Range " + Fmt.Dt(dtBeg) + " - " + Fmt.Dt(dtEnd); } fReport = true; }
/// <summary> /// Override this if you want to add breadcrumb /// </summary> public virtual void InitBread() { if (IsAdminSection) { if (IncludeHome) { AddBreadcrumb(0, "Home"); SetBreadcrumb(0, "Home", Web.Root); } AddBreadcrumb(1, "Admin"); SetBreadcrumb(1, "Admin", DefaultUrl); if (HttpContext.Current.Request.ServerVariables["SCRIPT_NAME"].ToLower().Contains("admin/edit") || Web.PageFileName.ToLower().Contains("edit.aspx")) { //lost during edit, assume level 3, create level 2 #if MVC var tableName = HttpContext.Current.Request.ServerVariables["SCRIPT_NAME"].Substring(0, HttpContext.Current.Request.ServerVariables["SCRIPT_NAME"].ToLower().IndexOf("admin/edit/")); tableName = tableName.Substring(tableName.LastIndexOf("/") + 1); #else var tableName = Web.PageFileName.Substring(0, Web.PageFileName.ToLower().IndexOf("edit.aspx")); #endif var newlabel = Fmt.SplitTitleCase(tableName).Plural(); AddBreadcrumb(2, newlabel); #if MVC SetBreadcrumb(2, newlabel, Web.ResolveUrl("~/admin/") + tableName + "Admin/"); #else SetBreadcrumb(2, newlabel, Web.ResolveUrl("~/admin/") + tableName + "List.aspx"); #endif } } else { AddBreadcrumb(0, "Home"); SetBreadcrumb(0, "Home", DefaultUrl); } }
protected void GetData() { string Sql = string.Format("Select * From SysParms Where SysParmName = {0}", DB.PutStr(Misc.cnSlingUserEmail)); ClearData(); try { DataRow dr = db.DataRow(Sql); if (dr != null) { hfEmailRno.Value = DB.Int32(dr["SysParmRno"]).ToString(); txtUser.Text = DB.Str(dr["SysParmValue"]); txtCreatedDt.Text = Fmt.DtTm(DB.DtTm(dr["CreatedDtTm"])); txtCreatedUser.Text = DB.Str(dr["CreatedUser"]); txtUpdatedDt.Text = Fmt.DtTm(DB.DtTm(dr["UpdatedDtTm"])); txtUpdatedUser.Text = DB.Str(dr["UpdatedUser"]); } Sql = string.Format("Select * From SysParms Where SysParmName = {0}", DB.PutStr(Misc.cnSlingUserPassword)); dr = db.DataRow(Sql); if (dr != null) { hfPasswordRno.Value = DB.Int32(dr["SysParmRno"]).ToString(); txtPassword.Text = DB.Str(dr["SysParmValue"]); } } catch (Exception Ex) { Err Err = new Err(Ex, Sql); Response.Write(Err.Html()); } }
public string FormatJob(DataRow dr) { string sReport = Fmt.Tm12Hr(DB.DtTm(dr["ReportTime"])); string sReportNote = sReport; string sMeal = Fmt.Tm12Hr(DB.DtTm(dr["MealTime"])); if (sReport.Length == 0) { if (sMeal.Length > 0) { sReport = sMeal + "<sup>*</sup>"; sReportNote = sMeal; fNoReportTime = true; } else { sReport = "N/A"; sReportNote = "N/A"; fNoReportTime = false; } } string Html = WebPage.Tabs(3) + WebPage.Table("width='100%' class='NoBorder'") + WebPage.Tabs(4) + "<tr>\n" + WebPage.Tabs(5) + "<td><span class='CalMainTime'><a href='javascript:ShowJob(" + iJobNum + ");' title='Report Time: " + sReportNote + "\nMeal Time: " + sMeal + "\nClick to see details of this job.'>" + sReport + "</a></span></td>\n" + WebPage.Tabs(5) + "<td> </td>\n" + WebPage.Tabs(5) + "<td align='right'><span class='CalMinorTime'>" + sMeal + "</span></td>\n" + WebPage.Tabs(4) + "</tr>\n" + WebPage.Tabs(3) + WebPage.TableEnd() + WebPage.Tabs(3) + WebPage.Table("class='NoBorder'") + WebPage.Tabs(4) + WebPage.SpaceTr(10, 1) + (fMaster ? WebPage.Tabs(4) + "<tr><td colspan='2'><b>" + DB.Str(dr["CrewMember"]) + "</b></td></tr>\n" : "") + JobField(dr, "Customer") + JobField(dr, "CrewAssignment") + JobField(dr, "Note") + WebPage.Tabs(4) + "<tbody id='tblJob" + iJobNum + "' style='display: none;'>\n" + JobField(dr, "Location") + JobField(dr, "EventType") + JobField(dr, "ServiceType") + WebPage.Tabs(4) + "</tbody>\n" + WebPage.Tabs(3) + WebPage.TableEnd(); iJobNum++; DateTime dtReport = DB.DtTm(dr["ReportTm"]); sReport = new DateTime(dtReport.Year, dtReport.Month, dtReport.Day, 0, 0, 0).ToString("M/d/yyyy"); // if this date hasn't seen yet if (scDays.IndexOf(sReport) < 0) { scDays.Add(sReport); cDays++; } return(Html); }
protected override void DeserializeMembers(SalesRep instance) { string val = null; // when using a property we need an intermediate variable Fmt.Deserialize <string>(ref val); instance.Name = val; Fmt.Deserialize <string>(ref instance.phoneNumber); }
private string CleanNiceFileName(string niceFileName) { if (niceFileName == null) { return(null); } return(Fmt.CleanString(niceFileName, "[^a-zA-Z0-9 _\\-\\.]")); }
public ActionResult GetExampleJsHtml() { // include this with a script tag // this gets around restrictions on bringing in html from another domain name var html = Util.HttpGet(Web.BaseUrl + "SomeExampleUrl"); string script = "var theHtml = " + Fmt.JsEnquote(html) + ";"; return(JavaScript(script)); }
protected override void SerializeValue(StockItem value) { Fmt.Serialize <string>(value.name); Fmt.Serialize <string>(value.category); Fmt.Serialize <string>(value.vendor); Fmt.Serialize <string>(value.sku); Fmt.Serialize <float>(value.price); Fmt.Serialize <int>(value.quantity); }
protected override void DeserializeMembers(StockItem instance) { Fmt.Deserialize <string>(ref instance.name); Fmt.Deserialize <string>(ref instance.category); Fmt.Deserialize <string>(ref instance.vendor); Fmt.Deserialize <string>(ref instance.sku); instance.price = Fmt.Deserialize <float>(); instance.quantity = Fmt.Deserialize <int>(); }
/// <summary> /// Loads existing record and shows view form, with cancel button /// GET: /Admin/Competition/View/5 /// </summary> public ActionResult Export(int id) { Breadcrumbs.Current.AddBreadcrumb(3, "Export Competition"); var record = Models.Competition.LoadID(id); var entries = record.CompetitionEntries; Beweb.Export.ExportToExcel(entries, "Competition " + id + " entries " + Fmt.Date(DateTime.Today) + ".xls"); return(null); }
// prepare the SQL script to retrieve the menu category/items and then fill the list control private void LoadList() { string Sql = ""; string SqlSelect = "Select Distinct c.Category, c.MultSelFlg As CatMultSelFlg, c.SortOrder, " + "i.MenuItemRno, i.MenuItem, i.MultSelFlg, i.MultItems, i.IngredSelFlg, i.RecipeRno, " + "IsNull(i.CategorySortOrder, 0) As ItemSortOrder, i.ServingQuote, i.ServingPrice, i.InaccuratePriceFlg, " + "r.GlutenFreeFlg, r.VeganFlg, r.VegetarianFlg, r.DairyFreeFlg, r.NutsFlg " + "From mcJobMenuItems i Inner Join mcJobMenuCategories c On i.Category = c.Category " + "Left Join Recipes r on i.RecipeRno = r.RecipeRno"; string SqlOrderBy; string[] aCategory = null; string List = ""; if (rbSortCategory.Checked) { SqlOrderBy = " Order By c.SortOrder, c.Category, ItemSortOrder, i.MenuItem"; } else if (rbSortCategoryAlpha.Checked) { SqlOrderBy = " Order By c.Category, ItemSortOrder, i.MenuItem"; //aCategory = new string[] { "Meats", "Sides", "Salads", "Bread", "Desserts", "Drink" }; } else { SqlOrderBy = " Order By i.MenuItem, c.Category"; } string CurrItem = (lstList.SelectedIndex >= 0 ? lstList.SelectedItem.Value : ""); lstList.Items.Clear(); if (aCategory != null) { foreach (string Category in aCategory) { Sql = SqlSelect + "Where Category = " + DB.PutStr(Category) + " And i.HideFlg != 1 " + SqlOrderBy; LoadListSql(Sql, CurrItem); List += ", '" + Category + "'"; } List = List.Substring(2); } Sql = SqlSelect; if (List.Length > 0) { Sql += "Where Category Not In (" + List + ") "; } Sql += (Sql.IndexOf("Where") > -1 ? " And " : " Where ") + "(i.HideFlg = 0 Or i.HideFlg Is Null) And (c.HideFlg = 0 Or c.HideFlg Is Null)"; Sql += SqlOrderBy; LoadListSql(Sql, CurrItem); lblRecCount.Text = Fmt.Num(lstList.Items.Count, true) + " Items"; }
private void Init() { m_FileStream = m_FileInfo.OpenRead(); m_Riff = new Riff(); m_Fmt = new Fmt(); m_Data = new Data(); }