public override bool UpdateLocalCurrency(System.Int32 localCurrencyId, System.Double?exchangeRate, System.Boolean Inactive, System.Int32 clientNo, System.Int32?updatedBy)
        {
            SqlConnection cn  = null;
            SqlCommand    cmd = null;

            try
            {
                cn              = new SqlConnection(this.ConnectionString);
                cmd             = new SqlCommand("usp_update_LocalCurrency", cn);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add("@LocalCurrencyId", SqlDbType.Int).Value  = localCurrencyId;
                cmd.Parameters.Add("@ExchangeRate", SqlDbType.Decimal).Value = exchangeRate;
                cmd.Parameters.Add("@Inactive", SqlDbType.Bit).Value         = Inactive;
                cmd.Parameters.Add("@ClientNo", SqlDbType.Int).Value         = clientNo;
                cmd.Parameters.Add("@UpdatedBy", SqlDbType.Int).Value        = updatedBy;
                cmd.Parameters.Add("@RowsAffected", SqlDbType.Int).Direction = ParameterDirection.Output;
                cn.Open();
                int ret = ExecuteNonQuery(cmd);
                return(ret > 0);
            }
            catch (SqlException sqlex)
            {
                //LogException(sqlex);
                throw new Exception("Failed to update LocalCurrency", sqlex);
            }
            finally
            {
                cmd.Dispose();
                cn.Close();
                cn.Dispose();
            }
        }
Exemple #2
0
        /// <summary>
        /// Update DebitLine
        /// Calls [usp_update_DebitLine]
        /// </summary>
        public override bool Update(System.Int32?debitLineId, System.Int32?quantity, System.Double?price, System.String part, System.String supplierPart, System.String notes, System.Int32?updatedBy, System.Boolean?printHazardous)
        {
            SqlConnection cn  = null;
            SqlCommand    cmd = null;

            try {
                cn              = new SqlConnection(this.ConnectionString);
                cmd             = new SqlCommand("usp_update_DebitLine", cn);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add("@DebitLineId", SqlDbType.Int).Value       = debitLineId;
                cmd.Parameters.Add("@Quantity", SqlDbType.Int).Value          = quantity;
                cmd.Parameters.Add("@Price", SqlDbType.Float).Value           = price;
                cmd.Parameters.Add("@Part", SqlDbType.NVarChar).Value         = part;
                cmd.Parameters.Add("@SupplierPart", SqlDbType.NVarChar).Value = supplierPart;
                cmd.Parameters.Add("@Notes", SqlDbType.NVarChar).Value        = notes;
                cmd.Parameters.Add("@UpdatedBy", SqlDbType.Int).Value         = updatedBy;
                cmd.Parameters.Add("@PrintHazardous", SqlDbType.Bit).Value    = printHazardous;
                cmd.Parameters.Add("@RowsAffected", SqlDbType.Int).Direction  = ParameterDirection.Output;
                cn.Open();
                int ret = ExecuteNonQuery(cmd);
                return(ret > 0);
            } catch (SqlException sqlex) {
                //LogException(sqlex);
                throw new Exception("Failed to update DebitLine", sqlex);
            } finally {
                cmd.Dispose();
                cn.Close();
                cn.Dispose();
            }
        }
        /// <summary>
        /// Create a new row
        /// Calls [usp_insert_GlobalTaxRate]
        /// </summary>
        public override Int32 Insert(System.DateTime?taxDate, System.Int32?taxNo, System.Double?rate1, System.Double?rate2, System.Int32?updatedBy)
        {
            SqlConnection cn  = null;
            SqlCommand    cmd = null;

            try {
                cn              = new SqlConnection(this.ConnectionString);
                cmd             = new SqlCommand("usp_insert_GlobalTaxRate", cn);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add("@TaxDate", SqlDbType.DateTime).Value  = taxDate;
                cmd.Parameters.Add("@TaxNo", SqlDbType.Int).Value         = taxNo;
                cmd.Parameters.Add("@Rate1", SqlDbType.Float).Value       = rate1;
                cmd.Parameters.Add("@Rate2", SqlDbType.Float).Value       = rate2;
                cmd.Parameters.Add("@UpdatedBy", SqlDbType.Int).Value     = updatedBy;
                cmd.Parameters.Add("@TaxRateId", SqlDbType.Int).Direction = ParameterDirection.Output;
                cn.Open();
                int ret = ExecuteNonQuery(cmd);
                return((Int32)cmd.Parameters["@TaxRateId"].Value);
            } catch (SqlException sqlex) {
                //LogException(sqlex);
                throw new Exception("Failed to insert TaxRate", sqlex);
            } finally {
                cmd.Dispose();
                cn.Close();
                cn.Dispose();
            }
        }
