Example #1
0
        /// <summary>
        /// This method allows you to reset the parameter object. Please note that this
        /// method resets all the parameters members except the connection information and
        /// the command time-out which are left in their current state.
        /// </summary>
        public void Reset()
        {
            this.internal_Param_RETURN_VALUE = System.Data.SqlTypes.SqlInt32.Null;

            this.internal_Param_JobId = System.Data.SqlTypes.SqlInt32.Null;
            this.internal_Param_JobId_UseDefaultValue = this.useDefaultValue;

            this.internal_Param_Description = System.Data.SqlTypes.SqlString.Null;
            this.internal_Param_Description_UseDefaultValue = this.useDefaultValue;

            this.internal_Param_Price = System.Data.SqlTypes.SqlMoney.Null;
            this.internal_Param_Price_UseDefaultValue = this.useDefaultValue;

            this.internal_Param_StartDate = System.Data.SqlTypes.SqlDateTime.Null;
            this.internal_Param_StartDate_UseDefaultValue = this.useDefaultValue;

            this.internal_Param_EndDate = System.Data.SqlTypes.SqlDateTime.Null;
            this.internal_Param_EndDate_UseDefaultValue = this.useDefaultValue;

            this.internal_Param_CustomerId = System.Data.SqlTypes.SqlInt32.Null;
            this.internal_Param_CustomerId_UseDefaultValue = this.useDefaultValue;

            this.errorSource    = ErrorSource.NotAvailable;
            this.sqlException   = null;
            this.otherException = null;
        }
Example #2
0
        private void Credit_MakedPayment(AClient arg1, Credit arg2, System.Data.SqlTypes.SqlMoney arg3)
        {
            var creditInfo = $"Сумма: {arg2.Amount} \nСрок: {arg2.Month} \nПроцент: {arg2.Percent}";
            var pattern    = $"Клиент {arg1} сделал взнос по кредиту\nна сумму {arg3}. Credit: \n{creditInfo}";

            transactionListBox.Items.Add(pattern);
        }
 /// <summary>
 /// This method allows to clear all the properties previously loaded by a call to the Refresh method.
 /// </summary>
 public void Reset()
 {
     this.col_Ord_GuidID        = System.Data.SqlTypes.SqlGuid.Null;
     this.col_Ord_DatOrderedOn  = System.Data.SqlTypes.SqlDateTime.Null;
     this.col_Ord_LngCustomerID = System.Data.SqlTypes.SqlInt32.Null;
     this.col_Ord_CurTotal      = System.Data.SqlTypes.SqlMoney.Null;
 }
Example #4
0
        private bool CheckValues()
        {
            bool status = true;

            try {
                System.Data.SqlTypes.SqlDateTime value = new System.Data.SqlTypes.SqlDateTime(System.Convert.ToDateTime(txt_Ord_DatOrderedOn.Text));
            }

            catch {
                labError_Ord_DatOrderedOn.Text    = "INVALID";
                labError_Ord_DatOrderedOn.Visible = true;
                status = false;
            }

            try {
                System.Data.SqlTypes.SqlMoney value = new System.Data.SqlTypes.SqlMoney(System.Convert.ToDecimal(txt_Ord_CurTotal.Text));
            }

            catch {
                labError_Ord_CurTotal.Text    = "INVALID";
                labError_Ord_CurTotal.Visible = true;
                status = false;
            }

            return(status);
        }
 /// <summary>
 /// This method allows to clear all the properties previously loaded by a call to the Refresh method.
 /// </summary>
 public void Reset()
 {
     this.col_Pro_GuidID        = System.Data.SqlTypes.SqlGuid.Null;
     this.col_Pro_StrName       = System.Data.SqlTypes.SqlString.Null;
     this.col_Pro_CurPrice      = System.Data.SqlTypes.SqlMoney.Null;
     this.col_Pro_LngCategoryID = System.Data.SqlTypes.SqlInt32.Null;
 }
