コード例 #1
0
        private void btnnew_Click(object sender, EventArgs e)
        {
            bmb.AddNew();
            btnnew.Enabled = false;
            btnadd.Enabled = true;
            int id = Convert.ToInt32(dt.Rows[dt.Rows.Count - 1][0]) + 1;

            txtid.Text = id.ToString();
            txtdes.Focus();
        }
コード例 #2
0
        private void btthemmoi_Click(object sender, EventArgs e)
        {
            tbxmnv.Text                 = "";
            tbxdiachi.Text              = "";
            tbxluong.Text               = "";
            tbxtenhanvien.Text          = "";
            cbxchucvu.SelectedIndex     = -1;
            dateTimePickerngaysinh.Text = DateTime.Now.ToString();
            nhanvien.AddNew();
            dem++;
            labtong.Text = dem.ToString();
            try
            {
                ModuleDB.cnn.Open();
                SqlCommand cmm = new SqlCommand("Select dbo.fu_CreateMaNV()", ModuleDB.cnn);

                tbxmnv.Text = cmm.ExecuteScalar().ToString();
            }
            catch (Exception ex)
            {
                throw ex;
            }


            ModuleDB.cnn.Close();
        }
コード例 #3
0
ファイル: Form1.cs プロジェクト: luuhenry1511/QLDatBao
 private void btnNewDB_Click(object sender, EventArgs e)
 {
     bindPDB.AddNew();
     dtNgayDat.Value = DateTime.Now;
     try
     {
         //goi function fn_CreateMaPDB de phát sinh so phieu dat bao
         //thay doifdfd
         SqlCommand cmm = new SqlCommand();
         cmm.CommandType = CommandType.StoredProcedure;
         cmm.CommandText = "dbo.pro_CreateMaPDB";
         cmm.Parameters.Add("@MaPHNew", SqlDbType.NVarChar, 5).Direction =
             ParameterDirection.Output;
         Modules.cnn.Open();
         cmm.ExecuteScalar();
         txtSoPhieu.Text = cmm.Parameters["@MaPHNew"].Value.ToString();
         capNhat         = true;
         ennableButton();
     }
     catch (SqlException ex)
     {
         MessageBox.Show(ex.ToString());
     }
     Modules.cnn.Close();
 }
コード例 #4
0
 private void btnNouveau_Click(object sender, EventArgs e)
 {
     btnAjouter.Visible = true;
     btnNouveau.Visible = false;
     bmb.AddNew();
     txtNom.Focus();
 }
コード例 #5
0
        private void btnCreate_Click(object sender, EventArgs e)
        {
            listAdminAccount.AddNew();

            // Interface
            NormalInterface = false;
        }
コード例 #6
0
        private void btnThem_Click(object sender, EventArgs e)
        {
            An_hien_nut_lenh(true);
            DS_BANDOC.AddNew();
            // phát sinh mã thẻ
            SqlConnection cnn = new SqlConnection(XL_BANG.Chuoi_lien_ket);

            cnn.Open();
            SqlCommand cmd = new SqlCommand();

            cmd.Connection  = cnn;
            cmd.CommandType = System.Data.CommandType.StoredProcedure;
            cmd.CommandText = "Phat_sinh_ma_the";
            cmd.Parameters.Add("MaThe", System.Data.SqlDbType.VarChar, 6);
            cmd.Parameters["MaThe"].Direction = System.Data.ParameterDirection.ReturnValue;


            DataRowView dr = (DataRowView)DS_BANDOC.Current;

            dr["MaThe"]   = cmd.Parameters["MaThe"].Value.ToString();
            txtMaThe.Text = cmd.Parameters["MaThe"].Value.ToString();

            cnn.Close();
            cap_nhat = true;
        }
コード例 #7
0
 private void Add_Click(object sender, EventArgs e)
 {
     bmb.AddNew();
     category_name.Text = "";
     save.Enabled       = true;
     Add.Enabled        = false;
 }
コード例 #8
0
 private void btn_new_Click(object sender, EventArgs e)
 {
     BM.AddNew();
     textBox_ID.Text        = BM.Count.ToString();
     textBox_phone.ReadOnly = false;
     textBox_name.ReadOnly  = false;
 }
コード例 #9
0
 private void button5_Click(object sender, EventArgs e)
 {
     bmb.AddNew();
     newbtn.Enabled = false;
     addbtn.Enabled = true;
     numbtxt.Focus();
 }
コード例 #10
0
ファイル: safes.cs プロジェクト: aokidai/Rabbit-s-House-2
 private void tolSpInsert_Click(object sender, EventArgs e)
 {
     DSHD.AddNew();
     DSCTHD.AddNew();
     capNhat = true;
     enableButton();
 }
コード例 #11
0
 private void btnTHEMNV_Click(object sender, EventArgs e)
 {
     DSNV.AddNew();
     txtMANV.Text = PHATSINHMANV.Instance.MANHANVIEN().ToString();
     capnhat      = true;
     enablebutton();
 }