Exemple #4
0
        /// <summary>
        /// This method is called during deserialization to convert a given value to a specific typed value (Double?).
        /// </summary>
        /// <param name="serializationContext">The current serialization context instance.</param>
        /// <param name="modelELement">ModdelElement, to which the property belongs to.</param>
        /// <param name="propertyName">The Property name, which value is to be converted.</param>
        /// <param name="value">Value to convert.</param>
        /// <param name="targetType">Type, the object is to be converted to.</param>
        /// <param name="isRequired">True if this property is marked as required in the domain model. Can be null.</param>
        /// <returns>Converted value.</returns>
        public override global::System.Double?ConvertTypedObjectDoubleFrom(DslModeling::SerializationContext serializationContext, DslModeling::ModelElement modelELement, string propertyName, object value, System.Type targetType, bool?isRequired)
        {
            if (value is string)
            {
                if (String.IsNullOrEmpty(value as string))
                {
                    return(null);
                }

                if (String.IsNullOrWhiteSpace(value as string))
                {
                    return(null);
                }

                try
                {
                    System.Double?d = Convert.ToDouble(value, System.Globalization.CultureInfo.InvariantCulture);
                    return(d);
                }
                catch (Exception ex)
                {
                    serializationContext.Result.AddMessage(new DslModeling::SerializationMessage(
                                                               DslModeling::SerializationMessageKind.Error, "Couldnt convert " + value + " to Double: " + ex.ToString(), "", 0, 0, null));
                }
            }

            return(null);
        }
Exemple #5
0
        /// <summary>
        /// Create a new row
        /// Calls [usp_insert_Lot]
        /// </summary>
        public override Int32 Insert(System.Int32?clientNo, System.String lotName, System.Double?cost, System.Int32?currencyNo, System.Boolean?onHold, System.Boolean?consignment, System.String notes, System.String lotCode, System.Int32?updatedBy, System.Int32?LockForCustomerNo)
        {
            SqlConnection cn  = null;
            SqlCommand    cmd = null;

            try {
                cn              = new SqlConnection(this.ConnectionString);
                cmd             = new SqlCommand("usp_insert_Lot", cn);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add("@ClientNo", SqlDbType.Int).Value               = clientNo;
                cmd.Parameters.Add("@LotName", SqlDbType.NVarChar).Value           = lotName;
                cmd.Parameters.Add("@Cost", SqlDbType.Float).Value                 = cost;
                cmd.Parameters.Add("@CurrencyNo", SqlDbType.Int).Value             = currencyNo;
                cmd.Parameters.Add("@OnHold", SqlDbType.Bit).Value                 = onHold;
                cmd.Parameters.Add("@Consignment", SqlDbType.Bit).Value            = consignment;
                cmd.Parameters.Add("@Notes", SqlDbType.NVarChar).Value             = notes;
                cmd.Parameters.Add("@LotCode", SqlDbType.NVarChar).Value           = lotCode;
                cmd.Parameters.Add("@UpdatedBy", SqlDbType.Int).Value              = updatedBy;
                cmd.Parameters.Add("@LockForCustomerNo", SqlDbType.NVarChar).Value = LockForCustomerNo;
                cmd.Parameters.Add("@LotId", SqlDbType.Int).Direction              = ParameterDirection.Output;
                cn.Open();
                int ret = ExecuteNonQuery(cmd);
                return((Int32)cmd.Parameters["@LotId"].Value);
            } catch (SqlException sqlex) {
                //LogException(sqlex);
                throw new Exception("Failed to insert Lot", sqlex);
            } finally {
                cmd.Dispose();
                cn.Close();
                cn.Dispose();
            }
        }
 public TimeVariantLocalConditionDTO(
     System.Double?p_ConditionScoreLocal,
     CL.FormulaHelper.DTOs.TimePeriodDTO p_TimePeriod)
 {
     ConditionScoreLocal = p_ConditionScoreLocal;
     TimePeriod          = p_TimePeriod;
 }
Exemple #7
0
        /// <summary>
        /// Call Proc [usp_insert_SupplierInvoice]
        /// Insert supplier invoice header
        /// </summary>
        /// <param name="clientId"></param>
        /// <param name="companyNo"></param>
        /// <param name="supplierInvoiceNumber"></param>
        /// <param name="supplierInvoiceDate"></param>
        /// <param name="supplierCode"></param>
        /// <param name="supplierName"></param>
        /// <param name="cuurencyNo"></param>
        /// <param name="amount"></param>
        /// <param name="goodsValue"></param>
        /// <param name="Tax"></param>
        /// <param name="deliveryCharge"></param>
        /// <param name="bankFee"></param>
        /// <param name="creditCardFee"></param>
        /// <param name="notes"></param>
        /// <param name="secondRef"></param>
        /// <param name="narrative"></param>
        /// <param name="canBeExported"></param>
        /// <param name="taxNo"></param>
        /// <param name="taxCode"></param>
        /// <param name="currencyCode"></param>
        /// <param name="updatedBy"></param>
        /// <returns></returns>
        public static Int32 Insert(System.Int32?clientNo, System.Int32?PurchaseHubClientNo,
                                   System.Double?amount, System.Double?goodsValue, System.Double?tax, System.Int32?taxNo, System.String taxCode, System.Double?deliveryCharge, System.Double?bankFee,
                                   System.Double?creditCardFee, System.String notes, System.String secondRef, System.String narrative, System.Boolean?canBeExported, System.Int32 updatedBy, System.Int32?currencyNo, System.String currencyCode)
        {
            Int32 objReturn = Rebound.GlobalTrader.DAL.SiteProvider.ClientInvoice.Insert(clientNo, PurchaseHubClientNo, amount, goodsValue,
                                                                                         tax, taxNo, taxCode, deliveryCharge, bankFee, creditCardFee, notes, secondRef, narrative, canBeExported, updatedBy, currencyNo, currencyCode);

            return(objReturn);
        }