Example #6
0
 /// <summary>
 /// This method allows to clear all the properties previously loaded by a call to the Refresh method.
 /// </summary>
 public void Reset()
 {
     this.col_JobId       = System.Data.SqlTypes.SqlInt32.Null;
     this.col_Description = System.Data.SqlTypes.SqlString.Null;
     this.col_Price       = System.Data.SqlTypes.SqlMoney.Null;
     this.col_StartDate   = System.Data.SqlTypes.SqlDateTime.Null;
     this.col_EndDate     = System.Data.SqlTypes.SqlDateTime.Null;
     this.col_CustomerId  = System.Data.SqlTypes.SqlInt32.Null;
 }
 /// <summary>
 /// This method allows to clear all the properties previously loaded by a call to the Refresh method.
 /// </summary>
 public void Reset()
 {
     this.col_JobPartId     = System.Data.SqlTypes.SqlInt32.Null;
     this.col_JobId         = System.Data.SqlTypes.SqlInt32.Null;
     this.col_Description   = System.Data.SqlTypes.SqlString.Null;
     this.col_JobPartTypeId = System.Data.SqlTypes.SqlInt32.Null;
     this.col_Units         = System.Data.SqlTypes.SqlDecimal.Null;
     this.col_PricePerUnit  = System.Data.SqlTypes.SqlMoney.Null;
     this.col_TotalPrice    = System.Data.SqlTypes.SqlMoney.Null;
 }
Example #8
0
        private bool CheckValues()
        {
            bool status = true;

            try {
                System.Data.SqlTypes.SqlMoney value = new System.Data.SqlTypes.SqlMoney(System.Convert.ToDecimal(txt_Pro_CurPrice.Text));
            }

            catch {
                labError_Pro_CurPrice.Text    = "INVALID";
                labError_Pro_CurPrice.Visible = true;
                status = false;
            }

            return(status);
        }
Example #9
0
        /// <summary>
        /// This method allows you to reset the parameter object. Please note that this
        /// method resets all the parameters members except the connection information and
        /// the command time-out which are left in their current state.
        /// </summary>
        public void Reset()
        {
            this.internal_Param_RETURN_VALUE = System.Data.SqlTypes.SqlInt32.Null;

            this.internal_Param_JobPartTypeId = System.Data.SqlTypes.SqlInt32.Null;
            this.internal_Param_JobPartTypeId_UseDefaultValue = this.useDefaultValue;

            this.internal_Param_Description = System.Data.SqlTypes.SqlString.Null;
            this.internal_Param_Description_UseDefaultValue = this.useDefaultValue;

            this.internal_Param_GeneralUnitCost = System.Data.SqlTypes.SqlMoney.Null;
            this.internal_Param_GeneralUnitCost_UseDefaultValue = this.useDefaultValue;

            this.errorSource    = ErrorSource.NotAvailable;
            this.sqlException   = null;
            this.otherException = null;
        }
Example #10
0
        /// <summary>
        /// This method allows you to reset the parameter object. Please note that this
        /// method resets all the parameters members except the connection information and
        /// the command time-out which are left in their current state.
        /// </summary>
        public void Reset()
        {
            this.internal_Param_RETURN_VALUE = System.Data.SqlTypes.SqlInt32.Null;

            this.internal_Param_Pro_GuidID = System.Data.SqlTypes.SqlGuid.Null;
            this.internal_Param_Pro_GuidID_UseDefaultValue = this.useDefaultValue;

            this.internal_Param_Pro_StrName = System.Data.SqlTypes.SqlString.Null;
            this.internal_Param_Pro_StrName_UseDefaultValue = this.useDefaultValue;

            this.internal_Param_Pro_CurPrice = System.Data.SqlTypes.SqlMoney.Null;
            this.internal_Param_Pro_CurPrice_UseDefaultValue = this.useDefaultValue;

            this.internal_Param_Pro_LngCategoryID = System.Data.SqlTypes.SqlInt32.Null;
            this.internal_Param_Pro_LngCategoryID_UseDefaultValue = this.useDefaultValue;

            this.errorSource    = ErrorSource.NotAvailable;
            this.sqlException   = null;
            this.otherException = null;
        }
