Example #1
0
        public static List <Dividend_Payment> GetPayments_FX(int fxInput_id)
        {
            List <Dividend_Payment> list = new List <Dividend_Payment>();

            DB_select    db_sel = new DB_select(Dividend_Payment.Get_cmdTP());
            SQL_relation rela   = new SQL_relation("FX_InputID", RelationalOperator.Equals, fxInput_id);

            db_sel.SetCondition(rela);

            DB_reader reader = new DB_reader(db_sel, Utility.Get_DRWIN_hDB());

            while (reader.Read())
            {
                Dividend_Payment dp = new Dividend_Payment();
                dp.Init_from_reader(reader);
                list.Add(dp);
            }
            reader.Close();

            return(list);
        }
Example #2
0
        /// <summary>
        /// Get a list of Dividend_Payment
        /// </summary>
        /// <param name="option">0 for unlocked and 1 for locked, other values for all records</param>
        public static List <Dividend_Payment> GetAll_payment_list(int option)
        {
            List <Dividend_Payment> list = new List <Dividend_Payment>();

            DB_select db_sel = new DB_select(Dividend_Payment.Get_cmdTP());

            if (option == 0 || option == 1)
            {
                SQL_relation rela = new SQL_relation("Paid_And_Locked", RelationalOperator.Equals, option);
                db_sel.SetCondition(rela);
            }

            DB_reader reader = new DB_reader(db_sel, Utility.Get_DRWIN_hDB());

            while (reader.Read())
            {
                Dividend_Payment dp = new Dividend_Payment();
                dp.Init_from_reader(reader);
                list.Add(dp);
            }
            reader.Close();

            return(list);
        }
Example #3
0
        public Dividend_Payment GetCopy()
        {
            Dividend_Payment newEntity = new Dividend_Payment();

            if (!this.DividendIndex.IsNull_flag)
            {
                newEntity.DividendIndex.Value = this.DividendIndex.Value;
            }
            if (!this.PaymentReferenceDate.IsNull_flag)
            {
                newEntity.PaymentReferenceDate.Value = this.PaymentReferenceDate.Value;
            }
            if (!this.Depositary.IsNull_flag)
            {
                newEntity.Depositary.Value = this.Depositary.Value;
            }
            if (!this.FXValueDate.IsNull_flag)
            {
                newEntity.FXValueDate.Value = this.FXValueDate.Value;
            }
            if (!this.DivFXRate.IsNull_flag)
            {
                newEntity.DivFXRate.Value = this.DivFXRate.Value;
            }
            if (!this.LastModifiedBy.IsNull_flag)
            {
                newEntity.LastModifiedBy.Value = this.LastModifiedBy.Value;
            }
            if (!this.ModifiedDateTime.IsNull_flag)
            {
                newEntity.ModifiedDateTime.Value = this.ModifiedDateTime.Value;
            }
            if (!this.Paid_And_Locked.IsNull_flag)
            {
                newEntity.Paid_And_Locked.Value = this.Paid_And_Locked.Value;
            }
            if (!this.Paid_And_Locked_Date.IsNull_flag)
            {
                newEntity.Paid_And_Locked_Date.Value = this.Paid_And_Locked_Date.Value;
            }
            if (!this.Billed_Date.IsNull_flag)
            {
                newEntity.Billed_Date.Value = this.Billed_Date.Value;
            }
            if (!this.Paid_Date_Actual.IsNull_flag)
            {
                newEntity.Paid_Date_Actual.Value = this.Paid_Date_Actual.Value;
            }
            if (!this.WriteOff.IsNull_flag)
            {
                newEntity.WriteOff.Value = this.WriteOff.Value;
            }
            if (!this.FX_InputID.IsNull_flag)
            {
                newEntity.FX_InputID.Value = this.FX_InputID.Value;
            }
            if (!this.CustodianID.IsNull_flag)
            {
                newEntity.CustodianID.Value = this.CustodianID.Value;
            }
            return(newEntity);
        }