Exemple #8
0
 protected void MapFrom(DataRow dr)
 {
     SolSaID          = dr["sol_sa_ID"] != DBNull.Value ? Convert.ToInt32(dr["sol_sa_ID"]) : SolSaID = null;
     SolicitudID      = dr["solicitudID"] != DBNull.Value ? Convert.ToInt32(dr["solicitudID"]) : SolicitudID = null;
     SeguroID         = dr["seguroID"] != DBNull.Value ? Convert.ToInt32(dr["seguroID"]) : SeguroID = null;
     HectAseguradas   = dr["hectAseguradas"] != DBNull.Value ? Convert.ToDouble(dr["hectAseguradas"]) : HectAseguradas = null;
     DescParcelas     = dr["descParcelas"] != DBNull.Value ? Convert.ToString(dr["descParcelas"]) : DescParcelas = null;
     CostoTotalSeguro = dr["CostoTotalSeguro"] != DBNull.Value ? Convert.ToDouble(dr["CostoTotalSeguro"]) : CostoTotalSeguro = null;
 }
Exemple #9
0
 /// <summary>
 /// Construct SmartDouble from System.Double.
 /// </summary>
 public SmartDouble(System.Double?value)
 {
     if (value.HasValue)
     {
         m_v = value.Value;
     }
     else
     {
         m_v = BadValue.m_v;
     }
 }
Exemple #10
0
        private void SetValue(System.Double?Value)
        {
            this._value = Value;
            this.OnPropertyChanged("Value");

            if (this.Binding != null)
            {
                this.UpdatingBinding = true;
                ((Model.Properties.Float) this.Binding).Value = this.Value;
                this.UpdatingBinding = false;
            }
        }
Exemple #11
0
    public static DataSet BindAlredyexistElectricity(System.Int64?elEbillID, System.Double?elBillAmount, System.Double?elLateFees, System.String elMonth, System.String elYear, System.DateTime?elLastDate, System.DateTime?elBillPaidDate, System.Double?elTotalAmount, System.String elPaidStatus, System.String elExtra1)
    {
        DataSet   ds;
        Database  db;
        string    sqlCommand;
        DbCommand dbCommand;

        db         = DatabaseFactory.CreateDatabase();
        sqlCommand = "[dbo].gspTMSAlredyexistElectricitySEARCH";
        dbCommand  = db.GetStoredProcCommand(sqlCommand, elEbillID, elBillAmount, elLateFees, elMonth, elYear, elLastDate, elBillPaidDate, elTotalAmount, elPaidStatus, elExtra1);
        ds         = db.ExecuteDataSet(dbCommand);
        return(ds);
    }
Exemple #12
0
 public virtual void CopyFrom(PerformanceStatistic other)
 {
     if (other != null)
     {
         this.PerformanceStatisticId = other.PerformanceStatisticId;
         this.Cpu                 = other.Cpu;
         this.Memory              = other.Memory;
         this.CreationDate        = other.CreationDate;
         this.MachineName         = other.MachineName;
         this.IpAddress           = other.IpAddress;
         this.DriveSpaceAvailable = other.DriveSpaceAvailable;
         this.DriveTotalSpace     = other.DriveTotalSpace;
     }
 }
Exemple #13
0
 /// <summary>
 /// GetConvertedValueBetweenTwoCurrencies
 /// Calls [usp_select_Currency_ConvertedValueBetweenTwoCurrencies]
 /// </summary>
 public static Currency GetConvertedValueBetweenTwoCurrencies(System.Double?valueToBeConverted, System.Int32?currencyFromId, System.Int32?currencyToId, System.DateTime?exchangeRateDate)
 {
     Rebound.GlobalTrader.DAL.CurrencyDetails objDetails = Rebound.GlobalTrader.DAL.SiteProvider.Currency.GetConvertedValueBetweenTwoCurrencies(valueToBeConverted, currencyFromId, currencyToId, exchangeRateDate);
     if (objDetails == null)
     {
         return(null);
     }
     else
     {
         Currency obj = new Currency();
         obj.ConvertedValue = objDetails.ConvertedValue;
         objDetails         = null;
         return(obj);
     }
 }
Exemple #14
0
        /// <summary>
        /// Sets properties and attributes of class in accordance with Binary definition.
        /// </summary>
        /// <param name="Definition">Binary definition</param>
        public override Task FromXml(XmlElement Definition)
        {
            if (System.Double.TryParse(Definition.InnerText, out System.Double Value))
            {
                this.value  = Value;
                this.script = null;
            }
            else
            {
                this.value  = null;
                this.script = new Expression(Definition.InnerText);
            }

            return(Task.CompletedTask);
        }
