コード例 #1
0
        public Form_ApproveExpense(Form1 form, DBinterface dbInterface, List <string> id)
        {
            InitializeComponent();
            this.StartPosition = FormStartPosition.CenterScreen;
            InputLanguage.CurrentInputLanguage = InputLanguage.FromCulture(new System.Globalization.CultureInfo("en-US"));
            localInterface = dbInterface;
            mainForm       = form;
            this.ids       = id;
            DataTable dt = localInterface.Select("SELECT approved,date,amount FROM expenses WHERE id=" + ids[0]).Tables[0];

            approved = (bool)dt.Rows[0][0];
            comboBox1.SelectedIndex = 0;
            if (approved)
            {
                comboBox1.SelectedIndex = 1;
            }
            date = MyUtills.dateFromSQL(dt.Rows[0][1].ToString());
            dateTimePicker1.Value = date;
            if (this.ids.Count > 1)
            {
                checkBoxDate.Checked = false;
                textBox1.Visible     = false;
                label1.Visible       = false;
            }
            else
            {
                textBox1.Text = String.Format("{0:0,0.00}", double.Parse(dt.Rows[0][2].ToString()));
            }
        }
コード例 #2
0
        public Form_EditIncome(Form1 form, DBinterface dbInterface, string id, bool def)
        {
            InitializeComponent();
            this.StartPosition = FormStartPosition.CenterScreen;
            InputLanguage.CurrentInputLanguage = InputLanguage.FromCulture(new System.Globalization.CultureInfo("en-US"));
            localInterface = dbInterface;
            mainForm       = form;
            this.id        = id;
            this.definite  = def;

            if (definite)
            {
                dateTimePicker1.Value = MyUtills.dateFromSQL(localInterface.Select("SELECT payDate FROM bills WHERE id=" + this.id).Tables[0].Rows[0][0].ToString());
            }
            else
            {
                dateTimePicker1.Value = MyUtills.dateFromSQL(localInterface.Select("SELECT toPayDate FROM bills WHERE id=" + this.id).Tables[0].Rows[0][0].ToString());
            }
        }