コード例 #1
0
 public frmBienLaiThuTien_Tree()
 {
     InitializeComponent();
     oBTC_BienLaiThuTien         = new cBTC_BienLaiThuTien();
     pTC_BienLaiThuTienInfo      = new TC_BienLaiThuTienInfo();
     oBTC_BienLaiThuTien_ChiTiet = new cBTC_BienLaiThuTien_ChiTiet();
     oBSV_SinhVien_Lop           = new cBSV_SinhVien_Lop();
     oBTC_DinhMuc = new cBTC_DinhMucThuSinhVien();
     clsStrHelper = new Lib.clsStringHelper();
     oBNamHoc     = new cBDM_NamHoc();
     pNamHocInfo  = new DM_NamHocInfo();
     oBDM_Lop     = new cBDM_Lop();
 }
コード例 #2
0
        private void btnInDanhSach_Click(object sender, EventArgs e)
        {
            if (cmbLoaiThuChi.EditValue != null && grvTongHop.DataRowCount > 0)
            {
                DataTable dtReport = dtTongHop.Copy();
                dtReport.Columns.Add("TenLoaiThuChi", typeof(string));
                dtReport.Columns.Add("NoiDungBaoCao", typeof(string));
                dtReport.Columns.Add("HeTrinhDo", typeof(string));
                dtReport.Columns.Add("TongTienBangChu", typeof(string));
                dtReport.Rows[0]["TenLoaiThuChi"] = cmbLoaiThuChi.Text.ToUpper();
                if (rdDanhSach.EditValue.ToString() == "0")
                {
                    dtReport.Rows[0]["NoiDungBaoCao"] = "Từ " + dtpTuNgay.Text + " đến " + dtpDenNgay.Text;
                }
                else if (rdDanhSach.EditValue.ToString() == "1")
                {
                    dtReport.Rows[0]["NoiDungBaoCao"] = "Học kỳ: " + Program.HocKy.ToString() + " -  Năm học: " + Program.NamHoc;
                }
                else
                {
                    dtReport.Rows[0]["NoiDungBaoCao"] = "Năm học: " + Program.NamHoc;
                }
                string HeTrinhDo = "";
                if (ucLocHeTrinhDo.cmbHe.EditValue != null)
                {
                    HeTrinhDo = "HỆ: " + ucLocHeTrinhDo.cmbHe.Text.ToUpper();
                }
                if (ucLocHeTrinhDo.cmbTrinhDo.EditValue != null)
                {
                    HeTrinhDo += (HeTrinhDo == "" ? "TRÌNH ĐỘ: " : " - TRÌNH ĐỘ: ") + ucLocHeTrinhDo.cmbTrinhDo.Text.ToUpper();
                }
                if (cmbCoSo.EditValue != null)
                {
                    HeTrinhDo += (HeTrinhDo == "" ? "TẠI: " : " - TẠI: ") + cmbCoSo.Text.ToUpper();
                }
                dtReport.Rows[0]["HeTrinhDo"] = HeTrinhDo;
                Lib.clsStringHelper cls = new Lib.clsStringHelper();
                dtReport.Rows[dtReport.Rows.Count - 1]["TongTienBangChu"] = cls.ReadMoney(TongThu) + " đồng.";

                frmReport frm = new frmReport(dtReport, dtReport, "rBangKeThuChi", "rBangTongHopThuChi", new string[] { "Subreport1" });
                frm.Show();
            }
            else
            {
                ThongBao("Chưa chọn loại thu chi.");
            }
        }
コード例 #3
0
        private void btnInDanhSach_Click(object sender, EventArgs e)
        {
            dlgLopFilter dlg = new dlgLopFilter();

            if (dlg.ShowDialog() == DialogResult.Yes)
            {
                DM_LopInfo pDM_LopFilterInfo = dlg.pDM_LopInfo;
                DataTable  dtMain            = oBTC_DanhSachHocBong.GetInSinhVienByKyTruoc(pDM_LopFilterInfo, Program.IDNamHoc,
                                                                                           Program.HocKy, Program.NamHoc, int.Parse(cmbThang.Text));
                if (dtMain.Rows.Count > 0)
                {
                    dtMain.Columns.Add("Thang", typeof(string));
                    dtMain.Columns.Add("TenNam", typeof(string));
                    dtMain.Columns.Add("HeTrinhDo", typeof(string));
                    dtMain.Columns.Add("TongTienBangChu", typeof(string));
                    dtMain.Rows[0]["Thang"] = cmbThang.Text;
                    if (7 <= int.Parse(cmbThang.Text) && int.Parse(cmbThang.Text) <= 12)
                    {
                        dtMain.Rows[0]["TenNam"] = Program.NamHoc.Substring(0, 4);
                    }
                    else
                    {
                        dtMain.Rows[0]["TenNam"] = Program.NamHoc.Substring(5);
                    }
                    double SoTien           = double.Parse(dtMain.Compute("Sum(SoTienConLai)", "").ToString());
                    Lib.clsStringHelper cls = new Lib.clsStringHelper();
                    dtMain.Rows[dtMain.Rows.Count - 1]["TongTienBangChu"] = cls.ReadMoney(SoTien);

                    dtMain.Rows[0]["HeTrinhDo"] = dlg.HeTrinhDo;
                    frmReport frm = new frmReport(dtMain, dtMain, "rDanhSachHocBong_ChiTiet", "rDanhSachHocBong_BangKe", new string[] { "Subreport1" });
                    frm.ShowDialog();
                }
                else
                {
                    ThongBao("Không có dữ liệu để in báo cáo!");
                }
            }
        }
