public AddCustomerForm(MainForm form, int id) { InitializeComponent(); this.id = id; this.form = form; db = new SqlConnectionDB(); save.Text = "تعديل"; this.Text = "تعديل الزبون"; cases = 2; name_txt.Text = db.ListOF("SELECT cust_name from customer where cust_id=" + id).ElementAt(0); string type = db.ListOF("SELECT cust_type from customer where cust_id=" + id).ElementAt(0); if (type == "دكتور") { type_combo.SelectedIndex = 0; } else if (type == "مختبر") { type_combo.SelectedIndex = 1; } else { type_combo.SelectedIndex = 2; } email_txt.Text = db.ListOF("SELECT cust_email from customer where cust_id=" + id).ElementAt(0); phone_list.Clear(); foreach (string s in db.ListOF("Select number from phones where cust_id=" + id)) { phone_list.Items.Add(s); } }
public AddOutcomeForm(SettingsForm form) { InitializeComponent(); this.form = form; db = new SqlConnectionDB(); this.Text = "تعديل المصروف"; }
public AddSellerForm(MainForm form) { InitializeComponent(); this.form = form; db = new SqlConnectionDB(); casses = 1; }
public ShowPaymentForm(int id) { InitializeComponent(); this.id = id; this.db = new SqlConnectionDB(); RefreshPay(); RefreshCheck(); }
public AddDebitForm(MainForm form) { InitializeComponent(); WindowState = FormWindowState.Maximized; db = new SqlConnectionDB(); date = DateTime.Today; this.form = form; }
public ShowCustBills(int Id, int user_id) { InitializeComponent(); WindowState = FormWindowState.Maximized; this.Id = Id; db = new SqlConnectionDB(); this.User_id = user_id; //RefreshData(""); }
public AddNeedForm(MainForm form) { InitializeComponent(); db = new SqlConnectionDB(); this.form = form; foreach (string s in db.ListOF("SELECT * FROM items_type")) { name_combo.Items.Add(s); } }
public AddSellBillForm(MainForm form) { InitializeComponent(); db = new SqlConnectionDB(); this.form = form; foreach (string s in db.ListOF("SELECT sell_name from seller")) { seller_combo.Items.Add(s); } }
public int DeleteContact(int Id) { SqlConnectionDB dataBase = new SqlConnectionDB("SqlConnection"); int rowsEffected; rowsEffected = dataBase.Delete(tableName: "dbo.ContactsTable", primaryKeyName: "id", poco: null, primaryKeyValue: Id); return(rowsEffected); }
public int AddContact(ContactModel contact) { SqlConnectionDB dataBase = new SqlConnectionDB("SqlConnection"); ContactsTable tableData = new ContactsTable(); Mapper.Map(contact, tableData); return((int)dataBase.Insert(tableName: "dbo.ContactsTable", primaryKeyName: "Id", autoIncrement: false, poco: tableData)); }
public List <ContactModel> GetContactsList() { SqlConnectionDB dataBase = new SqlConnectionDB("SqlConnection"); List <ContactModel> contactsList = new List <ContactModel>(); List <ContactsTable> contactsTable = dataBase.Fetch <ContactsTable>("select * from ContactsTable;"); Mapper.Map(contactsTable, contactsList); return(contactsList); }
public ContactModel GetContact(int Id) { SqlConnectionDB dataBase = new SqlConnectionDB("SqlConnection"); ContactModel contact = new ContactModel(); ContactsTable contactTable = new ContactsTable(); contactTable = dataBase.Single <ContactsTable>("WHERE Id = @0", Id); Mapper.Map(contactTable, contact); return(contact); }
public AddSellerForm(MainForm form, int id) { InitializeComponent(); this.form = form; db = new SqlConnectionDB(); this.id = id; casses = 2; this.Text = "تعديل التاجر"; button1.Text = "تعديل"; DataSet data = new DataSet(); db.selectDB(ref data, "SELECT * FROM seller WHERE sell_id=" + id); name_txt.Text = data.Tables[0].Rows[0][1].ToString(); phone_txt.Text = data.Tables[0].Rows[0][2].ToString(); email_txt.Text = data.Tables[0].Rows[0][3].ToString(); }
private void SettingsForm_Load(object sender, EventArgs e) { db = new SqlConnectionDB(); date_combo2.SelectedIndex = 0; }
public SellBillItemsDialog(AddSellBillForm form) { InitializeComponent(); db = new SqlConnectionDB(); data = db.ListOF("SELECT * FROM items_type"); this.form = form; int counts; while (true) { try { counts = Convert.ToInt32(Interaction.InputBox("ادخل عدد الاغراض", "عدد الاغراض", "العدد", 200, 200)); break; } catch (FormatException) { MessageBox.Show("ادخل عدد صحيح"); } } int j = 0; #region for (int i = 0; i < counts; i++) { ComboBox comboBox1 = new ComboBox(); Label label1 = new Label(); Label label2 = new Label(); TextBox textBox1 = new TextBox(); TextBox textBox2 = new TextBox(); Label label3 = new Label(); // // comboBox1 // comboBox1.FormattingEnabled = true; comboBox1.Location = new System.Drawing.Point(84, 86 + j); comboBox1.Name = "comboBox1"; comboBox1.Size = new System.Drawing.Size(141, 21); comboBox1.TabIndex = 0; // // label1 // label1.AutoSize = true; label1.Location = new System.Drawing.Point(25, 89 + j); label1.Name = "label1"; label1.Size = new System.Drawing.Size(53, 13); label1.TabIndex = 1; label1.Text = "اسم الماده"; // // label2 // label2.AutoSize = true; label2.Location = new System.Drawing.Point(258, 89 + j); label2.Name = "label2"; label2.Size = new System.Drawing.Size(29, 13); label2.TabIndex = 2; label2.Text = "العدد"; // // textBox1 // textBox1.Location = new System.Drawing.Point(303, 86 + j); textBox1.Name = "textBox1"; textBox1.Size = new System.Drawing.Size(100, 20); textBox1.TabIndex = 3; textBox1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; // // textBox2 // textBox2.Location = new System.Drawing.Point(467, 86 + j); textBox2.Name = "textBox2"; textBox2.Size = new System.Drawing.Size(100, 20); textBox2.TabIndex = 5; textBox2.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; // // label3 // label3.AutoSize = true; label3.Location = new System.Drawing.Point(422, 89 + j); label3.Name = "label3"; label3.Size = new System.Drawing.Size(33, 13); label3.TabIndex = 4; label3.Text = "السعر"; this.Controls.Add(comboBox1); this.Controls.Add(label1); this.Controls.Add(textBox1); this.Controls.Add(label2); this.Controls.Add(textBox2); this.Controls.Add(label3); foreach (string s in data) { comboBox1.Items.Add(s); } list.AddLast(new Items { item_combo = comboBox1, count_txt = textBox1, price_txt = textBox2 }); j += 50; } #endregion }
private void Delivery_Dialog_Load(object sender, EventArgs e) { delv_state_combo.SelectedItem = delv_state; db = new SqlConnectionDB(); }
private void ShowBill_Load(object sender, EventArgs e) { db = new SqlConnectionDB(); RefreshTheBill(); }
private void ShowWarrnity_Load(object sender, EventArgs e) { db = new SqlConnectionDB(); RefreshWarr(); }
private void ShowCheck_Load(object sender, EventArgs e) { db = new SqlConnectionDB(); RefreshCheck(); }