Exemplo n.º 1
0
        internal HssUtility.SQLserver.DB_update Get_DBupdate()
        {
            if (!this.CheckValueChanges())
            {
                return(null);
            }

            HssUtility.SQLserver.DB_update upd = new HssUtility.SQLserver.DB_update(Dividend_Control_Queue.Get_cmdTP());
            if (this.DividendIndex.ValueChanged)
            {
                upd.AddValue("DividendIndex", this.DividendIndex);
            }
            if (this.TabName.ValueChanged)
            {
                upd.AddValue("TabName", this.TabName);
            }
            if (this.FieldName.ValueChanged)
            {
                upd.AddValue("FieldName", this.FieldName);
            }
            if (this.ColumnName.ValueChanged)
            {
                upd.AddValue("ColumnName", this.ColumnName);
            }
            if (this.PreviousValue.ValueChanged)
            {
                upd.AddValue("PreviousValue", this.PreviousValue);                                 /*Optional 6*/
            }
            if (this.NewValue.ValueChanged)
            {
                upd.AddValue("NewValue", this.NewValue);                            /*Optional 7*/
            }
            if (this.DataType.ValueChanged)
            {
                upd.AddValue("DataType", this.DataType);
            }
            if (this.UserID.ValueChanged)
            {
                upd.AddValue("UserID", this.UserID);
            }
            if (this.QueueDateTime.ValueChanged)
            {
                upd.AddValue("QueueDateTime", this.QueueDateTime);
            }
            if (this.Status.ValueChanged)
            {
                upd.AddValue("Status", this.Status);
            }
            if (this.ApprovedBy.ValueChanged)
            {
                upd.AddValue("ApprovedBy", this.ApprovedBy);
            }
            if (this.Event.ValueChanged)
            {
                upd.AddValue("Event", this.Event);                         /*Optional 13*/
            }
            if (this.Active.ValueChanged)
            {
                upd.AddValue("Active", this.Active);                          /*Optional 14*/
            }
            HssUtility.SQLserver.SQL_relation rela = new HssUtility.SQLserver.SQL_relation("Queue_ID", HssUtility.General.RelationalOperator.Equals, this.pk_ID);
            upd.SetCondition(rela);

            return(upd);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initialize object from DB
        /// </summary>
        public bool Init_from_DB()
        {
            if (this.Queue_ID < 0)
            {
                return(false);
            }

            HssUtility.SQLserver.DB_select db_sel = new HssUtility.SQLserver.DB_select(Dividend_Control_Queue.Get_cmdTP());
            db_sel.tableName = "Dividend_Control_Queue";
            HssUtility.SQLserver.SQL_relation rela = new HssUtility.SQLserver.SQL_relation("Queue_ID", HssUtility.General.RelationalOperator.Equals, this.Queue_ID);
            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);
        }
Exemplo n.º 3
0
        internal HssUtility.SQLserver.DB_insert Get_DBinsert()
        {
            HssUtility.SQLserver.DB_insert dbIns = new HssUtility.SQLserver.DB_insert(Dividend_Control_Queue.Get_cmdTP());

            dbIns.AddValue("DividendIndex", this.DividendIndex);
            dbIns.AddValue("TabName", this.TabName);
            dbIns.AddValue("FieldName", this.FieldName);
            dbIns.AddValue("ColumnName", this.ColumnName);
            dbIns.AddValue("PreviousValue", this.PreviousValue); /*Optional 6*/
            dbIns.AddValue("NewValue", this.NewValue);           /*Optional 7*/
            dbIns.AddValue("DataType", this.DataType);
            dbIns.AddValue("UserID", this.UserID);
            dbIns.AddValue("QueueDateTime", this.QueueDateTime);
            dbIns.AddValue("Status", this.Status);
            dbIns.AddValue("ApprovedBy", this.ApprovedBy);
            dbIns.AddValue("Event", this.Event);   /*Optional 13*/
            dbIns.AddValue("Active", this.Active); /*Optional 14*/

            return(dbIns);
        }