示例#1
0
        public bool Save_to_DB()
        {
            if (this.Paid_And_Locked.ValueChanged && this.Paid_And_Locked.Value)
            {
                this.Paid_And_Locked_Date.Value = DateTime.Now;
            }

            bool dataSaved_flag = false;

            if (this.pk_ID > 0)
            {
                dataSaved_flag = this.Update_to_DB();
            }
            else
            {
                dataSaved_flag = this.Insert_to_DB();
            }

            if (dataSaved_flag)
            {
                FX_Input fxi = FX_Input_master.Get_FXinput_ID(this.FX_InputID.Value);
                if (fxi != null && fxi.RecheckLocked())
                {
                    TaskDetailMaster.SetTaskCompleteness(20, fxi.FX_InputID.ToString(), "A", true);
                }
            }

            return(dataSaved_flag);
        }
示例#2
0
        public static void RecheckLocked_and_clearTask20A(int FX_InputID)
        {
            FX_Input fxi = FX_Input_master.Get_FXinput_ID(FX_InputID);

            if (fxi == null)
            {
                return;
            }
            if (fxi.RecheckLocked())
            {
                TaskDetailMaster.SetTaskCompleteness(20, fxi.FX_InputID.ToString(), "A", true);
            }
        }
示例#3
0
        public static void Init_from_DB()
        {
            if ((DateTime.Now - FX_Input_master.lastUpdateTime).TotalHours < Utility.RefreshInterval)
            {
                return;
            }

            FX_Input_master.Reset();
            DB_select selt   = new DB_select(FX_Input.Get_cmdTP());
            DB_reader reader = new DB_reader(selt, Utility.Get_DRWIN_hDB());

            while (reader.Read())
            {
                FX_Input fxi = new FX_Input();
                fxi.Init_from_reader(reader);
                FX_Input_master.fi_dic[fxi.FX_InputID] = fxi;
            }
            reader.Close();

            FX_Input_master.lastUpdateTime = DateTime.Now;
        }
示例#4
0
文件: FX_Input.cs 项目: huangss0/GTS0
        public FX_Input GetCopy()
        {
            FX_Input newEntity = new FX_Input();

            if (!this.CountryName.IsNull_flag)
            {
                newEntity.CountryName.Value = this.CountryName.Value;
            }
            if (!this.Custodian.IsNull_flag)
            {
                newEntity.Custodian.Value = this.Custodian.Value;
            }
            if (!this.AccountNumber.IsNull_flag)
            {
                newEntity.AccountNumber.Value = this.AccountNumber.Value;
            }
            if (!this.Currency_Code.IsNull_flag)
            {
                newEntity.Currency_Code.Value = this.Currency_Code.Value;
            }
            if (!this.FX_NotificationDate.IsNull_flag)
            {
                newEntity.FX_NotificationDate.Value = this.FX_NotificationDate.Value;
            }
            if (!this.LocalAmountReceived.IsNull_flag)
            {
                newEntity.LocalAmountReceived.Value = this.LocalAmountReceived.Value;
            }
            if (!this.Depositary_ReceivedDate.IsNull_flag)
            {
                newEntity.Depositary_ReceivedDate.Value = this.Depositary_ReceivedDate.Value;
            }
            if (!this.FX_RequestedDate.IsNull_flag)
            {
                newEntity.FX_RequestedDate.Value = this.FX_RequestedDate.Value;
            }
            if (!this.FX_ReceivedDate.IsNull_flag)
            {
                newEntity.FX_ReceivedDate.Value = this.FX_ReceivedDate.Value;
            }
            if (!this.Depositary.IsNull_flag)
            {
                newEntity.Depositary.Value = this.Depositary.Value;
            }
            if (!this.FX_Rate.IsNull_flag)
            {
                newEntity.FX_Rate.Value = this.FX_Rate.Value;
            }
            if (!this.USDAmountReceived.IsNull_flag)
            {
                newEntity.USDAmountReceived.Value = this.USDAmountReceived.Value;
            }
            if (!this.ActualCheckRequestDate.IsNull_flag)
            {
                newEntity.ActualCheckRequestDate.Value = this.ActualCheckRequestDate.Value;
            }
            if (!this.PayToBrokerDate.IsNull_flag)
            {
                newEntity.PayToBrokerDate.Value = this.PayToBrokerDate.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.Forex_Fee.IsNull_flag)
            {
                newEntity.Forex_Fee.Value = this.Forex_Fee.Value;
            }
            return(newEntity);
        }
