/// <summary> /// Adds any formatting to text encoded using the FormattedTextToDB function /// </summary> /// <param name="toFormat">Encoded text to decode</param> /// <returns></returns> public static string FormattedTextFromDB(string toFormat) { string toReturn = toFormat; char CR; char LF; CR = System.Convert.ToChar(13); LF = System.Convert.ToChar(10); toReturn = toReturn.Replace("{<CR>}", CR.ToString()); toReturn = toReturn.Replace("{<LF>}", LF.ToString()); toReturn = toReturn.Replace("{<AP>}", "'"); return(toReturn); }
public string[] GetData() { return(new string[] { name, type, price.ToString() + "$", count.ToString(), unit, CR.ToString(), CTR.ToString(), Users.ToString(), Clicks.ToString(), Views.ToString(), UserPrice.ToString() + "$" }); }
internal CMException(CR result, String method) : base(method + " returned " + result.ToString()) { }
public void Show(Canvas p, Thickness m) { if (can != null) { can.Visibility = Visibility.Visible; can.Margin = m; return; } can = new Canvas(); can.Background = new SolidColorBrush(Colors.White); can.Margin = m; can.Width = 310; can.Height = 420; p.Children.Add(can); CreateMod(can); CreateModA(can); SA = new Slider(); SA.Foreground = new SolidColorBrush(Colors.Black); SA.Height = 20; SA.Width = 256; SA.Maximum = 255; SA.Value = 255; SA.ValueChanged += (o, e) => { CA = (byte)SA.Value; TA.Text = "A:" + CA.ToString(); bor.Background = new SolidColorBrush(Color.FromArgb(CA, CR, CG, CB)); }; SR = new Slider(); SR.Foreground = new SolidColorBrush(Colors.Red); SR.Height = 20; SR.Width = 256; SR.Maximum = 255; SR.Value = 255; SR.ValueChanged += (o, e) => { CR = (byte)SR.Value; TR.Text = "R:" + CR.ToString(); bor.Background = new SolidColorBrush(Color.FromArgb(CA, CR, CG, CB)); }; SG = new Slider(); SG.Foreground = new SolidColorBrush(Color.FromArgb(255, 0, 255, 0)); SG.Height = 20; SG.Width = 256; SG.Maximum = 255; SG.ValueChanged += (o, e) => { CG = (byte)SG.Value; TG.Text = "G:" + CG.ToString(); bor.Background = new SolidColorBrush(Color.FromArgb(CA, CR, CG, CB)); }; SB = new Slider(); SB.Foreground = new SolidColorBrush(Colors.Blue); SB.Height = 20; SB.Width = 256; SB.Maximum = 255; SB.ValueChanged += (o, e) => { CB = (byte)SB.Value; TB.Text = "B:" + CB.ToString(); bor.Background = new SolidColorBrush(Color.FromArgb(CA, CR, CG, CB)); }; can.Children.Add(SA); can.Children.Add(SR); can.Children.Add(SG); can.Children.Add(SB); TA = new TextBlock(); TA.Text = "A:255"; TR = new TextBlock(); TR.Text = "R:255"; TR.Foreground = new SolidColorBrush(Color.FromArgb(255, 255, 0, 0)); TG = new TextBlock(); TG.Text = "G:0"; TG.Foreground = new SolidColorBrush(Color.FromArgb(255, 0, 255, 0)); TB = new TextBlock(); TB.Text = "B:0"; TB.Foreground = new SolidColorBrush(Color.FromArgb(255, 0, 0, 255)); can.Children.Add(TA); can.Children.Add(TR); can.Children.Add(TG); can.Children.Add(TB); bor = new Border(); bor.Width = 48; bor.Height = 48; bor.Background = new SolidColorBrush(Color.FromArgb(255, 255, 0, 0)); can.Children.Add(bor); CA = 255; CR = 255; CG = 0; CB = 0; cancel = new Button(); cancel.Content = cancel_s[Component.language]; cancel.Click += (o, e) => { can.Visibility = Visibility.Collapsed; }; can.Children.Add(cancel); ok = new Button(); ok.Content = ok_s[Component.language]; ok.Click += (o, e) => { if (Seletced != null) { Seletced(Color.FromArgb(CA, CR, CG, CB)); } can.Visibility = Visibility.Collapsed; }; can.Children.Add(ok); Order(); }
protected void Button_find_diamonds_Click(object sender, EventArgs e) { List <string> list_shapes = new List <string>(); List <string> list_clarity = new List <string>(); List <string> list_color = new List <string>(); List <string> list_cut = new List <string>(); List <string> list_polish = new List <string>(); List <string> list_symmetry = new List <string>(); List <string> list_lab = new List <string>(); double weightMin; double weightMax; double priceMin; double priceMax; string name; #region SHAPE List <string> list_shapes_ = s.readfromyDS("Shape"); foreach (var S in list_shapes_) { var chk_SHAPE = (HtmlInputCheckBox)SAHPE.FindControl("ShapeCB_" + S.ToString()); if (chk_SHAPE.Checked == true) { list_shapes.Add(S.ToString()); } } #endregion #region Weight HtmlInputGenericControl weightMin_control = (HtmlInputGenericControl)WEIGHT.FindControl("weightMin"); if (weightMin_control.Value == "".ToString()) { weightMin_control.Value = "0.1"; } weightMin = Convert.ToDouble(weightMin_control.Value); HtmlInputGenericControl weightMax_control = (HtmlInputGenericControl)WEIGHT.FindControl("weightMax"); if (weightMax_control.Value == "".ToString()) { weightMax_control.Value = "0.1"; } weightMax = Convert.ToDouble(weightMax_control.Value); #endregion #region Price HtmlInputGenericControl priceMin_control = (HtmlInputGenericControl)WEIGHT.FindControl("priceMin"); if (priceMin_control.Value == "".ToString()) { priceMin_control.Value = "1"; } priceMin = Convert.ToDouble(priceMin_control.Value.ToString()); HtmlInputGenericControl priceMax_control = (HtmlInputGenericControl)WEIGHT.FindControl("priceMax"); if (priceMax_control.Value == "".ToString()) { priceMax_control.Value = "1"; } priceMax = Convert.ToDouble(priceMax_control.Value.ToString()); #endregion #region CLARITY List <string> list_clarity_ = s.readfromyDS("Clarity"); foreach (var C in list_clarity_) { CheckBox chk_CLARITY = (CheckBox)CLARITY.FindControl("ClarityCB_" + C.ToString()); if (chk_CLARITY.Checked == true) { list_clarity.Add(C.ToString()); } } #endregion #region COLOR List <string> list_color_ = s.readfromyDS("Color"); foreach (var CR in list_color_) { CheckBox chk_COLOR = (CheckBox)COLOR.FindControl("ColorCB_" + CR.ToString()); if (chk_COLOR.Checked == true) { list_color.Add(CR.ToString()); } } #endregion #region CUT List <string> list_cut_ = s.readfromyDS("Cut"); foreach (var CU_ in list_cut_) { CheckBox chk_CUT = (CheckBox)CUT.FindControl("CutCB_" + CU_.ToString()); if (chk_CUT.Checked == true) { list_cut.Add(CU_.ToString()); } } #endregion #region POLISH List <string> list_polish_ = s.readfromyDS("Polish"); foreach (var P in list_polish_) { CheckBox chk_P = (CheckBox)POLISH.FindControl("PolishCB_" + P.ToString()); if (chk_P.Checked == true) { list_polish.Add(P.ToString()); } } #endregion #region SYMMETRY List <string> list_symmetry_ = s.readfromyDS("Symmetry"); foreach (var SYM in list_symmetry_) { CheckBox chk_SYM = (CheckBox)SYMMETRY.FindControl("SymmetryCB_" + SYM.ToString()); if (chk_SYM.Checked == true) { list_symmetry.Add(SYM.ToString()); } } #endregion #region LAB List <string> list_lab_ = s.readfromyDS("Lab"); foreach (var LAB_ in list_lab_) { CheckBox chk_LAB = (CheckBox)LAB.FindControl("LabCB_" + LAB_.ToString()); if (chk_LAB.Checked == true) { list_lab.Add(LAB_.ToString()); } } #endregion #region Name HtmlInputText txt_name = (HtmlInputText)NAME.FindControl("Search_By_ID".ToString()); name = txt_name.Value; #endregion addproducts_after_filter(list_shapes, list_clarity, list_color, list_cut, list_polish, list_symmetry, list_lab, weightMin, weightMax, priceMin, priceMax, name); }