public Find(MainForm form,Database data) { this.forms = form; this.dataBase = data; // // The InitializeComponent() call is required for Windows Forms designer support. // InitializeComponent(); CenterToScreen(); }
public Update(MainForm form,Database data,int _id,string _btc,string _name,string _type ,string _exp,string _amonut ,string _note) { this.forms = form; this.id=_id; // MessageBox.Show(_exp); this.exp =Regex.Split(_exp,"/"); this.batch=_btc; this.name=_name; this.type=_type; this.amount=_amonut; this._note=_note; this.database =data; // // The InitializeComponent() call is required for Windows Forms designer support. // InitializeComponent(); CenterToScreen(); intYear =Convert.ToInt32(exp[0]); comboYear.Items.AddRange(new object[]{ intYear-3, intYear-2, intYear-1, intYear, intYear+1, intYear+2, intYear+3, intYear+4, intYear+5, }); comboYear.Text=exp[0]; comboMonth.Text=exp[1]; dayNumber.Text =exp[2]; medName.Text=_name; batchNum.Text=_btc; medAmount.Text=_amonut; _notes.Text=_note; comboType.Text=_type; if(comboType.Text ==""){ textboxOther.Visible=true; comboType.Text="others"; textboxOther.Text=_type; } }
public void Start(string loca) { //data = new Database(); data.Location =loca; data = new Database(); data.Ccon(); getAll(0); }
public void Start() { data = new Database(); data.Ccon(); getAll(0); }
void StartCconClick(object sender, EventArgs e) { // TODO: Implement StartCconClick data = new Database(); data.Ccon(); getAll(0); }
void Save() { if( /*batchNum.Text.Equals("") ||medAmount.Text =="" ||*/ comboType.Text.Equals("")||comboYear.Text.Equals("")||comboMonth.Text.Equals("")|| medName.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; if(comboType.Text=="others"){ typeSelect= textboxOther.Text; }else{ typeSelect=comboType.Text; } 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(); a.Add(batchNum.Text,medName.Text,typeSelect,f.CheckDateBeforeAdd(dateType),amount ,note.Text); forms.getAll(0); forms.DisableSelect(); this.Activate(); } }