Example #11
0
        /// <summary>
        /// This method allows you to reset the parameter object. Please note that this
        /// method resets all the parameters members except the connection information and
        /// the command time-out which are left in their current state.
        /// </summary>
        public void Reset()
        {
            this.internal_Param_RETURN_VALUE = System.Data.SqlTypes.SqlInt32.Null;

            this.internal_Param_Ord_GuidID = System.Data.SqlTypes.SqlGuid.Null;
            this.internal_Param_Ord_GuidID_UseDefaultValue = this.useDefaultValue;

            this.internal_Param_Ord_DatOrderedOn = System.Data.SqlTypes.SqlDateTime.Null;
            this.internal_Param_Ord_DatOrderedOn_UseDefaultValue = this.useDefaultValue;

            this.internal_Param_Ord_LngCustomerID = System.Data.SqlTypes.SqlInt32.Null;
            this.internal_Param_Ord_LngCustomerID_UseDefaultValue = this.useDefaultValue;

            this.internal_Param_Ord_CurTotal = System.Data.SqlTypes.SqlMoney.Null;
            this.internal_Param_Ord_CurTotal_UseDefaultValue = this.useDefaultValue;

            this.errorSource    = ErrorSource.NotAvailable;
            this.sqlException   = null;
            this.otherException = null;
        }
Example #12
0
        public static decimal ToDecimal(object obj)
        {
            if (obj == null)
            {
                return(0);
            }

            if (obj is System.Data.SqlTypes.SqlDecimal)
            {
                System.Data.SqlTypes.SqlDecimal o = (System.Data.SqlTypes.SqlDecimal)obj;
                if (o.IsNull)
                {
                    return(0);
                }
                else
                {
                    return(o.Value);
                }
            }
            else if (obj is System.Data.SqlTypes.SqlMoney)
            {
                System.Data.SqlTypes.SqlMoney o = (System.Data.SqlTypes.SqlMoney)obj;
                if (o.IsNull)
                {
                    return(0);
                }
                else
                {
                    return(o.Value);
                }
            }
            else if (obj == DBNull.Value)
            {
                return(0);
            }
            return(System.Convert.ToDecimal(obj));
        }
Example #13
0
 /// <summary>
 /// Allows you to pre-select a value for the 'GeneralUnitCost' column.
 /// </summary>
 public void SetValue_GeneralUnitCost(System.Data.SqlTypes.SqlMoney value)
 {
     this.hasBeenPopulated_GeneralUnitCost = true;
     this.internal_GeneralUnitCost         = value;
 }
        /// <summary>
        /// Allows you to load a specific record of the [JobPart] table.
        /// </summary>
        /// <param name="col_JobPartId">Update this description in the &quot;Olymars/Description&quot; extended property of the &quot;JobPartId&quot; column.</param>
        public bool Refresh(System.Data.SqlTypes.SqlInt32 col_JobPartId)
        {
            bool Status;

            Reset();

            if (col_JobPartId.IsNull)
            {
                throw new ArgumentNullException("col_JobPartId", "The primary key 'col_JobPartId' can not have a Null value!");
            }


            this.col_JobPartId = col_JobPartId;

            this.Param.Reset();

            this.Param.Param_JobPartId = this.col_JobPartId;

            System.Data.SqlClient.SqlDataReader DR;
            SPs.spS_JobPart SP = new SPs.spS_JobPart(false);

            if (SP.Execute(ref this.Param, out DR))
            {
                Status = false;
                if (DR.Read())
                {
                    if (!DR.IsDBNull(SPs.spS_JobPart.Resultset1.Fields.Column_JobId.ColumnIndex))
                    {
                        this.col_JobId = DR.GetSqlInt32(SPs.spS_JobPart.Resultset1.Fields.Column_JobId.ColumnIndex);
                    }

                    if (!DR.IsDBNull(SPs.spS_JobPart.Resultset1.Fields.Column_Description.ColumnIndex))
                    {
                        this.col_Description = DR.GetSqlString(SPs.spS_JobPart.Resultset1.Fields.Column_Description.ColumnIndex);
                    }

                    if (!DR.IsDBNull(SPs.spS_JobPart.Resultset1.Fields.Column_JobPartTypeId.ColumnIndex))
                    {
                        this.col_JobPartTypeId = DR.GetSqlInt32(SPs.spS_JobPart.Resultset1.Fields.Column_JobPartTypeId.ColumnIndex);
                    }

                    if (!DR.IsDBNull(SPs.spS_JobPart.Resultset1.Fields.Column_Units.ColumnIndex))
                    {
                        this.col_Units = DR.GetSqlDecimal(SPs.spS_JobPart.Resultset1.Fields.Column_Units.ColumnIndex);
                    }

                    if (!DR.IsDBNull(SPs.spS_JobPart.Resultset1.Fields.Column_PricePerUnit.ColumnIndex))
                    {
                        this.col_PricePerUnit = DR.GetSqlMoney(SPs.spS_JobPart.Resultset1.Fields.Column_PricePerUnit.ColumnIndex);
                    }

                    if (!DR.IsDBNull(SPs.spS_JobPart.Resultset1.Fields.Column_TotalPrice.ColumnIndex))
                    {
                        this.col_TotalPrice = DR.GetSqlMoney(SPs.spS_JobPart.Resultset1.Fields.Column_TotalPrice.ColumnIndex);
                    }

                    Status = true;
                }

                if (DR != null && !DR.IsClosed)
                {
                    DR.Close();
                }

                if (CloseConnectionAfterUse && SP.Connection != null && SP.Connection.State == System.Data.ConnectionState.Open)
                {
                    SP.Connection.Close();
                    SP.Connection.Dispose();
                }

                return(Status);
            }

            else
            {
                if (DR != null && !DR.IsClosed)
                {
                    DR.Close();
                }

                if (CloseConnectionAfterUse && SP.Connection != null && SP.Connection.State == System.Data.ConnectionState.Open)
                {
                    SP.Connection.Close();
                    SP.Connection.Dispose();
                }

                throw new Bob.DataClasses.CustomException(this.Param, "Bob.AbstractClasses.Abstract_JobPart", "Refresh");
            }
        }