コード例 #4
0
        private void btnLapTaiKhoan_Click(object sender, EventArgs e)
        {
            if (!CheckValid())
            {
                ThongBao("Bạn phải nhập mật khẩu mặc định cho Giáo viên.");
                return;
            }
            if (dtGiaoVien != null && dtGiaoVien.Rows.Count > 0)
            {
                Lib.clsVietToEn     clsConvert = new Lib.clsVietToEn();
                Lib.clsStringHelper clsString  = new Lib.clsStringHelper();

                /*
                 * if (cmbTenDangNhap.SelectedIndex == 0)
                 * {
                 *  string strTenVietTats = "";
                 *  // Tên đăng nhập là Tên viết tắt của GV
                 *  foreach (DataRow dr in dtGiaoVien.Rows)
                 *  {
                 *      strTenVietTats += clsString.FormatTenVietTat(dr["HoTen"].ToString()) + ";";
                 *  }
                 *  strTenVietTats = clsConvert.ConvertVietToEn(strTenVietTats.Remove(strTenVietTats.Length - 1)).ToLower();
                 *  string[] arrStr = strTenVietTats.Split(';');
                 *  for (int i = 0; i < dtGiaoVien.Rows.Count; i++)
                 *  {
                 *      dtGiaoVien.Rows[i]["Username"] = arrStr[i];
                 *      if (cmbMatKhau.SelectedIndex < 0)
                 *          dtGiaoVien.Rows[i]["Password"] = Lib.clsAuthentication.Encrypt(txtMatKhau.Text.Trim());
                 *      else
                 *          dtGiaoVien.Rows[i]["Password"] = Lib.clsAuthentication.Encrypt(dtGiaoVien.Rows[i]["MaGiaoVien"].ToString() + txtMatKhau.Text.Trim());
                 *  }
                 * }
                 * else
                 * {
                 *  foreach (DataRow dr in dtGiaoVien.Rows)
                 *  {
                 *      dr["Username"] = dr["MaGiaoVien"];
                 *      if (cmbMatKhau.SelectedIndex < 0)
                 *          dr["Password"] = Lib.clsAuthentication.Encrypt(txtMatKhau.Text.Trim());
                 *      else
                 *          dr["Password"] = Lib.clsAuthentication.Encrypt(dr["MaGiaoVien"].ToString() + txtMatKhau.Text.Trim());
                 *  }
                 * }
                 */

                int    selectedIndex = grvGiaoVien.GetSelectedRows()[0];
                string userName      = "";

                if (cmbTenDangNhap.SelectedIndex == 0)
                {
                    // Tên đăng nhập là Tên viết tắt của GV
                    userName += clsString.FormatTenVietTat(dtGiaoVien.Rows[selectedIndex]["HoTen"].ToString());
                    userName  = clsConvert.ConvertVietToEn(userName).ToLower();

                    grvGiaoVien.GetDataRow(selectedIndex)["Username"] = userName;
                }
                else
                {
                    grvGiaoVien.GetDataRow(selectedIndex)["Username"] = dtGiaoVien.Rows[selectedIndex]["MaGiaoVien"];
                }

                if (cmbMatKhau.SelectedIndex < 0)
                {
                    grvGiaoVien.GetDataRow(selectedIndex)["Password"] =
                        Lib.clsAuthentication.Encrypt(txtMatKhau.Text.Trim());
                }
                else
                {
                    grvGiaoVien.GetDataRow(selectedIndex)["Password"] =
                        Lib.clsAuthentication.Encrypt(dtGiaoVien.Rows[selectedIndex]["MaGiaoVien"].ToString() +
                                                      txtMatKhau.Text.Trim());
                }
            }
            else
            {
                ThongBao("Chưa có giáo viên nào để lập mã.");
            }
        }