Exemple #15
0
        /// <summary>
        /// Call Proc [usp_insert_ClientInvoiceManual]
        /// Insert client invoice header
        /// </summary>
        /// <param name="clientNo"></param>
        /// <param name="companyNo"></param>
        /// <param name="supplierInvoiceNumber"></param>
        /// <param name="supplierInvoiceDate"></param>
        /// <param name="supplierCode"></param>
        /// <param name="supplierName"></param>
        /// <param name="cuurencyNo"></param>
        /// <param name="amount"></param>
        /// <param name="goodsValue"></param>
        /// <param name="Tax"></param>
        /// <param name="deliveryCharge"></param>
        /// <param name="bankFee"></param>
        /// <param name="creditCardFee"></param>
        /// <param name="notes"></param>
        /// <param name="secondRef"></param>
        /// <param name="narrative"></param>
        /// <param name="canBeExported"></param>
        /// <param name="taxNo"></param>
        /// <param name="TaxCode"></param>
        /// <param name="currencyCode"></param>
        /// <param name="updatedBy"></param>
        /// <returns></returns>
        public override Int32 Insert(System.Int32?clientNo, System.Int32?PurchaseHubClientNo,
                                     System.Double?amount, System.Double?goodsValue, System.Double?tax, System.Int32?taxNo, System.String taxCode, System.Double?deliveryCharge, System.Double?bankFee,
                                     System.Double?creditCardFee, System.String notes, System.String secondRef, System.String narrative, System.Boolean?canBeExported, System.Int32 updatedBy, System.Int32?currencyNo, System.String currencyCode)

        {
            SqlConnection cn  = null;
            SqlCommand    cmd = null;

            try
            {
                cn              = new SqlConnection(this.ConnectionString);
                cmd             = new SqlCommand("usp_insert_ClientInvoiceManual", cn);
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add("@ClientNo", SqlDbType.Int).Value            = clientNo;
                cmd.Parameters.Add("@PurchaseHubClientNo", SqlDbType.Int).Value = PurchaseHubClientNo;

                cmd.Parameters.Add("@InvoiceAmount", SqlDbType.Float).Value     = amount;
                cmd.Parameters.Add("@GoodsValue", SqlDbType.Float).Value        = goodsValue;
                cmd.Parameters.Add("@Tax", SqlDbType.Float).Value               = tax;
                cmd.Parameters.Add("@TaxNo", SqlDbType.Int).Value               = taxNo;
                cmd.Parameters.Add("@TaxCode", SqlDbType.NVarChar).Value        = taxCode;
                cmd.Parameters.Add("@DeliveryCharge", SqlDbType.Float).Value    = deliveryCharge;
                cmd.Parameters.Add("@BankFee", SqlDbType.Float).Value           = bankFee;
                cmd.Parameters.Add("@CreditCardFee", SqlDbType.Float).Value     = creditCardFee;
                cmd.Parameters.Add("@Notes", SqlDbType.NVarChar).Value          = notes;
                cmd.Parameters.Add("@SecondRef", SqlDbType.NVarChar).Value      = secondRef;
                cmd.Parameters.Add("@Narrative", SqlDbType.NVarChar).Value      = narrative;
                cmd.Parameters.Add("@CanbeExported", SqlDbType.Bit).Value       = canBeExported;
                cmd.Parameters.Add("@UpdatedBy", SqlDbType.Int).Value           = updatedBy;
                cmd.Parameters.Add("@CurrencyNo", SqlDbType.Int).Value          = currencyNo;
                cmd.Parameters.Add("@CurrencyCode", SqlDbType.NVarChar).Value   = currencyCode;
                cmd.Parameters.Add("@ClientInvoiceNo", SqlDbType.Int).Direction = ParameterDirection.Output;
                cn.Open();
                int ret = ExecuteNonQuery(cmd);
                return((Int32)cmd.Parameters["@ClientInvoiceNo"].Value);
            }
            catch (SqlException sqlex)
            {
                //LogException(sqlex);
                throw new Exception("Failed to insert Client Invoice", sqlex);
            }
            finally
            {
                cmd.Dispose();
                cn.Close();
                cn.Dispose();
            }
        }