示例#5
0
文件: FX_Input.cs 项目: huangss0/GTS0
        internal HssUtility.SQLserver.DB_update Get_DBupdate()
        {
            if (!this.CheckValueChanges())
            {
                return(null);
            }

            HssUtility.SQLserver.DB_update upd = new HssUtility.SQLserver.DB_update(FX_Input.Get_cmdTP());
            if (this.CountryName.ValueChanged)
            {
                upd.AddValue("CountryName", this.CountryName);
            }
            if (this.Custodian.ValueChanged)
            {
                upd.AddValue("Custodian", this.Custodian);
            }
            if (this.AccountNumber.ValueChanged)
            {
                upd.AddValue("AccountNumber", this.AccountNumber);
            }
            if (this.Currency_Code.ValueChanged)
            {
                upd.AddValue("Currency_Code", this.Currency_Code);
            }
            if (this.FX_NotificationDate.ValueChanged)
            {
                upd.AddValue("FX_NotificationDate", this.FX_NotificationDate);
            }
            if (this.LocalAmountReceived.ValueChanged)
            {
                upd.AddValue("LocalAmountReceived", this.LocalAmountReceived);
            }
            if (this.Depositary_ReceivedDate.ValueChanged)
            {
                upd.AddValue("Depositary_ReceivedDate", this.Depositary_ReceivedDate);
            }
            if (this.FX_RequestedDate.ValueChanged)
            {
                upd.AddValue("FX_RequestedDate", this.FX_RequestedDate);
            }
            if (this.FX_ReceivedDate.ValueChanged)
            {
                upd.AddValue("FX_ReceivedDate", this.FX_ReceivedDate);
            }
            if (this.Depositary.ValueChanged)
            {
                upd.AddValue("Depositary", this.Depositary);
            }
            if (this.FX_Rate.ValueChanged)
            {
                upd.AddValue("FX_Rate", this.FX_Rate);
            }
            if (this.USDAmountReceived.ValueChanged)
            {
                upd.AddValue("USDAmountReceived", this.USDAmountReceived);
            }
            if (this.ActualCheckRequestDate.ValueChanged)
            {
                upd.AddValue("ActualCheckRequestDate", this.ActualCheckRequestDate);
            }
            if (this.PayToBrokerDate.ValueChanged)
            {
                upd.AddValue("PayToBrokerDate", this.PayToBrokerDate);
            }
            if (this.LastModifiedBy.ValueChanged)
            {
                upd.AddValue("LastModifiedBy", this.LastModifiedBy);
            }
            if (this.ModifiedDateTime.ValueChanged)
            {
                upd.AddValue("ModifiedDateTime", this.ModifiedDateTime);
            }
            if (this.Forex_Fee.ValueChanged)
            {
                upd.AddValue("Forex_Fee", this.Forex_Fee);
            }

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

            return(upd);
        }
示例#6
0
文件: FX_Input.cs 项目: huangss0/GTS0
        internal HssUtility.SQLserver.DB_insert Get_DBinsert()
        {
            HssUtility.SQLserver.DB_insert dbIns = new HssUtility.SQLserver.DB_insert(FX_Input.Get_cmdTP());

            dbIns.AddValue("CountryName", this.CountryName);                         /*Optional 2*/
            dbIns.AddValue("Custodian", this.Custodian);                             /*Optional 3*/
            dbIns.AddValue("AccountNumber", this.AccountNumber);                     /*Optional 4*/
            dbIns.AddValue("Currency_Code", this.Currency_Code);                     /*Optional 5*/
            dbIns.AddValue("FX_NotificationDate", this.FX_NotificationDate);         /*Optional 6*/
            dbIns.AddValue("LocalAmountReceived", this.LocalAmountReceived);         /*Optional 7*/
            dbIns.AddValue("Depositary_ReceivedDate", this.Depositary_ReceivedDate); /*Optional 8*/
            dbIns.AddValue("FX_RequestedDate", this.FX_RequestedDate);               /*Optional 9*/
            dbIns.AddValue("FX_ReceivedDate", this.FX_ReceivedDate);                 /*Optional 10*/
            dbIns.AddValue("Depositary", this.Depositary);                           /*Optional 11*/
            dbIns.AddValue("FX_Rate", this.FX_Rate);                                 /*Optional 12*/
            dbIns.AddValue("USDAmountReceived", this.USDAmountReceived);             /*Optional 13*/
            dbIns.AddValue("ActualCheckRequestDate", this.ActualCheckRequestDate);   /*Optional 14*/
            dbIns.AddValue("PayToBrokerDate", this.PayToBrokerDate);                 /*Optional 15*/
            dbIns.AddValue("LastModifiedBy", this.LastModifiedBy);                   /*Optional 16*/
            dbIns.AddValue("ModifiedDateTime", this.ModifiedDateTime);               /*Optional 17*/
            dbIns.AddValue("Forex_Fee", this.Forex_Fee);                             /*Optional 18*/

            return(dbIns);
        }
示例#7
0
文件: FX_Input.cs 项目: huangss0/GTS0
        /// <summary>
        /// Initialize object from DB
        /// </summary>
        public bool Init_from_DB()
        {
            if (this.FX_InputID < 0)
            {
                return(false);
            }

            HssUtility.SQLserver.DB_select db_sel = new HssUtility.SQLserver.DB_select(FX_Input.Get_cmdTP());
            db_sel.tableName = "FX_Input";
            HssUtility.SQLserver.SQL_relation rela = new HssUtility.SQLserver.SQL_relation("FX_InputID", HssUtility.General.RelationalOperator.Equals, this.FX_InputID);
            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);
        }