示例#1
0
        /*^^^^^^^^^^^^^^^^^^^^^^^^^^^^^Hss Entity Framework Auto Generated Code^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^*/

        public string Get_custodian_fullName()
        {
            Custodian cust = CustodianMaster.GetCustodian_num(this.Custodian_Number.Value);

            if (cust == null)
            {
                return(this.Custodian.Value);
            }
            else
            {
                return(cust.Custodian_FullName.Value);
            }
        }
示例#2
0
        public static Custodian GetCustodian_num(int num)
        {
            CustodianMaster.Init_from_DB();

            if (CustodianMaster.num_dic.ContainsKey(num))
            {
                return(CustodianMaster.num_dic[num]);
            }
            else
            {
                return(null);
            }
        }
示例#3
0
        public static Custodian GetCustodian_name(string name)
        {
            CustodianMaster.Init_from_DB();
            if (name == null)
            {
                return(null);
            }

            if (CustodianMaster.full_dic.ContainsKey(name))
            {
                return(CustodianMaster.full_dic[name]);
            }
            else if (CustodianMaster.short_dic.ContainsKey(name))
            {
                return(CustodianMaster.short_dic[name]);
            }
            else
            {
                return(null);//more work needed to check alies
            }
        }
示例#4
0
        public static void Init_from_DB()
        {
            if ((DateTime.Now - CustodianMaster.lastUpdateTime).TotalHours < Utility.RefreshInterval)
            {
                return;
            }

            CustodianMaster.Reset();
            DB_select selt   = new DB_select(Custodian.Get_cmdTP());
            DB_reader reader = new DB_reader(selt, Utility.Get_DRWIN_hDB());

            while (reader.Read())
            {
                Custodian cust = new Custodian();
                cust.Init_from_reader(reader);

                CustodianMaster.num_dic[cust.Custodian_Number]            = cust;
                CustodianMaster.full_dic[cust.Custodian_FullName.Value]   = cust;
                CustodianMaster.short_dic[cust.Custodian_ShortName.Value] = cust;
            }
            reader.Close();

            CustodianMaster.lastUpdateTime = DateTime.Now;
        }