예제 #1
0
파일: Find.cs 프로젝트: roonqe/Expire
 public Find(MainForm form,Database data)
 {
     this.forms = form;
     this.dataBase = data;
     //
     // The InitializeComponent() call is required for Windows Forms designer support.
     //
     InitializeComponent();
     CenterToScreen();
 }
예제 #2
0
파일: Update.cs 프로젝트: roonqe/Expire
        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;
            }
        }
예제 #3
0
파일: MainForm.cs 프로젝트: roonqe/Expire
 public void Start(string loca)
 {
     //data = new Database();
     data.Location =loca;
     data = new Database();
     data.Ccon();
     getAll(0);
 }
예제 #4
0
파일: MainForm.cs 프로젝트: roonqe/Expire
 public void Start()
 {
     data = new Database();
     data.Ccon();
     getAll(0);
 }
예제 #5
0
파일: MainForm.cs 프로젝트: roonqe/Expire
        void StartCconClick(object sender, EventArgs e)
        {
            // TODO: Implement StartCconClick

            data = new Database();

            data.Ccon();
            getAll(0);
        }
예제 #6
0
파일: AddNew.cs 프로젝트: roonqe/Expire
        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();

            }
        }