Beispiel #1
0
 private void ExecuteSql()
 {
     if (_oracleDataTable != null)
     {
         _oracleDataTable.Dispose();
     }
     _oracleDataTable = new OracleDataTable(_selectStatement);
     this.DataSource = _oracleDataTable;
 }
Beispiel #2
0
        public FormCompaniesSyns(long locationid, string name, string sortname)
        {
            InitializeComponent();

            _Name = name;
            _locationd = locationid;
            _sortname = sortname;
            OracleDataTable dt = new OracleDataTable("select * from vformcompanies_synonyms where name='" + name.ToUpper() + "'");
            foreach (DataRow dr in dt.Rows)
            {
                mlSyns.AppendLine(dr["Synonym"].ToString());
            }

        }
        private void Populate()
        {

            // Fill combo-box
            if (cmbFormatTypes.Items.Count == 0)
            {
                DC.OracleDataTable _table = new OracleDataTable(
            "select tbTelephoneFormatTypes.Tbtelephoneformattypecode as ID from tbTelephoneFormatTypes");
                foreach (DataRow row in _table.Rows)
                    cmbFormatTypes.Items.Add(row["ID"]);

            }

            // Get data
            OracleDataTable dt = new OracleDataTable("select * from vformcompanies_formats where telephoneid=" + _Telephoneid.ToString());
            foreach (DataRow row in dt.Rows)
            {
                tbTelephone.Text = row["Telephone"].ToString();
                tbFormat.Text = row["Format"].ToString();
                cmbFormatTypes.Text = row["Type"].ToString();

                string from = row["From"].ToString();
                if (from.Length > 0)
                {
                    dpFrom.Value = DateTime.ParseExact(from, "yyyy-MM-dd", CultureInfo.InvariantCulture);
                    dpFrom.Checked = true;
                }
                string to = row["To"].ToString();
                if (to.Length > 0)
                {
                    dpTo.Value = DateTime.ParseExact(to, "yyyy-MM-dd", CultureInfo.InvariantCulture);
                    dpTo.Checked = true;
                }

            }
            dt.Connection.Close();

            // Defaults
            if (tbFormat.Text.Length == 0)
            {
                cmbFormatTypes.Text = "SURVEY";
                dpFrom.Value = DateTime.Now;
                dpTo.Value = DateTime.Now.AddDays(365);
            }

            // Focus
            tbFormat.Focus();

        }
Beispiel #4
0
        private void ViewDetails(long vkiid)
        {
            OracleDataTable details = new OracleDataTable("select * from vFormPersons_details where vkiid =" + vkiid.ToString());
            foreach (DataRow row in details.Rows)
            {
                tbVkiid.Text = row["Vkiid"].ToString();
                tbFirstName.Text = row["Firstname"].ToString();
                tbMiddleName.Text = row["Middlename"].ToString();
                tbLastName.Text = row["Lastname"].ToString();
                tbTitle.Text = row["Title"].ToString();
                tbMobile.Text = row["Mobile"].ToString();
                tbSSNO.Text = row["Ssno"].ToString();
                tbGender.Text = row["Gender"].ToString();
                tbSource.Text = row["Source"].ToString();
                tbSearch.Text = row["Search"].ToString();
                tbUpdates.Text = row["Updates"].ToString();

                HittaLink =
                    "http://www.hitta.se/*NAME*/x/person/*VKIKEY*?vad=*NAME*".Replace("*NAME*", row["Fullname"].ToString())
                        .Replace("*VKIKEY*", row["Vkikey"].ToString());

                if (tbSSNO.Text.Length == 12)
                {
                    string first = tbFirstName.Text.Replace("å", "%e5");
                    string last = tbLastName.Text.Replace("å", "%e5");
                    string year = tbSSNO.Text.Substring(0, 4);
                    string month = tbSSNO.Text.Substring(4, 2);
                    month = int.Parse(month).ToString();
                    string day = tbSSNO.Text.Substring(6, 2);
                    day = int.Parse(day).ToString();
                    BirthdayLink = "http://www.birthday.se/sok/?f=*FIRST*&l=*LAST*&y=*YEAR*&m=*MONTH*&d=*DAY*".Replace("*FIRST*", first).Replace("*LAST*", last).Replace("*YEAR*", year).Replace("*MONTH*", month).Replace("*DAY*", day);
                    llBirthday.Enabled = true;
                } else {
                    llBirthday.Enabled = false;
                }
            }

        }