Example #1
0
 private void button_login_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(textbox_username.Text))
     {
         MessageBox.Show("请输入用户名.", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
         textbox_username.Focus();
         return;
     }
     try
     {
         using (JPsaleEntities test = new JPsaleEntities())
         {
             var query = from o in test.AdminInfoes
                         where o.Username == textbox_username.Text && o.Password == textbox_password.Text
                         select o;
             if (query.SingleOrDefault() != null)
             {
                 //MessageBox.Show("登陆成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                 this.Hide();
                 Form2 fm2 = new Form2();
                 fm2.Show();
             }
             else
             {
                 MessageBox.Show("用户名或密码错误!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Message", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Example #2
0
        public Form_ptmgt()
        {
            InitializeComponent();
            db = new JPsaleEntities();
            productInfoBindingSource.DataSource = db.ProductInfoes.ToList();


            dataGridView1.Columns[0].HeaderText = "商品号";
            dataGridView1.Columns[1].HeaderText = "商品名";
            dataGridView1.Columns[2].HeaderText = "原价";
            dataGridView1.Columns[3].HeaderText = "售价";
            dataGridView1.Columns[4].HeaderText = "活动价";
            dataGridView1.Columns[5].HeaderText = "代理价";
            DataGridViewColumn column0 = dataGridView1.Columns[0];

            column0.Width = 70;
            DataGridViewColumn column1 = dataGridView1.Columns[1];

            column1.Width = 235;
            DataGridViewColumn column2 = dataGridView1.Columns[2];

            column2.Width = 60;
            DataGridViewColumn column3 = dataGridView1.Columns[3];

            column3.Width = 60;
            DataGridViewColumn column4 = dataGridView1.Columns[4];

            column4.Width = 70;
            DataGridViewColumn column5 = dataGridView1.Columns[5];

            column5.Width = 70;
        }
Example #3
0
        public Form_trademgt()
        {
            InitializeComponent();
            db = new JPsaleEntities();
            orderInfoBindingSource.DataSource = db.OrderInfoes.ToList();


            dateTimePicker1.Value = DateTime.Today;
        }
        public Form_purchase()
        {
            InitializeComponent();

            db = new JPsaleEntities();
            productInfoBindingSource.DataSource  = db.ProductInfoes.ToList();
            customerInfoBindingSource.DataSource = db.CustomerInfoes.ToList();
            // orderInfobindingSource.DataSource = db.OrderInfoes.ToList();
            dateTimePicker1.Value = DateTime.Today;
        }
 public Form_addctm(CustomerInfo obj)
 {
     InitializeComponent();
     db = new JPsaleEntities();
     if (obj == null)
     {
         customerInfoBindingSource.DataSource = new CustomerInfo();
         db.CustomerInfoes.Add(customerInfoBindingSource.Current as CustomerInfo);
     }
     else
     {
         customerInfoBindingSource.DataSource = obj;
         db.CustomerInfoes.Attach(customerInfoBindingSource.Current as CustomerInfo);
     }
 }
        public Form_ctmgt()
        {
            InitializeComponent();

            db = new JPsaleEntities();
            customerInfoBindingSource.DataSource = db.CustomerInfoes.ToList();

            dataGridView1.Columns[0].HeaderText = "客户号";
            dataGridView1.Columns[1].HeaderText = "名字";
            dataGridView1.Columns[2].HeaderText = "地址";
            dataGridView1.Columns[3].HeaderText = "电话号码";

            DataGridViewColumn column = dataGridView1.Columns[2];

            column.Width = 250;
        }
Example #7
0
 public Form_editOrder(OrderInfo obj)
 {
     InitializeComponent();
     db = new JPsaleEntities();
     dateTimePicker1.Value = DateTime.Today;
     if (obj == null)
     {
         orderInfoBindingSource.DataSource = new OrderInfo();
         db.OrderInfoes.Add(orderInfoBindingSource.Current as OrderInfo);
     }
     else
     {
         orderInfoBindingSource.DataSource = obj;
         db.OrderInfoes.Attach(orderInfoBindingSource.Current as OrderInfo);
     }
 }
Example #8
0
        public Form_addpt(ProductInfo obj)
        {
            InitializeComponent();
            db = new JPsaleEntities();
            //ProductInfobindingSource.DataSource = obj;

            if (obj == null)
            {
                ProductInfobindingSource.DataSource = new ProductInfo();
                db.ProductInfoes.Add(ProductInfobindingSource.Current as ProductInfo);
            }
            else
            {
                ProductInfobindingSource.DataSource = obj;
                db.ProductInfoes.Attach(ProductInfobindingSource.Current as ProductInfo);
            }
        }
 public Form_Ordermgt()
 {
     InitializeComponent();
     db = new JPsaleEntities();
     orderInfoBindingSource.DataSource = db.OrderInfoes.ToList();
 }