Exemple #16
0
    public static DataSet GetalredyexistWatersupply(System.Int64?wsWsid, System.Double?wsBillAmount, System.Double?wsLateFees, System.String wsMonth, System.String wsYear, System.DateTime?wsLastDate, System.DateTime?wsBillPaidDate, System.Double?wsTotalAmount, System.String wsPaidStatus, System.String wsBillNumber, System.String wsExtra1, System.DateTime?wsDate, System.Int32?wsStatus)
    {
        DataSet   ds;
        Database  db;
        string    sqlCommand;
        DbCommand dbCommand;


        db         = DatabaseFactory.CreateDatabase();
        sqlCommand = "[dbo].gspTMSalredyexistWatersupply";
        dbCommand  = db.GetStoredProcCommand(sqlCommand, wsWsid, wsBillAmount, wsLateFees, wsMonth, wsYear, wsLastDate, wsBillPaidDate, wsTotalAmount, wsPaidStatus, wsBillNumber, wsExtra1, wsDate, wsStatus);

        ds = db.ExecuteDataSet(dbCommand);

        return(ds);
    }
 protected void MapFrom(DataRow dr)
 {
     EntradaprodID = dr["entradaprodID"] != DBNull.Value ? Convert.ToInt32(dr["entradaprodID"]) : EntradaprodID = null;
     ProductoID    = dr["productoID"] != DBNull.Value ? Convert.ToInt32(dr["productoID"]) : ProductoID = null;
     BodegaID      = dr["bodegaID"] != DBNull.Value ? Convert.ToInt32(dr["bodegaID"]) : BodegaID = null;
     TipoMovProdID = dr["tipoMovProdID"] != DBNull.Value ? Convert.ToInt32(dr["tipoMovProdID"]) : TipoMovProdID = null;
     Fecha         = dr["Fecha"] != DBNull.Value ? Convert.ToDateTime(dr["Fecha"]) : Fecha = null;
     Cantidad      = dr["cantidad"] != DBNull.Value ? Convert.ToDouble(dr["cantidad"]) : Cantidad = null;
     Observaciones = dr["observaciones"] != DBNull.Value ? Convert.ToString(dr["observaciones"]) : Observaciones = null;
     UserID        = dr["userID"] != DBNull.Value ? Convert.ToInt32(dr["userID"]) : UserID = null;
     StoreTS       = dr["storeTS"] != DBNull.Value ? Convert.ToDateTime(dr["storeTS"]) : StoreTS = null;
     UpdateTS      = dr["updateTS"] != DBNull.Value ? Convert.ToDateTime(dr["updateTS"]) : UpdateTS = null;
     CicloID       = dr["cicloID"] != DBNull.Value ? Convert.ToInt32(dr["cicloID"]) : CicloID = null;
     Preciocompra  = dr["preciocompra"] != DBNull.Value ? Convert.ToDouble(dr["preciocompra"]) : Preciocompra = null;
     Sacos         = dr["sacos"] != DBNull.Value ? Convert.ToDouble(dr["sacos"]) : Sacos = null;
 }
Exemple #18
0
    public static TMSElectricity[] Search(System.Int64?elEbillID, System.Double?elBillAmount, System.Double?elLateFees, System.String elMonth, System.String elYear, System.DateTime?elLastDate, System.DateTime?elBillPaidDate, System.Double?elTotalAmount, System.String elPaidStatus, System.String elbIllno, System.String elBillFile, System.String elExtra1, System.String elExtra2, System.DateTime?elDate, System.Int32?elStatus)
    {
        DataSet   ds;
        Database  db;
        string    sqlCommand;
        DbCommand dbCommand;


        db         = DatabaseFactory.CreateDatabase();
        sqlCommand = "[dbo].gspTMSElectricity_SEARCH";
        dbCommand  = db.GetStoredProcCommand(sqlCommand, elEbillID, elBillAmount, elLateFees, elMonth, elYear, elLastDate, elBillPaidDate, elTotalAmount, elPaidStatus, elbIllno, elBillFile, elExtra1, elExtra2, elDate, elStatus);

        ds = db.ExecuteDataSet(dbCommand);
        ds.Tables[0].TableName = TABLE_NAME;
        return(TMSElectricity.MapFrom(ds));
    }
Exemple #19
0
    public static TMSWatersupply[] Search(System.Int64?wsWsid, System.Double?wsBillAmount, System.Double?wsLateFees, System.String wsMonth, System.String wsYear, System.DateTime?wsLastDate, System.DateTime?wsBillPaidDate, System.Double?wsTotalAmount, System.String wsPaidStatus, System.String wsBillNumber, System.String wsExtra1, System.DateTime?wsDate, System.Int32?wsStatus)
    {
        DataSet   ds;
        Database  db;
        string    sqlCommand;
        DbCommand dbCommand;


        db         = DatabaseFactory.CreateDatabase();
        sqlCommand = "[dbo].gspTMSWatersupply_SEARCH";
        dbCommand  = db.GetStoredProcCommand(sqlCommand, wsWsid, wsBillAmount, wsLateFees, wsMonth, wsYear, wsLastDate, wsBillPaidDate, wsTotalAmount, wsPaidStatus, wsBillNumber, wsExtra1, wsDate, wsStatus);

        ds = db.ExecuteDataSet(dbCommand);
        ds.Tables[0].TableName = TABLE_NAME;
        return(TMSWatersupply.MapFrom(ds));
    }
Exemple #20
0
        /// <summary>
        /// Create a new font
        /// </summary>
        /// <param name="isBold">Whether the text should be bold</param>
        /// <param name="fontFamily">The font family eg: "Arial"</param>
        /// <param name="size">The font size</param>
        /// <param name="color">The font color (value of the color theme)</param>
        /// <returns></returns>
        public static Font CreateFont(bool isBold, bool isItalic, string fontFamily, System.Double?size, string color)
        {
            Font font = new Font();

            if (size.HasValue)
            {
                FontSize fontSize = new FontSize()
                {
                    Val = size
                };
                font.Append(fontSize);
            }

            if (isItalic)
            {
                Italic italic = new Italic();
                font.Append(italic);
            }

            if (isBold)
            {
                Bold bold = new Bold();
                font.Append(bold);
            }

            if (color != null)
            {
                Color color1 = new Color()
                {
                    Rgb = color
                };
                font.Append(color1);
            }

            if (!string.IsNullOrEmpty(fontFamily))
            {
                FontName fontName = new FontName()
                {
                    Val = fontFamily
                };
                font.Append(fontName);
            }

            return(font);
        }
