Ejemplo 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(Country_ProcedureTypes.Get_cmdTP());
            if (this.IsSponsored.ValueChanged)
            {
                upd.AddValue("IsSponsored", this.IsSponsored);
            }
            if (this.At_Source.ValueChanged)
            {
                upd.AddValue("At_Source", this.At_Source);
            }
            if (this.Quick_Refund.ValueChanged)
            {
                upd.AddValue("Quick_Refund", this.Quick_Refund);
            }
            if (this.Long_Form.ValueChanged)
            {
                upd.AddValue("Long_Form", this.Long_Form);
            }

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

            return(upd);
        }
Ejemplo n.º 2
0
        public static void Init_from_DB()
        {
            if ((DateTime.Now - ProcedureTypeMaster.lastUpdateTime).TotalHours < Utility.RefreshInterval)
            {
                return;
            }

            ProcedureTypeMaster.Reset();
            DB_select selt   = new DB_select(Country_ProcedureTypes.Get_cmdTP());
            DB_reader reader = new DB_reader(selt, Utility.Get_DRWIN_hDB());

            while (reader.Read())
            {
                Country_ProcedureTypes cpt = new Country_ProcedureTypes();
                cpt.Init_from_reader(reader);

                if (!ProcedureTypeMaster.CPT_dic.ContainsKey(cpt.Country))
                {
                    List <Country_ProcedureTypes> list = new List <Country_ProcedureTypes>();
                    ProcedureTypeMaster.CPT_dic[cpt.Country] = list;
                }
                ProcedureTypeMaster.CPT_dic[cpt.Country].Add(cpt);
            }
            reader.Close();

            ProcedureTypeMaster.lastUpdateTime = DateTime.Now;
        }
Ejemplo n.º 3
0
        public Country_ProcedureTypes GetCopy()
        {
            Country_ProcedureTypes newEntity = new Country_ProcedureTypes();

            if (!this.IsSponsored.IsNull_flag)
            {
                newEntity.IsSponsored.Value = this.IsSponsored.Value;
            }
            if (!this.At_Source.IsNull_flag)
            {
                newEntity.At_Source.Value = this.At_Source.Value;
            }
            if (!this.Quick_Refund.IsNull_flag)
            {
                newEntity.Quick_Refund.Value = this.Quick_Refund.Value;
            }
            if (!this.Long_Form.IsNull_flag)
            {
                newEntity.Long_Form.Value = this.Long_Form.Value;
            }
            return(newEntity);
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Initialize object from DB
        /// </summary>
        public bool Init_from_DB()
        {
            if (string.IsNullOrEmpty(this.Country))
            {
                return(false);
            }

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

            dbIns.AddValue("IsSponsored", this.IsSponsored);/*Optional 2*/
            dbIns.AddValue("At_Source", this.At_Source.Value);
            dbIns.AddValue("Quick_Refund", this.Quick_Refund.Value);
            dbIns.AddValue("Long_Form", this.Long_Form.Value);

            return(dbIns);
        }