Esempio n. 1
0
        private void Frm_TestQuery_Load(object sender, EventArgs e)
        {
            int key = CalcKey.CalcKeyFun(ConfigurationManager.AppSettings.Get("seed"));

            _connectString         = CalcMask.RestoreMask(ConfigurationManager.ConnectionStrings["mycon"].ToString(), key);
            cmb_type.SelectedIndex = 0;
        }
Esempio n. 2
0
        private void frm_income_Load(object sender, EventArgs e)
        {
            int key = CalcKey.CalcKeyFun(ConfigurationManager.AppSettings.Get("seed"));

            _connectString    = CalcMask.RestoreMask(ConfigurationManager.ConnectionStrings["mycon"].ToString(), key);
            dtp.ValueChanged += new EventHandler(dtp_ValueChanged);
            cmb_type.SelectedIndexChanged += new EventHandler(cmb_type_ValueChanged);
            cmb_type.Validating           += new CancelEventHandler(cmb_type_Validating);
            cmb_type.MouseDown            += new MouseEventHandler(cmb_type_MouseDown);
            dtp.Enabled      = false;
            cmb_type.Enabled = false;

            btn_delete.Enabled   = false;
            btn_new.Enabled      = false;
            btn_reject.Enabled   = false;
            btn_save.Enabled     = false;
            this.dtp_begin.Value = DateTime.Now.AddDays((-1) * (DateTime.Now.Day - 1));

            List <object> sourc = new List <object>();

            using (SqlConnection con = new SqlConnection(_connectString))
            {
                con.Open();
                string sqlText = "select distinct inc_source from tbl_income";
                using (SqlCommand command = new SqlCommand(sqlText, con))
                {
                    SqlDataReader dReader = command.ExecuteReader();
                    while (dReader.Read())
                    {
                        sourc.Add(dReader["inc_source"]);
                    }
                }
            }
            cmb_type.Items.AddRange(sourc.ToArray());
            cmb_source.Items.AddRange(sourc.ToArray());
            do_query();
        }
Esempio n. 3
0
        private void frm_expend_Load(object sender, EventArgs e)
        {
            int key = CalcKey.CalcKeyFun(ConfigurationManager.AppSettings.Get("seed"));

            _connectString    = CalcMask.RestoreMask(ConfigurationManager.ConnectionStrings["mycon"].ToString(), key);
            dtp.ValueChanged += new EventHandler(dtp_ValueChanged);
            cmb_item.SelectedIndexChanged += new EventHandler(cmb_item_ValueChanged);
            cmb_item.MouseDown            += new MouseEventHandler(cmb_type_MouseDown);
            cmb_item.Validating           += new CancelEventHandler(cmb_item_Validating);

            cmb_type.SelectedIndexChanged += new EventHandler(cmb_type_ValueChanged);
            cmb_type.SelectedValueChanged += new EventHandler(cmb_type_ValueChanged);
            cmb_type.Validating           += new CancelEventHandler(cmb_type_Validating);
            num.ValueChanged += new EventHandler(num_ValueChanged);

            dtp.Enabled      = false;
            cmb_item.Enabled = false;
            cmb_type.Enabled = false;
            num.Enabled      = false;

            btn_delete.Enabled   = false;
            btn_new.Enabled      = false;
            btn_reject.Enabled   = false;
            btn_save.Enabled     = false;
            num.DecimalPlaces    = 4;
            num.Increment        = 0.0001M;
            this.dtp_begin.Value = DateTime.Now.AddDays((-1) * (DateTime.Now.Day - 1));

            List <object> sourc = new List <object>();

            using (SqlConnection con = new SqlConnection(_connectString))
            {
                con.Open();
                string sqlText = "select distinct exp_item from tbl_expend";
                using (SqlCommand command = new SqlCommand(sqlText, con))
                {
                    SqlDataReader dReader = command.ExecuteReader();
                    while (dReader.Read())
                    {
                        sourc.Add(dReader["exp_item"]);
                    }
                }
            }
            cmb_item.Items.AddRange(sourc.ToArray());

            sourc.Clear();

            using (SqlConnection con = new SqlConnection(_connectString))
            {
                con.Open();
                string sqlText = "select distinct exp_type from tbl_expend";
                using (SqlCommand command = new SqlCommand(sqlText, con))
                {
                    SqlDataReader dReader = command.ExecuteReader();
                    while (dReader.Read())
                    {
                        sourc.Add(dReader["exp_type"]);
                    }
                }
            }
            cmb_type.Items.AddRange(sourc.ToArray());
            cmb_itemtype.Items.AddRange(sourc.ToArray());
            do_query();
            toolStripStatusLabel1.Text = "当前用户:" + _userName;
            toolStripStatusLabel2.Text = "就绪";
        }