Exemple #21
0
        //[Benchmark]
        public System.Double?Additions_DoubleNull()
        {
            System.Double?s = 0;
            System.Double?d = 7;

            for (var cc = 0; cc < cycles; cc++)
            {
                s = 0;
                d = 7;

                for (var i = 0; i < count; i++)
                {
                    s += d;
                }
            }

            return(s);
        }
Exemple #22
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SummaryData"/> class.
 /// </summary>
 /// <param name="KnownMathCalculation">The known math calculation.</param>
 /// <param name="ValueType">Type of the value.</param>
 /// <param name="SummaryValueDouble">The summary value double.</param>
 /// <param name="SummaryValueDateTime">The summary value date time.</param>
 /// <param name="SummaryValueString">The summary value string.</param>
 /// <param name="HeaderString">The header string.</param>
 /// <param name="DisplayFormat">The display format.</param>
 public SummaryData(
     Framework.EntityContracts.KnownMathCalculations KnownMathCalculation,
     System.Type ValueType,
     System.Double?SummaryValueDouble,
     System.DateTime?SummaryValueDateTime,
     System.String SummaryValueString,
     System.String HeaderString,
     System.String DisplayFormat
     )
 {
     this.KnownMathCalculation = KnownMathCalculation;
     this.ValueType            = ValueType;
     this.SummaryValueDouble   = SummaryValueDouble;
     this.SummaryValueDateTime = SummaryValueDateTime;
     this.SummaryValueString   = SummaryValueString;
     this.HeaderString         = HeaderString;
     this.DisplayFormat        = DisplayFormat;
 }
Exemple #23
0
        /// <summary>
        /// Adds the specified known math calculation.
        /// </summary>
        /// <param name="KnownMathCalculation">The known math calculation.</param>
        /// <param name="ValueType">Type of the value.</param>
        /// <param name="SummaryValueDouble">The summary value double.</param>
        /// <param name="SummaryValueDateTime">The summary value date time.</param>
        /// <param name="SummaryValueString">The summary value string.</param>
        /// <param name="HeaderString">The header string.</param>
        /// <param name="DisplayFormat">The display format.</param>
        public void Add(
            Framework.EntityContracts.KnownMathCalculations KnownMathCalculation,
            System.Type ValueType,
            System.Double?SummaryValueDouble,
            System.DateTime?SummaryValueDateTime,
            System.String SummaryValueString,
            System.String HeaderString,
            System.String DisplayFormat)
        {
            SummaryData _Item = new SummaryData(
                KnownMathCalculation,
                ValueType,
                SummaryValueDouble,
                SummaryValueDateTime,
                SummaryValueString,
                HeaderString,
                DisplayFormat);

            this.Add(_Item);
        }
    public void Insert(System.Int32?facturaid, System.Int32?productoID, System.Double?precio, System.Double?cantidad, System.Int32?bodegaID, DbTransaction transaction)
    {
        Database  db;
        string    sqlCommand;
        DbCommand dbCommand;


        db         = DatabaseFactory.CreateDatabase();
        sqlCommand = "[dbo].gspFacturaDeProveedorDetalle_INSERT";
        dbCommand  = db.GetStoredProcCommand(sqlCommand, facturaid, productoID, precio, cantidad, bodegaID);

        if (transaction == null)
        {
            this.FacturaProveedordetalleID = Convert.ToInt32(db.ExecuteScalar(dbCommand));
        }
        else
        {
            this.FacturaProveedordetalleID = Convert.ToInt32(db.ExecuteScalar(dbCommand, transaction));
        }
        return;
    }
Exemple #25
0
    public void Insert(System.Int32?solicitudID, System.Int32?seguroID, System.Double?hectAseguradas, System.String descParcelas, System.Double?costoTotalSeguro, DbTransaction transaction)
    {
        Database  db;
        string    sqlCommand;
        DbCommand dbCommand;


        db         = DatabaseFactory.CreateDatabase();
        sqlCommand = "[dbo].gspSolicitudesSisBancosSeguroAgricola_INSERT";
        dbCommand  = db.GetStoredProcCommand(sqlCommand, solicitudID, seguroID, hectAseguradas, descParcelas, costoTotalSeguro);

        if (transaction == null)
        {
            this.SolSaID = Convert.ToInt32(db.ExecuteScalar(dbCommand));
        }
        else
        {
            this.SolSaID = Convert.ToInt32(db.ExecuteScalar(dbCommand, transaction));
        }
        return;
    }
    public void Insert(System.String racMonth, System.String racYear, System.Double?racTotalAmount, System.Double?racPaidAmount, System.Double?racAnyDues, System.Int64?racAddedById, System.String racPaidStatus, System.DateTime?racTransactionDate, System.DateTime?racDate, System.Int32?racStatus, DbTransaction transaction)
    {
        Database  db;
        string    sqlCommand;
        DbCommand dbCommand;


        db         = DatabaseFactory.CreateDatabase();
        sqlCommand = "[dbo].gspTMSRentAccountDetails_INSERT";
        dbCommand  = db.GetStoredProcCommand(sqlCommand, racMonth, racYear, racTotalAmount, racPaidAmount, racAnyDues, racAddedById, racPaidStatus, racTransactionDate, racDate, racStatus);

        if (transaction == null)
        {
            this.RACRentId = Convert.ToInt64(db.ExecuteScalar(dbCommand));
        }
        else
        {
            this.RACRentId = Convert.ToInt64(db.ExecuteScalar(dbCommand, transaction));
        }
        return;
    }
