private void RegistrarInformacion() { if (BooleanType.FromString(this.cboPrestacion.Inicial)) { ClienteFactor.cClienteComisionista clienteComisionista = new ClienteFactor.cClienteComisionista(2); clienteComisionista.Consulta(IntegerType.FromString(((TextBox)this.txtCliente).Text), this.dtpFInicio.Value.Year, this.dtpFInicio.Value.Month, Globals.GetInstance._Usuario); if (Decimal.Compare(Decimal.Add(new Decimal(IntegerType.FromString(((TextBox)this.txtMonto).Text)), clienteComisionista.MontoDeduccion), clienteComisionista.MontoComision) < 0) { ClienteFactor.cClienteDeduccion clienteDeduccion = new ClienteFactor.cClienteDeduccion(0, IntegerType.FromString(((TextBox)this.txtCliente).Text), 0, this.cboPrestacion.Identificador, new Decimal(IntegerType.FromString(((TextBox)this.txtMonto).Text)), this.dtpFInicio.Value, Globals.GetInstance._Usuario); this.DatosSalvados = true; this.Close(); } else { int num = (int)MessageBox.Show("El monto supera las comisiones del mes anterior Comisiones:" + StringType.FromDecimal(clienteComisionista.MontoComision) + " Deducciones: " + StringType.FromDecimal(clienteComisionista.MontoDeduccion), this.Text, MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } } else { ClienteFactor.cClienteDeduccion clienteDeduccion = new ClienteFactor.cClienteDeduccion(0, IntegerType.FromString(((TextBox)this.txtCliente).Text), 0, this.cboPrestacion.Identificador, new Decimal(IntegerType.FromString(((TextBox)this.txtMonto).Text)), this.dtpFInicio.Value, Globals.GetInstance._Usuario); this.DatosSalvados = true; if (StringType.StrCmp(clienteDeduccion._Status, "AUTORIZADO", false) == 0) { this.ImprimirReporte((int)Globals.GetInstance._Sucursal, clienteDeduccion._Cliente, clienteDeduccion._Secuencia); } this.Close(); } }
public void FromString(bool expected, string value) { Assert.Equal(expected, BooleanType.FromString(value)); }
public void InvalidCastString(string value) { Assert.Throws <InvalidCastException>(() => BooleanType.FromString(value)); }
public void NullData() { // Null is valid input for Boolean.FromObject Assert.Throws <InvalidCastException>(() => BooleanType.FromString(null)); }
/// <summary> /// Utility.cs \\ /// </summary> public bool isMPMap(string strMapName) { return(strMapName.Length > 3 && BooleanType.FromString(Strings.LCase(StringType.FromBoolean(strMapName.StartsWith("mp_"))))); }
/// <summary> /// ToolSettings.cs \\ Load map-unrelated user settings /// </summary> public bool loadUserSettings() { string AppPath = System.AppDomain.CurrentDomain.BaseDirectory; string toolSettings = AppPath + "\\CoD4CompileTools.settings"; if (StringType.StrCmp(FileSystem.Dir(toolSettings, FileAttribute.Normal), "", false) == 0) { return(false); } File.SetAttributes(AppPath + "\\CoD4CompileTools.settings", FileAttributes.Normal); StreamReader streamReader = new StreamReader((Stream)File.OpenRead(toolSettings)); while (streamReader.Peek() != -1) { string String1 = streamReader.ReadLine(); int count = Strings.InStr(String1, ",", CompareMethod.Binary); if (count == 0) { return(false); } string sLeft = String1.Remove(checked (count - 1), checked (String1.Length - count + 1)); string str2 = String1.Remove(0, count); if (StringType.StrCmp(sLeft, "tree", false) == 0) { Variables.strTreePath = str2; this.updateLocalPaths(); this.fillMapList(); } else if (StringType.StrCmp(sLeft, "mapname", false) == 0) { int num1 = -1; int num2 = 0; int num3 = checked (lstMapFiles.Items.Count - 1); int index = num2; while (index <= num3) { if (ObjectType.ObjTst(lstMapFiles.Items[index], (object)str2, false) == 0) { num1 = index; } checked { ++index; } } if (num1 >= 0) { lstMapFiles.SelectedIndex = num1; } } else if (StringType.StrCmp(sLeft, "developer", false) == 0) { chkDeveloper.IsChecked = BooleanType.FromString(str2); } else if (StringType.StrCmp(sLeft, "developerscript", false) == 0) { chkDeveloperScript.IsChecked = BooleanType.FromString(str2); } else if (StringType.StrCmp(sLeft, "cheats", false) == 0) { chkCheats.IsChecked = BooleanType.FromString(str2); } else if (StringType.StrCmp(sLeft, "tab", false) == 0) { compileTab.SelectedIndex = IntegerType.FromString(str2); } else if (StringType.StrCmp(sLeft, "chkCustomCommandLine", false) == 0) { chkCustomCommandLine.IsChecked = BooleanType.FromString(str2); } else if (StringType.StrCmp(sLeft, "moveToUsermaps", false) == 0) { Variables.copyToUsermaps = BooleanType.FromString(str2); } else if (StringType.StrCmp(sLeft, "txtCustomCommandLine", false) == 0) { txtCustomCommandLine.Text = str2; } else if (StringType.StrCmp(sLeft, "exeGameMp", false) == 0) { Variables.strGameMpName = str2; } else if (StringType.StrCmp(sLeft, "exeRadiant", false) == 0) { Variables.strRadiantName = str2; } // GLSL->HLSL Syntax Converter else if (StringType.StrCmp(sLeft, "sgen_width", false) == 0) { Variables.SyntaxConverterWidth = DoubleType.FromString(str2); } else if (StringType.StrCmp(sLeft, "sgen_height", false) == 0) { Variables.SyntaxConverterHeight = DoubleType.FromString(str2); } else if (StringType.StrCmp(sLeft, "sgen_font", false) == 0) { Variables.SyntaxConverterFontSize = DoubleType.FromString(str2); } else if (StringType.StrCmp(sLeft, "sgen_optimise", false) == 0) { Variables.SyntaxConverterOptimise = BooleanType.FromString(str2); } } streamReader.Close(); return(true); }
private void LoadSavedSetting(string strLine) { int count = Strings.InStr(strLine, ",", CompareMethod.Binary); if (count == 0) { return; } string sLeft = strLine.Remove(checked (count - 1), checked (strLine.Length - count + 1)); string str = strLine.Remove(0, count); if (StringType.StrCmp(sLeft, "bsp", false) == 0) { chkBSP.IsChecked = BooleanType.FromString(str); } else if (StringType.StrCmp(sLeft, "light", false) == 0) { chkLight.IsChecked = BooleanType.FromString(str); } else if (StringType.StrCmp(sLeft, "paths", false) == 0) { chkPaths.IsChecked = BooleanType.FromString(str); } else if (StringType.StrCmp(sLeft, "onlyents", false) == 0) { chkOnlyEnts.IsChecked = BooleanType.FromString(str); } else if (StringType.StrCmp(sLeft, "blocksize", false) == 0) { chkBlockSize.IsChecked = BooleanType.FromString(str); } else if (StringType.StrCmp(sLeft, "blocksize_value", false) == 0) { txtBlockSize.Text = str; } else if (StringType.StrCmp(sLeft, "samplescale", false) == 0) { chkSampleScale.IsChecked = BooleanType.FromString(str); } else if (StringType.StrCmp(sLeft, "samplescale_value", false) == 0) { txtSampleScale.Text = str; } else if (StringType.StrCmp(sLeft, "debugLightmaps", false) == 0) { chkDebugLightMaps.IsChecked = BooleanType.FromString(str); } else if (StringType.StrCmp(sLeft, "bspoptions", false) == 0) { txtBSPOptions.Text = str; } else if (StringType.StrCmp(sLeft, "fast", false) == 0) { chkLightFast.IsChecked = BooleanType.FromString(str); } else if (StringType.StrCmp(sLeft, "extra", false) == 0) { chkLightExtra.IsChecked = BooleanType.FromString(str); } else if (StringType.StrCmp(sLeft, "verbose", false) == 0) { chkLightVerbose.IsChecked = BooleanType.FromString(str); } else if (StringType.StrCmp(sLeft, "modelshadow", false) == 0) { chkModelShadow.IsChecked = BooleanType.FromString(str); } else if (StringType.StrCmp(sLeft, "nomodelshadow", false) == 0) { chkNoModelShadow.IsChecked = BooleanType.FromString(str); } else if (StringType.StrCmp(sLeft, "dumpoptions", false) == 0) { chkDumpOptions.IsChecked = BooleanType.FromString(str); } else if (StringType.StrCmp(sLeft, "traces", false) == 0) { chkTraces.IsChecked = BooleanType.FromString(str); } else if (StringType.StrCmp(sLeft, "traces_value", false) == 0) { txtTraces.Text = str; } else if (StringType.StrCmp(sLeft, "bouncefraction", false) == 0) { chkBounceFraction.IsChecked = BooleanType.FromString(str); } else if (StringType.StrCmp(sLeft, "bouncefraction_value", false) == 0) { txtBounceFraction.Text = str; } else if (StringType.StrCmp(sLeft, "jitter", false) == 0) { chkJitter.IsChecked = BooleanType.FromString(str); } else if (StringType.StrCmp(sLeft, "jitter_value", false) == 0) { txtJitter.Text = str; } else if (StringType.StrCmp(sLeft, "chkCustomCommandLineBSP", false) == 0) { chkCustomCommandLineBSP.IsChecked = BooleanType.FromString(str); } else if (StringType.StrCmp(sLeft, "chkCustomCommandLineLight", false) == 0) { chkCustomCommandLineLight.IsChecked = BooleanType.FromString(str); } else { if (StringType.StrCmp(sLeft, "lightoptions", false) != 0) { return; } txtLightOptions.Text = str; } }