Example #15
0
        private void AClient_MoneySent(AClient arg1, AClient arg2, System.Data.SqlTypes.SqlMoney arg3)
        {
            var pattern = $"Клиент {arg1} отправил\n{arg3} руб.\nклиенту {arg2}";

            transactionListBox.Items.Add(pattern);
        }
Example #16
0
        private void AClient_MoneyReceived(AClient arg1, AClient arg2, System.Data.SqlTypes.SqlMoney arg3)
        {
            var pattern = $"Клиент {arg1} \nполучил {arg3} руб. \nот клиента {arg2}";

            transactionListBox.Items.Add(pattern);
        }
Example #17
0
        private void Deposit_MakedPayment(AClient arg1, Deposit arg2, System.Data.SqlTypes.SqlMoney arg3)
        {
            var pattern = $"Клиент {arg1} закрыл депозит.\nСумма: {arg2.Amount}\nПроцент: {arg2.Percent}";

            transactionListBox.Items.Add(pattern);
        }
Example #18
0
 /// <summary>
 /// Allows you to reset the pre-selected value for the 'GeneralUnitCost' column.
 /// </summary>
 public void ResetValue_GeneralUnitCost()
 {
     this.hasBeenPopulated_GeneralUnitCost = false;
     this.internal_GeneralUnitCost         = System.Data.SqlTypes.SqlMoney.Null;
 }
Example #19
0
 /// <summary>
 /// Allows you to reset the pre-selected value for the 'Pro_CurPrice' column.
 /// </summary>
 public void ResetValue_Pro_CurPrice()
 {
     this.hasBeenPopulated_Pro_CurPrice = false;
     this.internal_Pro_CurPrice         = System.Data.SqlTypes.SqlMoney.Null;
 }
 /// <summary>
 /// This method allows to clear all the properties previously loaded by a call to the Refresh method.
 /// </summary>
 public void Reset()
 {
     this.col_JobPartTypeId   = System.Data.SqlTypes.SqlInt32.Null;
     this.col_Description     = System.Data.SqlTypes.SqlString.Null;
     this.col_GeneralUnitCost = System.Data.SqlTypes.SqlMoney.Null;
 }