コード例 #12
0
        private void btnCreate_Click(object sender, EventArgs e)
        {
            listProductCategory.AddNew();

            // Interface
            NormalInterface = false;
        }
コード例 #13
0
        private void btMuonSach_Click(object sender, EventArgs e)
        {
            An_hien_nut_lenh(true);
            DS_MUON_SACH.AddNew();
            DataRowView dr = (DataRowView)DS_MUON_SACH.Current;

            dr["MaThe"] = cbMaThe.SelectedValue;
        }
コード例 #14
0
 private void btnThem_Click(object sender, EventArgs e)
 {
     SACH.AddNew();
     maskedMaSach.Focus();
     capnhat = true;
     insert  = true;
     enaButton();
 }
コード例 #15
0
 private void Add_Click(object sender, EventArgs e)
 {
     bm.AddNew();
     btnNew.Enabled     = false;
     add.Enabled        = true;
     textBox_CatID.Text = (bm.Count).ToString();
     textBox_CatName.Focus();
 }
コード例 #16
0
 private void btn_New_Click(object sender, EventArgs e)
 {
     BMB.AddNew();
     btn_New.Enabled = false;
     btn_Add.Enabled = true;
     txtb_Description.Focus();
     txtb_IDCategory.Text = (DT.Rows.Count + 1).ToString();
     lbl_Position.Text    = (BMB.Position + 1) + " / " + BMB.Count;
 }
コード例 #17
0
        private void buttonClear_Click(object sender, EventArgs e)
        {
            bm.AddNew();
            buttonAdd.Enabled   = true;
            buttonClear.Enabled = false;
            int id = Convert.ToInt32(dt.Rows[dt.Rows.Count - 1][0]) + 1;

            textid.Text = id.ToString();
            textname.Focus();
        }
コード例 #18
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            bmb.AddNew();
            btnAdd.Enabled    = false;
            btnSave.Enabled   = true;
            txtboxID.ReadOnly = false;
            int id = Convert.ToInt32(dt.Rows[dt.Rows.Count - 1][0]) + 1;

            txtboxID.Text = id.ToString();
        }
コード例 #19
0
        private void btnNew_Click(object sender, EventArgs e)
        {
            bmp.AddNew();
            btnNew.Enabled = false;
            btnAdd.Enabled = true;
            txtDesc.Focus();

            int id = Convert.ToInt32(Dt.Rows[Dt.Rows.Count - 1]["الرقم"]) + 1;

            txtID.Text = id.ToString();
        }
コード例 #20
0
 private void add_new_Click(object sender, EventArgs e)
 {
     bmb.AddNew();
     add.Enabled     = true;
     name.Text       = "";
     surname.Text    = "";
     email.Text      = "";
     phone.Text      = "";
     image.Image     = null;
     add_new.Enabled = false;
 }
コード例 #21
0
        private void btnNew_Click(object sender, EventArgs e)
        {
            // اضافة حقول فارغة وتجهيز قيمة جديدة للمعرف تكون أكبر بواحد من آخر قيمة له
            bmb.AddNew();
            int id = Convert.ToInt32(dt.Rows[dt.Rows.Count - 1][0]) + 1;

            txtRef.Text = id.ToString();
            txtDesc.Focus();
            btnNew.Enabled = false;
            btnAdd.Enabled = true;
        }
コード例 #22
0
        private void btnNew_Click(object sender, EventArgs e)
        {
            bmb.AddNew();
            btnAdd.Enabled = true;
            btnNew.Enabled = false;

            //this to add +1 in (new)text id
            int id = Convert.ToInt32(dt.Rows[dt.Rows.Count - 1][0]) + 1;

            txtID.Text = id.ToString();
            txtDesc.Focus();
        }
コード例 #23
0
        private void btnNewCate_Click(object sender, EventArgs e)
        {
            bmb.AddNew();
            btnAddCate.Enabled = true;
            btnNewCate.Enabled = false;
            int id = Convert.ToInt32(dt.Rows[dt.Rows.Count - 1][0]) + 1;

            // int id = bmb.Count + 1;
            txtCateID.Text = id.ToString();
            txtCateDesc.Focus();
            txtCateDesc.ReadOnly = false;
        }
コード例 #24
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            bmb.AddNew();
            btnedit.Enabled = true;
            btnOK.Enabled   = false;

            textBox1.Focus();
            textBox2.Focus();
            textBox3.Focus();
            textBox4.Focus();
            textBox6.Focus();
        }