Exemple #27
0
    public void Insert(System.Double?wsBillAmount, System.Double?wsLateFees, System.String wsMonth, System.String wsYear, System.DateTime?wsLastDate, System.DateTime?wsBillPaidDate, System.Double?wsTotalAmount, System.String wsPaidStatus, System.String wsBillNumber, System.String wsExtra1, System.DateTime?wsDate, System.Int32?wsStatus, DbTransaction transaction)
    {
        Database  db;
        string    sqlCommand;
        DbCommand dbCommand;


        db         = DatabaseFactory.CreateDatabase();
        sqlCommand = "[dbo].gspTMSWatersupply_INSERT";
        dbCommand  = db.GetStoredProcCommand(sqlCommand, wsBillAmount, wsLateFees, wsMonth, wsYear, wsLastDate, wsBillPaidDate, wsTotalAmount, wsPaidStatus, wsBillNumber, wsExtra1, wsDate, wsStatus);

        if (transaction == null)
        {
            this.WsWsid = Convert.ToInt64(db.ExecuteScalar(dbCommand));
        }
        else
        {
            this.WsWsid = Convert.ToInt64(db.ExecuteScalar(dbCommand, transaction));
        }
        return;
    }
Exemple #28
0
    public void Insert(System.Double?elBillAmount, System.Double?elLateFees, System.String elMonth, System.String elYear, System.DateTime?elLastDate, System.DateTime?elBillPaidDate, System.Double?elTotalAmount, System.String elPaidStatus, System.String elbIllno, System.String elBillFile, System.String elExtra1, System.String elExtra2, System.DateTime?elDate, System.Int32?elStatus, DbTransaction transaction)
    {
        Database  db;
        string    sqlCommand;
        DbCommand dbCommand;


        db         = DatabaseFactory.CreateDatabase();
        sqlCommand = "[dbo].gspTMSElectricity_INSERT";
        dbCommand  = db.GetStoredProcCommand(sqlCommand, elBillAmount, elLateFees, elMonth, elYear, elLastDate, elBillPaidDate, elTotalAmount, elPaidStatus, elbIllno, elBillFile, elExtra1, elExtra2, elDate, elStatus);

        if (transaction == null)
        {
            this.ElEbillID = Convert.ToInt64(db.ExecuteScalar(dbCommand));
        }
        else
        {
            this.ElEbillID = Convert.ToInt64(db.ExecuteScalar(dbCommand, transaction));
        }
        return;
    }
    public void Insert(System.String presentacion, System.Double?peso, DbTransaction transaction)
    {
        Database  db;
        string    sqlCommand;
        DbCommand dbCommand;


        db         = DatabaseFactory.CreateDatabase();
        sqlCommand = "[dbo].gspPresentaciones_INSERT";
        dbCommand  = db.GetStoredProcCommand(sqlCommand, presentacion, peso);

        if (transaction == null)
        {
            this.PresentacionID = Convert.ToInt32(db.ExecuteScalar(dbCommand));
        }
        else
        {
            this.PresentacionID = Convert.ToInt32(db.ExecuteScalar(dbCommand, transaction));
        }
        return;
    }