Example #21
0
 /// <summary>
 /// Allows you to pre-select a value for the 'Pro_CurPrice' column.
 /// </summary>
 public void SetValue_Pro_CurPrice(System.Data.SqlTypes.SqlMoney value)
 {
     this.hasBeenPopulated_Pro_CurPrice = true;
     this.internal_Pro_CurPrice         = value;
 }
        /// <summary>
        /// Allows you to load a specific record of the [tblOrder] table.
        /// </summary>
        /// <param name="col_Ord_GuidID">Update this description in the &quot;Olymars/Description&quot; extended property of the &quot;Ord_GuidID&quot; column.</param>
        public bool Refresh(System.Data.SqlTypes.SqlGuid col_Ord_GuidID)
        {
            bool Status;

            Reset();

            if (col_Ord_GuidID.IsNull)
            {
                throw new ArgumentNullException("col_Ord_GuidID", "The primary key 'col_Ord_GuidID' can not have a Null value!");
            }


            this.col_Ord_GuidID = col_Ord_GuidID;

            this.Param.Reset();

            this.Param.Param_Ord_GuidID = this.col_Ord_GuidID;

            System.Data.SqlClient.SqlDataReader DR;
            SPs.spS_tblOrder SP = new SPs.spS_tblOrder(false);

            if (SP.Execute(ref this.Param, out DR))
            {
                Status = false;
                if (DR.Read())
                {
                    if (!DR.IsDBNull(SPs.spS_tblOrder.Resultset1.Fields.Column_Ord_DatOrderedOn.ColumnIndex))
                    {
                        this.col_Ord_DatOrderedOn = DR.GetSqlDateTime(SPs.spS_tblOrder.Resultset1.Fields.Column_Ord_DatOrderedOn.ColumnIndex);
                    }

                    if (!DR.IsDBNull(SPs.spS_tblOrder.Resultset1.Fields.Column_Ord_LngCustomerID.ColumnIndex))
                    {
                        this.col_Ord_LngCustomerID = DR.GetSqlInt32(SPs.spS_tblOrder.Resultset1.Fields.Column_Ord_LngCustomerID.ColumnIndex);
                    }

                    if (!DR.IsDBNull(SPs.spS_tblOrder.Resultset1.Fields.Column_Ord_CurTotal.ColumnIndex))
                    {
                        this.col_Ord_CurTotal = DR.GetSqlMoney(SPs.spS_tblOrder.Resultset1.Fields.Column_Ord_CurTotal.ColumnIndex);
                    }

                    Status = true;
                }

                if (DR != null && !DR.IsClosed)
                {
                    DR.Close();
                }

                if (CloseConnectionAfterUse && SP.Connection != null && SP.Connection.State == System.Data.ConnectionState.Open)
                {
                    SP.Connection.Close();
                    SP.Connection.Dispose();
                }

                return(Status);
            }

            else
            {
                if (DR != null && !DR.IsClosed)
                {
                    DR.Close();
                }

                if (CloseConnectionAfterUse && SP.Connection != null && SP.Connection.State == System.Data.ConnectionState.Open)
                {
                    SP.Connection.Close();
                    SP.Connection.Dispose();
                }

                throw new OlymarsDemo.DataClasses.CustomException(this.Param, "OlymarsDemo.AbstractClasses.Abstract_tblOrder", "Refresh");
            }
        }
Example #23
0
 public void EnumTest()
 {
     Debug.Assert((eMode.DocumentMixed | eMode.MultiScanDocumentMixed) == eMode.MultiScanDocumentMixed);
     System.Data.SqlTypes.SqlMoney m = new System.Data.SqlTypes.SqlMoney(1);
 }
Example #24
0
 /// <summary>
 /// Allows you to pre-select a value for the 'Ord_CurTotal' column.
 /// </summary>
 public void SetValue_Ord_CurTotal(System.Data.SqlTypes.SqlMoney value)
 {
     this.hasBeenPopulated_Ord_CurTotal = true;
     this.internal_Ord_CurTotal         = value;
 }
Example #25
0
 /// <summary>
 /// Allows you to reset the pre-selected value for the 'Ord_CurTotal' column.
 /// </summary>
 public void ResetValue_Ord_CurTotal()
 {
     this.hasBeenPopulated_Ord_CurTotal = false;
     this.internal_Ord_CurTotal         = System.Data.SqlTypes.SqlMoney.Null;
 }