Example #1
0
        private void btnthem_Click(object sender, EventArgs e)
        {
            try
            {
                var kt = (from s in db.DMTKs
                          where s.MADMTK == txtdanhmuc.Text.ToString()
                          select new
                {
                    s
                });
                if (kt.Count() == 0)
                {
                    DMTK dmtk = new DMTK();
                    dmtk.MADMTK      = txtdanhmuc.Text.ToString();
                    dmtk.LOAITHONGKE = txtloaitk.Text.ToString();

                    db.DMTKs.InsertOnSubmit(dmtk);
                    db.SubmitChanges();
                    us_ThemDMTK_Load(sender, e);
                    MessageBox.Show("thành công");
                }
                else
                {
                    MessageBox.Show("trùng khóa chính");
                }
            }
            catch
            {
                MessageBox.Show("xay ra loi");
            }
        }
Example #2
0
        public void showFormDanhMuc(string nameTag)
        {
            k++;
            Form frm = null;

            switch (nameTag)
            {
                #region Danh Muc Chung
            case "DMDT":
            {
                frm = new DMDT
                {
                    Text = "Danh mục đối tượng"
                };
                break;
            }

            case "DMKHO":
            {
                frm = new DMKHO
                {
                    Text = "Danh mục kho"
                };
                break;
            }

            case "DMKM":
            {
                frm = new DMKM
                {
                    Text = "Danh mục khoản mục"
                };
                break;
            }

            case "DMKV":
            {
                frm = new DMKV
                {
                    Text = "Danh mục khu vực"
                };
                break;
            }

            case "DMNHCCDC":
            {
                frm = new DMNHCCDC
                {
                    Text = "Danh mục nhóm công cụ dụng cụ"
                };
                break;
            }

            case "DMNDT":
            {
                frm = new DMNHDT
                {
                    Text = "Danh mục nhóm đối tượng"
                };
                break;
            }

            case "DMNHNV":
            {
                frm = new DMNHNV
                {
                    Text = "Danh mục nhóm nhân viên"
                };
                break;
            }

            case "DMNHSP":
            {
                frm = new DMNHSP
                {
                    Text = "Danh mục nhóm sản phẩm"
                };
                break;
            }

            case "DMNHVT":
            {
                frm = new DMNHVT
                {
                    Text = "Danh mục nhóm vật tư"
                };
                break;
            }

            case "DMNV":
            {
                frm = new DMNV
                {
                    Text = "Danh mục nhóm vật tư"
                };
                break;
            }

            case "DMNVU":
            {
                frm = new DMNVU
                {
                    Text = "Danh mục nghiệp vụ"
                };
                break;
            }

            case "DMTK":
            {
                frm = new DMTK
                {
                    Text = "Danh mục tài khoản"
                };
                break;
            }

            case "DMVT":
            {
                frm = new DMVT
                {
                    Text = "Danh mục vật tư"
                };
                break;
            }

            case "DMVTTS":
            {
                frm = new DMVTTS
                {
                    Text = "Danh mục vật tư tài sản"
                };
                break;
            }
                #endregion

                #region BanHangPhaiThu
            case "bcmh":
            {
                frm = new FBaoCaoMuaHang("bcmh")
                {
                    Text = "Báo cáo bán hàng"
                };
                break;
            }

            case "HDBH":
            {
                frm = new FBanHangPhaiThu
                {
                    Text = "Bán hàng phải thu"
                };
                break;
            }
                #endregion

                #region CpGiaThanh
            case "tgtp":
            {
                frm = new FKhaiBaoDinhMucSp();
                break;
            }
                #endregion

                #region HangTonKho.PhieuNhapThanhPham
            case "PNHAPTP":
            {
                frm = new FrPhieuNhapThanhPham
                {
                    Text = "Phiếu nhập thành phẩm"
                };
                break;
            }
                #endregion

                #region VonBangTien.PhieuThuChi
            case "PT":
            {
                frm = new FormPhieuThu("PT")
                {
                    Text = "Phiếu thu"
                };
                break;
            }

            case "PC":
            {
                frm = new FormPhieuThu("PC")
                {
                    Text = "Phiếu chi"
                };
                break;
            }

            case "BC":
            {
                frm = new FormPhieuThu("BC")
                {
                    Text = "Báo có ngân hàng"
                };
                break;
            }

            case "BN":
            {
                frm = new FormPhieuThu("BN")
                {
                    Text = "Báo nợ ngân hàng"
                };
                break;
            }
                #endregion
            }
            if (frm != null)
            {
                frm.Show();
                Hide();
            }
        }