public static List<CustomerType> CustomerTypes_GetAll() { string query = "CustomerTypes_GetAll"; DataTable dt = Connection.runQuery(query, new SqlParameter[0]); List<CustomerType> res = new List<CustomerType>(); for (int i = 0; i < dt.Rows.Count; i++) { CustomerType tmp = new CustomerType(); tmp.ID = Convert.ToInt32(dt.Rows[i]["ID"].ToString()); tmp.CustomerTypeName = dt.Rows[i]["CustomerTypeName"].ToString(); tmp.PreFixChar = dt.Rows[i]["PreFixChar"].ToString(); res.Add(tmp); } return res; }
private void update() { if (this.txtNewName.TextLength <= 0 || MessageBox.Show("Güncellenicektir!!! Emin misiniz?", "Uyarı", MessageBoxButtons.YesNo) != DialogResult.Yes) return; CustomerType customerType = (CustomerType)this.cbValues.SelectedItem; if (customerType == null) { customerType = new CustomerType(); customerType.ID = 0; } if (this.txtPreFixChar.TextLength == 0) { int num = (int)MessageBox.Show("Kısa Yazılışı yazın."); } else { CustomerType.CustomerTypes_Update(customerType.ID, this.txtNewName.Text, this.txtPreFixChar.Text); this.Fill(); } }