Esempio n. 1
0
        private string LoadPaperNumberFromVIPData(Guid addressTypeId)
        {
            string result = string.Empty;

            using (var ctx = new EF6.RT2020Entities())
            {
                //string key = "Address_Phone_Pager_" + addressTypeId.ToString("N");
                //string sql = "MemberId = '" + this.MemberId.ToString() + "'";

                var oVip = ctx.MemberVipData.Where(x => x.MemberId == this.MemberId).FirstOrDefault();

                if (oVip != null)
                {
                    result = MemberVipDataEx.GetAttribute(oVip.MetadataXml, "Address", "Phone", "Pager", addressTypeId.ToString("N"));
                }
            }

            return(result);
        }
Esempio n. 2
0
        private void LoadPhoneBook()
        {
            StringBuilder sql = new StringBuilder();

            sql.Append("SELECT VipNumber, ISNULL(PhoneBook, '') AS PhoneBook, AddressTypeCode, Phone_W, Phone_H, Fax, Phone_Other, Phone_P ");
            sql.Append(" FROM vwPhonebookList ");
            sql.Append(" WHERE ");
            sql.Append(" MemberId = '").Append(this.MemberId.ToString()).Append("'");
            sql.Append(" AND ");
            sql.Append(" AddressTypeId = '").Append(this.AddressTypeId.ToString()).Append("'");

            SqlCommand cmd = new SqlCommand();

            cmd.CommandText    = sql.ToString();
            cmd.CommandTimeout = ConfigHelper.CommandTimeout;
            cmd.CommandType    = CommandType.Text;

            using (var ctx = new EF6.RT2020Entities())
            {
                //var item = ctx.
            }
            using (SqlDataReader reader = SqlHelper.Default.ExecuteReader(cmd))
            {
                while (reader.Read())
                {
                    var vipNumber = reader.GetString(0);

                    txtVipNumber.Text = reader.GetString(0);
                    txtPhoneBook.Text = reader.GetString(1);
                    txtType.Text      = reader.GetString(2);
                    txtPhoneTag1.Text = reader.GetString(3);
                    txtPhoneTag2.Text = reader.GetString(4);
                    txtPhoneTag3.Text = reader.GetString(5);
                    txtPhoneTag4.Text = reader.GetString(6);
                    //txtPhoneTag5.Text = reader.GetString(7);
                    txtPhoneTag5.Text = MemberVipDataEx.GetAttribute(vipNumber, "Pager", this.AddressTypeId.ToString().Replace("-", ""));
                }
            }
        }