コード例 #25
0
        public virtual void PerformAction(ActionType action)
        {
            if (CurrencyManager == null && CurrencyManager.Count > 0)
            {
                return;
            }
            switch (action)
            {
            case ActionType.None:
                break;

            case ActionType.First:
                CurrencyManager.Position = 0;
                break;

            case ActionType.Prev:
                if (CurrencyManager.Position > 0)
                {
                    CurrencyManager.Position--;
                }
                break;

            case ActionType.Next:
                if (CurrencyManager.Position < CurrencyManager.Count - 1)
                {
                    CurrencyManager.Position++;
                }
                break;

            case ActionType.Last:
                CurrencyManager.Position = CurrencyManager.Count - 1;
                break;

            case ActionType.Add:
                CurrencyManager.AddNew();
                break;

            case ActionType.Delete:
                CurrencyManager.RemoveAt(CurrencyManager.Position);
                break;

            case ActionType.EndEdit:
                CurrencyManager.EndCurrentEdit();
                break;

            case ActionType.CancelEdit:
                CurrencyManager.CancelCurrentEdit();
                break;

            default:
                throw new NotSupportedException();
            }
        }
コード例 #26
0
        private void button2_Click(object sender, EventArgs e)
        {
            phanbiet              = 1;
            tbxmasanpham1.Text    = "";
            tbxtensanpham1.Text   = "";
            numupdowsoluong.Value = 0;
            sanpham.AddNew();
            SqlCommand cmm = new SqlCommand("SELECT dbo.fu_createMASP()", ModuleDB.cnn);

            ModuleDB.cnn.Open();
            tbxmasanpham1.Text = cmm.ExecuteScalar().ToString();
            ModuleDB.cnn.Close();
        }
コード例 #27
0
        private void newCat_Click(object sender, EventArgs e)
        {
            bmb.AddNew();
            newCat.Enabled    = false;
            updateCat.Enabled = false;
            deleteCAt.Enabled = false;
            printOne.Enabled  = false;
            printAll.Enabled  = false;
            addCat.Enabled    = true;
            int id = Convert.ToInt32(dt.Rows[dt.Rows.Count - 1][0]) + 1;

            id_cat.Text = id.ToString();
            desk_cat.Focus();
        }
コード例 #28
0
        private void btnNew_Click(object sender, EventArgs e)
        {
            bmb.AddNew();
            btnNew.Enabled    = false;
            btnAdd.Enabled    = true;
            btnDelete.Enabled = false;
            btnEdit.Enabled   = false;

            int id = Convert.ToInt32(dt.Rows[dt.Rows.Count][0]) + 1;

            textID.Text = id.ToString();
            textDescription.Focus();
            textDescription.Enabled = true;
        }
コード例 #29
0
ファイル: Provider.cs プロジェクト: ZAIDKALINI/OptiqueProject
        private void BtnNew_Click(object sender, EventArgs e)
        {
            int ind = dataGridView1.Rows.Count - 1;

            bmb.AddNew();
            try
            {
                foreach (var c in groupBox1.Controls)
                {
                    if (c is TextBox)
                    {
                        var text = (TextBox)c;
                        text.Text      = "-";
                        text.ForeColor = Color.DarkGray;
                        text.TextAlign = HorizontalAlignment.Center;
                    }
                }
                txtId.ForeColor    = Color.Black;
                txtId.Text         = (Convert.ToInt32(dataGridView1.Rows[ind].Cells[0].Value) + 1).ToString();
                txtId.Text         = data.GetData("getProviderId", null).Rows[0][0].ToString();
                btn_add.Enabled    = true;
                btnNew.Enabled     = false;
                lblPos.Text        = bmb.Position + 1 + "/" + bmb.Count;
                txtNomF.Text       = "-";
                txtNomF.ForeColor  = Color.DarkGray;
                txtTele1.Text      = "-";
                txtTele1.ForeColor = Color.DarkGray;
                txtTele2.Text      = "-";
                txtTele2.ForeColor = Color.DarkGray;
                txtEmail.Text      = "-";
                txtEmail.ForeColor = Color.DarkGray;
            }
            catch
            {
                txtId.Text         = data.GetData("getProviderId", null).Rows[0][0].ToString();
                btn_add.Enabled    = true;
                btnNew.Enabled     = false;
                lblPos.Text        = bmb.Position + 1 + "/" + bmb.Count;
                txtNomF.Text       = "-";
                txtNomF.ForeColor  = Color.DarkGray;
                txtTele1.Text      = "-";
                txtTele1.ForeColor = Color.DarkGray;
                txtTele2.Text      = "-";
                txtTele2.ForeColor = Color.DarkGray;
                txtEmail.Text      = "-";
                txtEmail.ForeColor = Color.DarkGray;
                return;
            }
        }
コード例 #30
0
 private void btnNew_Click(object sender, EventArgs e)
 {
     try
     {
         BMB.AddNew();
         btnNew.Enabled = false;
         btnAdd.Enabled = true;
         int ID = Convert.ToInt32(DT.Rows[DT.Rows.Count - 1][0]) + 1;
         txtID.Text = ID.ToString();
         txtDes.Focus();
     }
     catch
     {
         MessageBox.Show("حدث خطأ ما", "خطأ", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }