Example #1
0
        private async void CarsViewButton_Click(object sender, System.EventArgs e)
        {
            List <Car> cars = new List <Car>();

            ListView1.Clear();
            cars = await Car.SelectCars();

            Car.ShowCars(cars, ListView1);
        }
Example #2
0
        private async void AuctionsViewButton_Click(object sender, System.EventArgs e)
        {
            List <Advertisement> ads = new List <Advertisement>();

            ListView1.Clear();
            ads = await Advertisement.SelectAdvertisements();

            Advertisement.ShowAdvertisements(ads, ListView1);
        }
        void LoadListview()
        {
            ListView1.Clear();
            DirectoryInfo directoryInfo = new DirectoryInfo("DataMedia/Music");

            FileInfo[] arrayfilename = directoryInfo.GetFiles();
            foreach (var item in arrayfilename)
            {
                ListView1.Items.Add(item.Name);
            }
        }
Example #4
0
		private void data_load()
		{
			Bank_Department.Enabled = false;
			Bank_Name.Enabled = false;
			Bank_Code.Enabled = false;
			Bank_Account.Enabled = false;
			Bank_Department.Text = "";
			Bank_Name.Text = "";
			Bank_Code.Text = "";
			Bank_Account.Text = "";
			B_SAVE.Enabled = false;
			B_DELE.Enabled = false;
			ListView1.Clear();
			ListView1.Columns.Add("ردیف", 50, HorizontalAlignment.Right);
			ListView1.Columns.Add("نام بانک", 130, HorizontalAlignment.Center);
			ListView1.Columns.Add("شعبه", 200, HorizontalAlignment.Center);
			ListView1.Columns.Add("کد بانک", 100, HorizontalAlignment.Center);
			ListView1.Columns.Add("حساب", 200, HorizontalAlignment.Center);
			f_serch = "";
			f_serch = "SELECT * FROM  bank";
			if (MDIParent1.DefaultInstance.N_Admin.Text == "False")
			{
				f_serch += " where Bank_Area=" + MDIParent1.DefaultInstance.N_Id_Area.Text + "";
			}
			DataSet PrSet = data.PDataset("" + f_serch + "");
			foreach (DataRow Dr in PrSet.Tables[0].Rows)
			{
				ListViewItem lv = ListView1.Items.Add(ListView1.Items.Count + 1);
				lv.SubItems.Add(Dr["Bank_Department"]);
				lv.SubItems.Add(Dr["Bank_Name"]);
				lv.SubItems.Add(Dr["Bank_Code"]);
				lv.SubItems.Add(Dr["Bank_Account"]);
				lv.SubItems.Add(Dr["Bank_Id"]);
				lv.SubItems.Add(Dr["Bank_Check_number_Of"] + 1);
				lv.SubItems.Add(Dr["Bank_Chech_Number"]);
				lv.SubItems.Add(Dr["Bank_Check_number_To"]);
				lv.SubItems.Add(Dr["Bank_Check"]);
				lv.SubItems.Add(Dr["Bank_Payment"]);
				lv.SubItems.Add(Dr["Bank_Name_Case1"]);
				lv.SubItems.Add(Dr["Bank_Name_Case2"]);
				lv.SubItems.Add(Dr["Bank_Name_Case3"]);
				lv.SubItems.Add(Dr["Bank_Name_Case4"]);
				lv.SubItems.Add(Dr["Bank_Name_Case5"]);
				lv.SubItems.Add(Dr["Bank_Post_Case1"]);
				lv.SubItems.Add(Dr["Bank_Post_Case2"]);
				lv.SubItems.Add(Dr["Bank_Post_Case3"]);
				lv.SubItems.Add(Dr["Bank_Post_Case4"]);
				lv.SubItems.Add(Dr["Bank_Post_Case5"]);
				lv.SubItems.Add(Dr["Bank_Case"]);
			}
		}
Example #5
0
 void Reset()
 {
     textBox6.Text        = "";
     textBox7.Text        = "";
     comboBox1.Text       = "";
     comboBox2.Text       = "";
     comboBox3.Text       = "";
     txtPrice.Text        = "";
     txtAvailableQty.Text = "";
     txtSaleQty.Text      = "";
     txtTotalAmount.Text  = "";
     textBox5.Text        = "";
     ListView1.Clear();
 }
Example #6
0
        private void FrmProbationPeriodReminders_Load(object sender, EventArgs e)
        {
            ListView1.Clear();
            if (My.MyProject.Forms.FrmHomePage.typeOfReminder.Equals("Probation"))
            {
                ListView1.Columns.Add("Name", 300);
                ListView1.Columns.Add("Hire date", 150);
                ListView1.Columns.Add("Probation date end", 200);
                ListView1.Columns.Add("", 0);
                notificationTypeLabel.Text = "Upcoming probation period due dates";
            }
            else if (My.MyProject.Forms.FrmHomePage.typeOfReminder.Equals("Birthday"))
            {
                notificationTypeLabel.Text = "Upcoming Birthdays";
                ListView1.Columns.Add("Name", 400);
                ListView1.Columns.Add("Birthday", 250);
                ListView1.Columns.Add("", 0);
            }

            ListView1.Width = 655;
            populate();
        }
Example #7
0
        private void btn_Ok_Click(object sender, EventArgs e)
        {
            //clear;清空控件中的内容,DataGridView要用Rows.Clear();方法
            ListView1.Clear();
            textBox1.Clear();
            DataGridView1.Rows.Clear();
            //取出ComBoBox中选择的内容
            String checkedNumber = cmb_ChooseNumber.Text;
            int    number        = int.Parse(checkedNumber);

            if (checkedNumber == "")
            {
                //如果没有选择的话提示一下
                MessageBox.Show("No Choose!");
            }
            else
            {
                ShowMultiplicationTableTextBox(number);
                ShowMultiplicationTableDataGridView(number);
                ShowMultiplicationTableListView(number);
            }
        }
        private void Search_Click(object sender, EventArgs e)
        {
            ListView1.Clear();
            Utility util = new Utility();

            if (SearchBox.Text != "")
            {
                string SearchFor = SearchBox.Text;
                Set_ListView();
                foreach (List <Records> records in AllTypes)
                {
                    CurrentRecords = records;
                    Search search = new Search(SearchFor, CurrentRecords);
                    foreach (Records rec in search.FindPerson())
                    {
                        Set_Display(rec, util.PagesToDisplay(rec.Pages));
                    }
                }
                foreach (ColumnHeader head in ListView1.Columns)
                {
                    head.AutoResize(ColumnHeaderAutoResizeStyle.HeaderSize);
                }
            }
        }
Example #9
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void frmTypistFind_Load(object sender, EventArgs e)
        {
            StringBuilder sbTrace = new StringBuilder();

            try
            {
                sbTrace.AppendLine("Start");
                Logger.SaveLoggerTrace(sbTrace);
                ADODB.Recordset  rs          = new ADODB.Recordset();
                ALSFunctions     als         = new ALSFunctions();
                ADODB.Connection cn          = default(ADODB.Connection);
                ColumnHeader     lvwColumn   = default(ColumnHeader);
                ListViewItem     itmListItem = default(ListViewItem);

                cn = als.oConn();
                rs.Open("qryAuthor", cn);

                ListView1.Clear();

                lvwColumn      = new ColumnHeader();
                lvwColumn.Text = "Name";
                ListView1.Columns.Add(lvwColumn);

                while (!rs.EOF)
                {
                    itmListItem = new ListViewItem();
                    if (Information.IsDBNull(rs.Fields[1].Value))
                    {
                        itmListItem.Text = "";
                    }
                    else
                    {
                    }
                    itmListItem.Text = rs.Fields[1].Value.ToString();

                    if (Information.IsDBNull(rs.Fields[0].Value.ToString()))
                    {
                        itmListItem.Tag = "";
                        //itmListItem.SubItems.Add("")
                    }
                    else
                    {
                        itmListItem.Tag = rs.Fields[0].Value.ToString();
                        //itmListItem.SubItems.Add(rs.Fields(0).Value)
                    }

                    ListView1.Items.Add(itmListItem);
                    //ListView1.Columns.Item[0].AutoResize(ColumnHeaderAutoResizeStyle.ColumnContent);
                    rs.MoveNext();
                }
                rs.Close();
                cn.Close();
            }
            catch (Exception ex)
            {
                sbTrace.Clear();
                sbTrace.AppendLine("Exception" + ex);
                Logger.SaveLoggerTrace(sbTrace);
                Logger.LogWriter(ex.StackTrace);
            }
            finally
            {
                sbTrace.Clear();
                sbTrace.AppendLine("End");
                Logger.SaveLoggerTrace(sbTrace);
            }
        }
 private async void metroTile1_Click(object sender, EventArgs e)
 {
     ListView1.Clear();
     await LoadForm();
 }