Exemple #30
0
    public static void Update(System.Int64?elEbillID, System.Double?elBillAmount, System.Double?elLateFees, System.String elMonth, System.String elYear, System.DateTime?elLastDate, System.DateTime?elBillPaidDate, System.Double?elTotalAmount, System.String elPaidStatus, System.String elbIllno, System.String elBillFile, System.String elExtra1, System.String elExtra2, System.DateTime?elDate, System.Int32?elStatus, DbTransaction transaction)
    {
        DataSet   ds;
        Database  db;
        string    sqlCommand;
        DbCommand dbCommand;


        db         = DatabaseFactory.CreateDatabase();
        sqlCommand = "[dbo].gspTMSElectricity_UPDATE";
        dbCommand  = db.GetStoredProcCommand(sqlCommand);
        db.DiscoverParameters(dbCommand);
        dbCommand.Parameters["@elEbillID"].Value      = elEbillID;
        dbCommand.Parameters["@elBillAmount"].Value   = elBillAmount;
        dbCommand.Parameters["@elLateFees"].Value     = elLateFees;
        dbCommand.Parameters["@elMonth"].Value        = elMonth;
        dbCommand.Parameters["@elYear"].Value         = elYear;
        dbCommand.Parameters["@elLastDate"].Value     = elLastDate;
        dbCommand.Parameters["@elBillPaidDate"].Value = elBillPaidDate;
        dbCommand.Parameters["@elTotalAmount"].Value  = elTotalAmount;
        dbCommand.Parameters["@elPaidStatus"].Value   = elPaidStatus;
        dbCommand.Parameters["@elbIllno"].Value       = elbIllno;
        dbCommand.Parameters["@elBillFile"].Value     = elBillFile;
        dbCommand.Parameters["@elExtra1"].Value       = elExtra1;
        dbCommand.Parameters["@elExtra2"].Value       = elExtra2;
        dbCommand.Parameters["@elDate"].Value         = elDate;
        dbCommand.Parameters["@elStatus"].Value       = elStatus;

        if (transaction == null)
        {
            db.ExecuteNonQuery(dbCommand);
        }
        else
        {
            db.ExecuteNonQuery(dbCommand, transaction);
        }
        return;
    }
 protected void MapFrom(DataRow dr)
 {
     SFPDetailsId = dr["SFP_DetailsId"] != DBNull.Value ? Convert.ToInt64(dr["SFP_DetailsId"]) : SFPDetailsId = null;
     SFPStudentLoginId = dr["SFP_StudentLoginId"] != DBNull.Value ? Convert.ToInt64(dr["SFP_StudentLoginId"]) : SFPStudentLoginId = null;
     SFPStandardId = dr["SFP_StandardId"] != DBNull.Value ? Convert.ToInt64(dr["SFP_StandardId"]) : SFPStandardId = null;
     SFPDivisionId = dr["SFP_DivisionId"] != DBNull.Value ? Convert.ToInt64(dr["SFP_DivisionId"]) : SFPDivisionId = null;
     SFPTotalFees = dr["SFP_TotalFees"] != DBNull.Value ? Convert.ToDouble(dr["SFP_TotalFees"]) : SFPTotalFees = null;
     SFTPaidFees = dr["SFT_PaidFees"] != DBNull.Value ? Convert.ToDouble(dr["SFT_PaidFees"]) : SFTPaidFees = null;
     SFPRemainingFees = dr["SFP_RemainingFees"] != DBNull.Value ? Convert.ToDouble(dr["SFP_RemainingFees"]) : SFPRemainingFees = null;
     SFPMonth = dr["SFP_Month"] != DBNull.Value ? Convert.ToString(dr["SFP_Month"]) : SFPMonth = null;
     SFPYear = dr["SFP_Year"] != DBNull.Value ? Convert.ToString(dr["SFP_Year"]) : SFPYear = null;
     SFPTransactionDate = dr["SFP_TransactionDate"] != DBNull.Value ? Convert.ToDateTime(dr["SFP_TransactionDate"]) : SFPTransactionDate = null;
     SFPAddedById = dr["SFP_AddedById"] != DBNull.Value ? Convert.ToInt64(dr["SFP_AddedById"]) : SFPAddedById = null;
     SFPAddedByRemark = dr["SFP_AddedByRemark"] != DBNull.Value ? Convert.ToString(dr["SFP_AddedByRemark"]) : SFPAddedByRemark = null;
     SFPOtherRemark = dr["SFP_OtherRemark"] != DBNull.Value ? Convert.ToString(dr["SFP_OtherRemark"]) : SFPOtherRemark = null;
     SFPDate = dr["SFP_Date"] != DBNull.Value ? Convert.ToDateTime(dr["SFP_Date"]) : SFPDate = null;
     SFPStatus = dr["SFP_Status"] != DBNull.Value ? Convert.ToInt32(dr["SFP_Status"]) : SFPStatus = null;
 }
        public static object ConvertValue(object value, Field.FieldType toFieldType)
        {
            object convertedValue = null;
              try
              {
            switch (toFieldType)
            {
              case ESRI.ArcGIS.Client.Field.FieldType.Integer:
              case ESRI.ArcGIS.Client.Field.FieldType.OID:
            //typeof(System.Int32?);
            int intValue = Convert.ToInt32(value);
            convertedValue = new System.Int32?(intValue);
            break;
              case ESRI.ArcGIS.Client.Field.FieldType.SmallInteger:
            //typeof(System.Int16?);
            short shortValue = Convert.ToInt16(value);
            convertedValue = new System.Int16?(shortValue);
            break;
              case ESRI.ArcGIS.Client.Field.FieldType.Double:
            //typeof(System.Double?);
            double doubleValue = Convert.ToDouble(value);
            convertedValue = new System.Double?(doubleValue);
            break;
              case ESRI.ArcGIS.Client.Field.FieldType.Single:
            //typeof(System.Single?);
            float floatValue = Convert.ToSingle(value);
            convertedValue = new System.Single?(floatValue);
            break;
              case ESRI.ArcGIS.Client.Field.FieldType.String:
              case ESRI.ArcGIS.Client.Field.FieldType.GlobalID:
              case ESRI.ArcGIS.Client.Field.FieldType.GUID:
              case ESRI.ArcGIS.Client.Field.FieldType.XML:
            //typeof(System.String);
            string stringValue = Convert.ToString(value);
            convertedValue = stringValue;
            break;
              case ESRI.ArcGIS.Client.Field.FieldType.Date:
            //typeof(System.DateTime?);
            DateTime dateTimeValue = Convert.ToDateTime(value);
            convertedValue = new System.DateTime?(dateTimeValue);
            break;
              case ESRI.ArcGIS.Client.Field.FieldType.Geometry:
              case ESRI.ArcGIS.Client.Field.FieldType.Blob:
              case ESRI.ArcGIS.Client.Field.FieldType.Raster:
              case ESRI.ArcGIS.Client.Field.FieldType.Unknown:
            //typeof(System.Object);
            convertedValue = value;
            break;
              default:
            //typeof(System.Object);
            convertedValue = value;
            break;
            }
              }
              catch (Exception)
              {
            convertedValue = null;
              }

              return convertedValue;
        }