Example #4
0
        internal HssUtility.SQLserver.DB_update Get_DBupdate()
        {
            if (!this.CheckValueChanges())
            {
                return(null);
            }

            this.LastModifiedBy.Value   = Utility.CurrentUser;
            this.ModifiedDateTime.Value = DateTime.Now;

            HssUtility.SQLserver.DB_update upd = new HssUtility.SQLserver.DB_update(Dividend_Payment.Get_cmdTP());
            if (this.DividendIndex.ValueChanged)
            {
                upd.AddValue("DividendIndex", this.DividendIndex);
            }
            if (this.PaymentReferenceDate.ValueChanged)
            {
                upd.AddValue("PaymentReferenceDate", this.PaymentReferenceDate);
            }
            if (this.Depositary.ValueChanged)
            {
                upd.AddValue("Depositary", this.Depositary);
            }
            if (this.FXValueDate.ValueChanged)
            {
                upd.AddValue("FXValueDate", this.FXValueDate);
            }
            if (this.DivFXRate.ValueChanged)
            {
                upd.AddValue("DivFXRate", this.DivFXRate);
            }
            if (this.LastModifiedBy.ValueChanged)
            {
                upd.AddValue("LastModifiedBy", this.LastModifiedBy);
            }
            if (this.ModifiedDateTime.ValueChanged)
            {
                upd.AddValue("ModifiedDateTime", this.ModifiedDateTime);
            }
            if (this.Paid_And_Locked.ValueChanged)
            {
                upd.AddValue("Paid_And_Locked", this.Paid_And_Locked);
            }
            if (this.Paid_And_Locked_Date.ValueChanged)
            {
                upd.AddValue("Paid_And_Locked_Date", this.Paid_And_Locked_Date);
            }
            if (this.Billed_Date.ValueChanged)
            {
                upd.AddValue("Billed_Date", this.Billed_Date);
            }
            if (this.Paid_Date_Actual.ValueChanged)
            {
                upd.AddValue("Paid_Date_Actual", this.Paid_Date_Actual);
            }
            if (this.WriteOff.ValueChanged)
            {
                upd.AddValue("WriteOff", this.WriteOff);
            }
            if (this.FX_InputID.ValueChanged)
            {
                upd.AddValue("FX_InputID", this.FX_InputID);
            }
            if (this.CustodianID.ValueChanged)
            {
                upd.AddValue("CustodianID", this.CustodianID);
            }

            HssUtility.SQLserver.SQL_relation rela = new HssUtility.SQLserver.SQL_relation("Dividend_PayID", HssUtility.General.RelationalOperator.Equals, this.pk_ID);
            upd.SetCondition(rela);

            return(upd);
        }
Example #5
0
        internal HssUtility.SQLserver.DB_insert Get_DBinsert()
        {
            HssUtility.SQLserver.DB_insert dbIns = new HssUtility.SQLserver.DB_insert(Dividend_Payment.Get_cmdTP());

            dbIns.AddValue("DividendIndex", this.DividendIndex.Value);
            dbIns.AddValue("PaymentReferenceDate", this.PaymentReferenceDate); /*Optional 3*/
            dbIns.AddValue("Depositary", this.Depositary);                     /*Optional 4*/
            dbIns.AddValue("FXValueDate", this.FXValueDate);                   /*Optional 5*/
            dbIns.AddValue("DivFXRate", this.DivFXRate);                       /*Optional 6*/
            dbIns.AddValue("LastModifiedBy", this.LastModifiedBy);             /*Optional 7*/
            dbIns.AddValue("ModifiedDateTime", this.ModifiedDateTime);         /*Optional 8*/
            dbIns.AddValue("Paid_And_Locked", this.Paid_And_Locked);           /*Optional 9*/
            dbIns.AddValue("Paid_And_Locked_Date", this.Paid_And_Locked_Date); /*Optional 10*/
            dbIns.AddValue("Billed_Date", this.Billed_Date);                   /*Optional 11*/
            dbIns.AddValue("Paid_Date_Actual", this.Paid_Date_Actual);         /*Optional 12*/
            dbIns.AddValue("WriteOff", this.WriteOff);                         /*Optional 13*/
            dbIns.AddValue("FX_InputID", this.FX_InputID);                     /*Optional 14*/
            dbIns.AddValue("CustodianID", this.CustodianID);                   /*Optional 15*/

            return(dbIns);
        }
Example #6
0
        /// <summary>
        /// Initialize object from DB
        /// </summary>
        public bool Init_from_DB()
        {
            if (this.Dividend_PayID < 0)
            {
                return(false);
            }

            HssUtility.SQLserver.DB_select db_sel = new HssUtility.SQLserver.DB_select(Dividend_Payment.Get_cmdTP());
            db_sel.tableName = "Dividend_Payment";
            HssUtility.SQLserver.SQL_relation rela = new HssUtility.SQLserver.SQL_relation("Dividend_PayID", HssUtility.General.RelationalOperator.Equals, this.Dividend_PayID);
            db_sel.SetCondition(rela);

            bool res_flag = false;

            HssUtility.SQLserver.DB_reader reader = new HssUtility.SQLserver.DB_reader(db_sel, Utility.Get_DRWIN_hDB());
            if (reader.Read())
            {
                this.Init_from_reader(reader);
                res_flag = true;
            }
            reader.Close();
            return(res_flag);
        }