void Save() { EpisodeC eps = new EpisodeC(); if (/*batchNum.Text.Equals("") ||medAmount.Text =="" || comboType.Text.Equals("")||*/ comboYear.Text.Equals("") || comboMonth.Text.Equals("")) { } // else if(comboType.Text=="others" && textboxOther.Text=="") // { // textboxOther.Select(); // } else { // Thread prgThead = new Thread(StarProg); // prgThead.Start(); Database a = new Database(); int amount = f.AddInt(medAmount.Text); string typeSelect = null; string dateType = null; if (dayNumber.Text == "0" || dayNumber.Enabled == false) { dateType = comboYear.Text + "-" + comboMonth.Text + "-" + f.getLastDayOfMonth(comboMonth.Text); } else { string addZero = dayNumber.Text; if (dayNumber.Value < 10) { addZero = "0" + dayNumber.Text; } else { } dateType = comboYear.Text + "-" + comboMonth.Text + "-" + addZero; } // a.Ccon(); eps.Insert(new Episode() { Stoke_id = GetStoreId(cbstore.Text), Item_id = GetItemId(cbitem.Text), Amount = amount, AmountType = cbamountype.Text, Notes = note.Text, Expdate = f.CheckDateBeforeAdd(dateType), Batch = batchNum.Text }); forms.getAll(""); forms.DisableSelect(); this.Activate(); } }
void FindBtnClick(object sender, EventArgs e) { if (radioBatch.Checked) { if (textBox1.Text.Equals("")) { } else { // dataBase.setQuery(textBox1.Text); forms.getAll(""); } } if (radioName.Checked) { if (textBox1.Text.Equals("")) { } else { // dataBase.setQuery(textBox1.Text); forms.getAll(""); } } if (radioType.Checked) { if (comboType.Text.Equals("")) { } else { // dataBase.setQuery(comboType.Text); forms.getAll(""); } } this.Activate(); }