Beispiel #1
0
        public bool CapNhat(ComboBoxEx comboBoxEx_NienHoc, DateTimeInput dateTimeInput_DauNam, DateTimeInput dateTimeInput_Dau_HK1, DateTimeInput dateTimeInput_Cuoi_HK1, DateTimeInput dateTimeInput_Dau_HK2, DateTimeInput dateTimeInput_Cuoi_HK2, DateTimeInput dateTimeInput_CuoiNam)
        {
            bool ok = false;

            // cập nhật thời gian bắt đầu và kết thúc niên học
            nienHocInfo = new NienHocInfo(comboBoxEx_NienHoc.SelectedValue.ToString(), comboBoxEx_NienHoc.Text, dateTimeInput_DauNam.Value, dateTimeInput_CuoiNam.Value);
            ok          = nienHocData.CapNhat(nienHocInfo) >= 0;

            // cập nhật những mốc thời gian từng học kỳ
            HocKyInfo hocKy1 = new HocKyInfo();

            hocKy1.MaNienhoc       = comboBoxEx_NienHoc.SelectedValue.ToString();
            hocKy1.ThoiGianBatDau  = dateTimeInput_Dau_HK1.Value;
            hocKy1.ThoiGianKetThuc = dateTimeInput_Cuoi_HK1.Value;

            HocKyInfo hocKy2 = new HocKyInfo();

            hocKy2.MaNienhoc       = comboBoxEx_NienHoc.SelectedValue.ToString();
            hocKy2.ThoiGianBatDau  = dateTimeInput_Dau_HK2.Value;
            hocKy2.ThoiGianKetThuc = dateTimeInput_Cuoi_HK2.Value;

            ok = ok && hocKyData.CapNhatHocKy(hocKy1, hocKy2);

            return(ok);
        }
Beispiel #2
0
        public void HienThi(DataGridViewX dGV,
                            BindingNavigator bN,
                            TextBoxX txtMaNhanVien,
                            TextBoxX txtTenNhanVien,
                            TextBoxX txtGioiTinh,
                            RadioButton opbNam,
                            RadioButton opbNu,
                            DateTimeInput dtpNgaySinh,

                            ComboBoxEx cmbChucVu)
        {
            BindingSource bS = new BindingSource();

            bS.DataSource = m_NhanVienData.LayDsNhanVien();

            txtMaNhanVien.DataBindings.Clear();
            txtMaNhanVien.DataBindings.Add("Text", bS, "MaNhanVien");

            txtTenNhanVien.DataBindings.Clear();
            txtTenNhanVien.DataBindings.Add("Text", bS, "TenNhanVien");

            dtpNgaySinh.DataBindings.Clear();
            dtpNgaySinh.DataBindings.Add("Value", bS, "NgaySinh");

            txtGioiTinh.DataBindings.Clear();
            txtGioiTinh.DataBindings.Add("Text", bS, "GioiTinh");


            cmbChucVu.DataBindings.Clear();
            cmbChucVu.DataBindings.Add("SelectedValue", bS, "MaChucVu");

            bN.BindingSource = bS;
            dGV.DataSource   = bS;
        }
Beispiel #3
0
 public void HienThiBieuDoThoiGian(ComboBoxEx comboBoxEx_NienHoc, DateTimeInput dateTimeInput_DauNam, DateTimeInput dateTimeInput_Dau_HK1, DateTimeInput dateTimeInput_Cuoi_HK1, DateTimeInput dateTimeInput_Dau_HK2, DateTimeInput dateTimeInput_Cuoi_HK2, DateTimeInput dateTimeInput_CuoiNam)
 {
     if (comboBoxEx_NienHoc.SelectedIndex >= 0)
     {
         nienHocInfo = this.LayNienhoc(comboBoxEx_NienHoc.SelectedValue.ToString());
         HocKyInfo[] hocKyInfoArray = this.LayThongTinHocKy(comboBoxEx_NienHoc.SelectedValue.ToString());
         if (nienHocInfo != null)
         {
             dateTimeInput_DauNam.Value  = nienHocInfo.ThoiGianBatDau;
             dateTimeInput_CuoiNam.Value = nienHocInfo.ThoiGianKetThuc;
             if (hocKyInfoArray.Length == 2)
             {
                 dateTimeInput_Dau_HK1.Value  = hocKyInfoArray[0].ThoiGianBatDau;
                 dateTimeInput_Cuoi_HK1.Value = hocKyInfoArray[0].ThoiGianKetThuc;
                 dateTimeInput_Dau_HK2.Value  = hocKyInfoArray[1].ThoiGianBatDau;
                 dateTimeInput_Cuoi_HK2.Value = hocKyInfoArray[1].ThoiGianKetThuc;
             }
         }
     }
     else
     {
         dateTimeInput_DauNam.Visible   = false;
         dateTimeInput_Dau_HK1.Visible  = false;
         dateTimeInput_Cuoi_HK1.Visible = false;
         dateTimeInput_Dau_HK2.Visible  = false;
         dateTimeInput_Cuoi_HK2.Visible = false;
         dateTimeInput_CuoiNam.Visible  = false;
     }
 }
        public void HienThi(DataGridViewX dGV,
                            BindingNavigator bN,
                            DateTimeInput dtNgayCapNhat,
                            TextBoxX txtSoDuDauNgay,
                            TextBoxX txtSoPhatSinhNo,
                            TextBoxX txtSoPhatSinhCo,
                            ComboBoxEx cmbSoHieuTaiKhoan)
        {
            BindingSource bS = new BindingSource();

            bS.DataSource = m_TaiKhoanData.LayTaiKhoan();

            txtSoDuDauNgay.DataBindings.Clear();
            txtSoDuDauNgay.DataBindings.Add("Text", bS, "SoDuDauNgay");

            txtSoPhatSinhNo.DataBindings.Clear();
            txtSoPhatSinhNo.DataBindings.Add("Text", bS, "SoPhatSinhNo");

            txtSoPhatSinhCo.DataBindings.Clear();
            txtSoPhatSinhCo.DataBindings.Add("Text", bS, "SoPhatSinhCo");

            dtNgayCapNhat.DataBindings.Clear();
            dtNgayCapNhat.DataBindings.Add("Value", bS, "NgayCapNhat");

            cmbSoHieuTaiKhoan.DataBindings.Clear();
            cmbSoHieuTaiKhoan.DataBindings.Add("SelectedValue", bS, "SoHieuTaiKhoan");


            bN.BindingSource = bS;
            dGV.DataSource   = bS;
        }
Beispiel #5
0
        /// <summary>
        /// 签订日期值改变事件
        /// Created:20170414(ChengMengjia)
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dtSignDate_ValueChanged(object sender, EventArgs e)
        {
            DateTimeInput dt = (DateTimeInput)sender;

            dtStart.Value  = dt.Value;
            dtTStart.Value = dt.Value;
        }
Beispiel #6
0
        public void HienThi(DataGridViewX dGV,
                            BindingNavigator bN,
                            TextBoxX txtMaHocSinh,
                            TextBoxX txtTenHocSinh,
                            TextBoxX txtGioiTinh,
                            DateTimeInput dtpNgaySinh,
                            TextBoxX txtNoiSinh
                            )
        {
            BindingSource bS = new BindingSource();

            bS.DataSource = m_HocSinhData.LayDsHocSinh();

            txtMaHocSinh.DataBindings.Clear();

            txtTenHocSinh.DataBindings.Clear();

            txtGioiTinh.DataBindings.Clear();

            dtpNgaySinh.DataBindings.Clear();

            txtNoiSinh.DataBindings.Clear();

            bN.BindingSource = bS;
            dGV.DataSource   = bS;
        }
Beispiel #7
0
        public void HienThi(DataGridViewX dGV,
                            BindingNavigator bN,
                            TextBoxX txtMaNV,
                            TextBoxX txtHoTen,
                            DateTimeInput dtNgaySinh,
                            TextBoxX txtDiaChi,
                            TextBoxX txtSoDienThoai,
                            ComboBoxEx cmbQuayGiaoDich)
        {
            BindingSource bS = new BindingSource();

            bS.DataSource = m_NhanVienData.LayNhanVien();

            txtMaNV.DataBindings.Clear();
            txtMaNV.DataBindings.Add("Text", bS, "MaNV");

            txtHoTen.DataBindings.Clear();
            txtHoTen.DataBindings.Add("Text", bS, "HoTenNV");

            txtSoDienThoai.DataBindings.Clear();
            txtSoDienThoai.DataBindings.Add("Text", bS, "DienThoai");

            dtNgaySinh.DataBindings.Clear();
            dtNgaySinh.DataBindings.Add("Value", bS, "NgaySinh");

            txtDiaChi.DataBindings.Clear();
            txtDiaChi.DataBindings.Add("Text", bS, "DiaChi");

            cmbQuayGiaoDich.DataBindings.Clear();
            cmbQuayGiaoDich.DataBindings.Add("SelectedValue", bS, "MaQuayGiaoDich");


            bN.BindingSource = bS;
            dGV.DataSource   = bS;
        }
Beispiel #8
0
        public void HienThi(DataGridViewX dGV,
                            BindingNavigator bN,
                            TextBoxX txtMaPhieu,
                            TextBoxX txtMaMH,
                            TextBoxX txtTenMH,
                            DateTimeInput dtNgayNhap,
                            TextBoxX txtSoLuong,
                            TextBoxX txtDonGia,
                            TextBoxX txtGiaBan,
                            TextBoxX txtMaNCC,
                            ComboBoxEx cmbTenNCC,
                            ComboBoxEx cmbLoaiGiaoDich,
                            ComboBoxEx cmbLoaiTienGui)
        {
            BindingSource bS = new BindingSource();

            bS.DataSource = m_MatHangData.LayMatHang();

            txtMaPhieu.DataBindings.Clear();
            txtMaPhieu.DataBindings.Add("Text", bS, "MaPhieu");

            txtMaMH.DataBindings.Clear();
            txtMaMH.DataBindings.Add("Text", bS, "MaMH");

            txtTenMH.DataBindings.Clear();
            txtTenMH.DataBindings.Add("Text", bS, "TenMH");

            dtNgayNhap.DataBindings.Clear();
            dtNgayNhap.DataBindings.Add("Value", bS, "NgayNhap");

            txtSoLuong.DataBindings.Clear();
            txtSoLuong.DataBindings.Add("Text", bS, "SoLuong");

            txtDonGia.DataBindings.Clear();
            txtDonGia.DataBindings.Add("Text", bS, "DonGia");


            txtGiaBan.DataBindings.Clear();
            txtGiaBan.DataBindings.Add("Text", bS, "GiaBan");

            txtMaNCC.DataBindings.Clear();
            txtMaNCC.DataBindings.Add("Text", bS, "MaNCC");

            cmbLoaiGiaoDich.DataBindings.Clear();
            cmbLoaiGiaoDich.DataBindings.Add("SelectedValue", bS, "MaLoaiGiaoDich");



            cmbTenNCC.DataBindings.Clear();
            cmbTenNCC.DataBindings.Add("SelectedValue", bS, "MaNCC");

            cmbLoaiTienGui.DataBindings.Clear();
            cmbLoaiTienGui.DataBindings.Add("SelectedValue", bS, "MaLoaiTien");

            bN.BindingSource = bS;
            dGV.DataSource   = bS;
        }
Beispiel #9
0
        /// <summary>
        /// 选择时间
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void dt_UseTime_TextChanged(object sender, EventArgs e)
        {
            DateTimeInput input = (DateTimeInput)sender;

            if (input.Value.Hour == 0)
            {
                input.Value = Convert.ToDateTime(input.Value.ToString("yyyy-MM-dd") + DateTime.Now.ToString(" HH:mm:ss"));
            }
        }
Beispiel #10
0
        /// <summary>
        /// 设置默认值
        /// </summary>
        /// <param name="control"></param>

        public virtual void SetDefaultValueToControls(Control control)
        {
            foreach (Control ctrl in control.Controls)
            {
                if (ctrl is Panel)
                {
                    if (ctrl.Controls.Count > 0)
                    {
                        SetDefaultValueToControls(ctrl);
                    }
                }
                if (ctrl is LayoutControl)
                {
                    if (ctrl.Controls.Count > 0)
                    {
                        SetDefaultValueToControls(ctrl);
                    }
                }
                else if (ctrl is TextBox)
                {
                    if (ctrl is TextBoxX)
                    {
                        TextBoxX textBox     = ctrl as TextBoxX;
                        var      controlName = GetRuleName(textBox.Name);
                        if (controlName.Equals("Code"))
                        {
                            textBox.ReadOnly  = true;
                            textBox.ForeColor = Color.Red;
                            if (Id <= 0)
                            {
                                textBox.WatermarkText = GlobleParamters.DefaultCode;
                                textBox.Text          = GlobleParamters.DefaultCode;
                            }
                        }
                    }
                }
                else if (ctrl is DateTimeInput)//默认时间
                {
                    var           key   = GetRuleName(ctrl.Name);
                    DateTimeInput input = (ctrl as DateTimeInput);
                    input.Value = DateTime.Now;
                }
                else if (ctrl is CheckBoxX)//默认选中
                {
                    var key = GetRuleName(ctrl.Name);
                    (ctrl as CheckBoxX).Checked = true;
                }
                else if (ctrl is IntegerInput)
                {
                    (ctrl as IntegerInput).Value = 1;
                }
                else if (ctrl is DoubleInput)
                {
                    (ctrl as DoubleInput).Value = 1;
                }
            }
        }
        private void btnSave_Click(object sender, EventArgs e)
        {
            bool save = true;

            foreach (Control c in this.Controls)
            {
                if (c.GetType() == typeof(TextBoxX))
                {
                    TextBoxX tbx = (c as TextBoxX);
                    if (tbx.Text != String.Empty)
                    {
                        if (_baseData.ContainsKey(tbx.Name))
                        {
                            _baseData[tbx.Name] = tbx.Text;
                        }
                        else
                        {
                            _baseData.Add(tbx.Name, tbx.Text);
                        }
                    }
                    else
                    {
                        MessageBox.Show("Bitte alle Daten vollständig ausfüllen!", "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        save = false;
                        break;
                    }
                }
                if (c.GetType() == typeof(DateTimeInput))
                {
                    DateTimeInput dti = (c as DateTimeInput);
                    if (!dti.IsEmpty)
                    {
                        if (_baseData.ContainsKey(dti.Name))
                        {
                            _baseData[dti.Name] = dti.Value.ToShortDateString();
                        }
                        else
                        {
                            _baseData.Add(dti.Name, dti.Value.ToShortDateString());
                        }
                    }
                    else
                    {
                        MessageBox.Show("Bitte alle Daten vollständig ausfüllen!", "Fehler", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        save = false;
                        break;
                    }
                }
            }
            if (save)
            {
                DataManager.SaveBaseData(_baseData);
                this.ParentForm.DialogResult = System.Windows.Forms.DialogResult.OK;
            }
        }
Beispiel #12
0
 public string GetFormData(DateTimeInput obj, string LogObjName)
 {
     if (string.IsNullOrEmpty(obj.Text))
     {
         return("");
     }
     else
     {
         string str = obj.Value.ToShortDateString();
         _prlp.SetAfterSaveText(LogObjName, str);
         return(str);
     }
 }
Beispiel #13
0
        /// <summary>
        /// 设置默认值
        /// </summary>
        /// <param name="control"></param>

        public virtual void SetDefaulCodeToControls(Control control, string controlName, object value)
        {
            foreach (Control ctrl in control.Controls)
            {
                if (ctrl is Panel)
                {
                    if (ctrl.Controls.Count > 0)
                    {
                        SetDefaulCodeToControls(ctrl, controlName, value);
                    }
                }
                if (ctrl is LayoutControl)
                {
                    if (ctrl.Controls.Count > 0)
                    {
                        SetDefaulCodeToControls(ctrl, controlName, value);
                    }
                }
                else if (ctrl is TextBox)
                {
                    var key = GetRuleName(ctrl.Name);
                    if (ctrl is TextBoxX)
                    {
                        TextBoxX textBox        = ctrl as TextBoxX;
                        var      controllerName = GetRuleName(textBox.Name);
                        if (controllerName.Equals(controlName))
                        {
                            textBox.Text = value.ToString();
                        }
                    }
                }
                else if (ctrl is DateTimeInput)//默认时间
                {
                    DateTimeInput input = (ctrl as DateTimeInput);
                    input.Value = DateTime.Now;
                }
                else if (ctrl is CheckBoxX)//默认选中
                {
                    (ctrl as CheckBoxX).Checked = true;
                }
                else if (ctrl is IntegerInput)
                {
                    (ctrl as IntegerInput).Value = 1;
                }
                else if (ctrl is DoubleInput)
                {
                    (ctrl as DoubleInput).Value = 1;
                }
            }
        }
Beispiel #14
0
        public void HienThi(DataGridViewX dGV,
                            BindingNavigator bN,
                            TextBoxX txtMaPhieu,
                            DateTimeInput dtNgayXuat,
                            TextBoxX txtSoLuong,
                            TextBoxX txtGiaBan,
                            TextBoxX txtThanhTien,
                            ComboBoxEx cmbTenMH,
                            ComboBoxEx cmbTenKH,
                            ComboBoxEx cmbTenNV,
                            ComboBoxEx cmbLoaiGiaoDich,
                            ComboBoxEx cmbLoaiTienGui)
        {
            BindingSource bS = new BindingSource();

            bS.DataSource = m_XuatHangData.LayXuatHang();

            txtMaPhieu.DataBindings.Clear();
            txtMaPhieu.DataBindings.Add("Text", bS, "MaPhieu");

            dtNgayXuat.DataBindings.Clear();
            dtNgayXuat.DataBindings.Add("Value", bS, "NgayXuat");

            txtSoLuong.DataBindings.Clear();
            txtSoLuong.DataBindings.Add("Text", bS, "SoLuong");

            txtGiaBan.DataBindings.Clear();
            txtGiaBan.DataBindings.Add("Text", bS, "GiaBan");

            txtThanhTien.DataBindings.Clear();
            txtThanhTien.DataBindings.Add("Text", bS, "ThanhTien");

            cmbLoaiGiaoDich.DataBindings.Clear();
            cmbLoaiGiaoDich.DataBindings.Add("SelectedValue", bS, "MaLoaiGiaoDich");

            cmbTenMH.DataBindings.Clear();
            cmbTenMH.DataBindings.Add("SelectedValue", bS, "MaMH");

            cmbTenKH.DataBindings.Clear();
            cmbTenKH.DataBindings.Add("SelectedValue", bS, "MaKH");

            cmbTenNV.DataBindings.Clear();
            cmbTenNV.DataBindings.Add("SelectedValue", bS, "MaNV");

            cmbLoaiTienGui.DataBindings.Clear();
            cmbLoaiTienGui.DataBindings.Add("SelectedValue", bS, "MaLoaiTien");

            bN.BindingSource = bS;
            dGV.DataSource   = bS;
        }
Beispiel #15
0
        public void HienThi(DataGridViewX dGV,
                            BindingNavigator bN,
                            TextBoxX txtMaHocSinh,
                            TextBoxX txtTenHocSinh,
                            TextBoxX txtGioiTinh,
                            CheckBoxX ckbGTinhNam,
                            CheckBoxX ckbGTinhNu,
                            DateTimeInput dtpNgaySinh,
                            TextBoxX txtEmail,
                            TextBoxX txtDiaChi)
        {
            BindingSource bS = new BindingSource();

            bS.DataSource = m_HocSinhData.LayDsHocSinh();

            DataTable dT       = m_HocSinhData.LayDsHocSinh();
            bool      gioiTinh = Convert.ToBoolean(dT.Rows[0]["GioiTinh"]);

            if (gioiTinh)
            {
                ckbGTinhNu.Checked = true;
            }
            else
            {
                ckbGTinhNam.Checked = true;
            }

            txtMaHocSinh.DataBindings.Clear();
            txtMaHocSinh.DataBindings.Add("Text", bS, "MaHocSinh");

            txtTenHocSinh.DataBindings.Clear();
            txtTenHocSinh.DataBindings.Add("Text", bS, "HoTen");

            txtGioiTinh.DataBindings.Clear();
            txtGioiTinh.DataBindings.Add("Text", bS, "GioiTinh");

            dtpNgaySinh.DataBindings.Clear();
            dtpNgaySinh.DataBindings.Add("Value", bS, "NgaySinh");

            txtEmail.DataBindings.Clear();
            txtEmail.DataBindings.Add("Text", bS, "Email");

            txtDiaChi.DataBindings.Clear();
            txtDiaChi.DataBindings.Add("Text", bS, "DiaChi");

            bN.BindingSource = bS;
            dGV.DataSource   = bS;
        }
Beispiel #16
0
        public void HienThi(DataGridViewX dGV,
                            BindingNavigator bN,
                            TextBoxX txtMaNguoiDan,
                            TextBoxX txtTenNguoiDan,
                            TextBoxX txtGioiTinh,
                            RadioButton opbNam,
                            RadioButton opbNu,
                            DateTimeInput dtpNgaySinh,
                            ComboBoxEx cmbDanToc,
                            ComboBoxEx cmbTonGiao,
                            ComboBoxEx cmbNgheNghiep,
                            TextBoxX txtTenNguoiDanDK
                            )
        {
            BindingSource bS = new BindingSource();

            bS.DataSource = m_NguoiDanData.LayDsNguoiDan();

            DataTable dT = m_NguoiDanData.LayDsNguoiDan();


            txtMaNguoiDan.DataBindings.Clear();
            txtMaNguoiDan.DataBindings.Add("Text", bS, "MaNguoiDan");

            txtTenNguoiDan.DataBindings.Clear();
            txtTenNguoiDan.DataBindings.Add("Text", bS, "TenNguoiDan");

            dtpNgaySinh.DataBindings.Clear();
            dtpNgaySinh.DataBindings.Add("Value", bS, "NgaySinh");

            txtGioiTinh.DataBindings.Clear();
            txtGioiTinh.DataBindings.Add("Text", bS, "GioiTinh");

            cmbDanToc.DataBindings.Clear();
            cmbDanToc.DataBindings.Add("SelectedValue", bS, "MaDanToc");

            cmbTonGiao.DataBindings.Clear();
            cmbTonGiao.DataBindings.Add("SelectedValue", bS, "MaTonGiao");

            cmbNgheNghiep.DataBindings.Clear();
            cmbNgheNghiep.DataBindings.Add("SelectedValue", bS, "MaNgheNghiep");

            txtTenNguoiDanDK.DataBindings.Clear();
            txtTenNguoiDanDK.DataBindings.Add("Text", bS, "TenNguoiDan");

            bN.BindingSource = bS;
            dGV.DataSource   = bS;
        }
        public FrmUpdateSKP(DateTimeInput sendperiodeawal, string sendjabatan, string sendipaddress, string sendnama,
                            Action setDataSKP, Action setVisibleNotifikasiEditSucces,
                            FrmMenuKelola frmmenukelola, FrmMenuClient frmmenuclient, FrmViewDataSKP frmViewDataSKP)
        {
            InitializeComponent();
            InitializeFunction();

            this.sendjabatan   = sendjabatan;
            this.sendnama      = sendnama;
            this.sendipaddress = sendipaddress;
            this.setVisibleNotifikasiEditSucces = setVisibleNotifikasiEditSucces;
            this.frmmenukelola   = frmmenukelola;
            this.frmmenuclient   = frmmenuclient;
            this.frmViewDataSKP  = frmViewDataSKP;
            this.setDataSKP      = setDataSKP;
            this.sendperiodeawal = sendperiodeawal;
        }
Beispiel #18
0
        /// <summary>
        /// DateTimeInput 用
        /// </summary>
        /// <param name="strValue"></param>
        /// <param name="obj"></param>
        /// <param name="logObjName"></param>
        /// <returns></returns>
        public DateTimeInput SetFormData(string strValue, DateTimeInput obj, string logObjName)
        {
            DateTime dt;

            if (DateTime.TryParse(strValue, out dt))
            {
                obj.Value = dt;
                _prlp.SetBeforeSaveText(logObjName, strValue);
            }
            else
            {
                obj.IsEmpty = true;
                _prlp.SetBeforeSaveText(logObjName, "");
            }

            return(obj);
        }
Beispiel #19
0
        public void RenderTest()
        {
            var dt = new System.DateTime(2008, 11, 15, 10, 2, 45, 234);

            DateTimeInput target = new DateTimeInput();

            Assert.AreEqual("<input type=\"text\" name=\"test\" />",
                            target.Render("test", null));
            Assert.AreEqual("<input type=\"text\" name=\"test\" value=\"2008-11-15 10:02:45\" />",
                            target.Render("test", dt));
            Assert.AreEqual("<input type=\"text\" name=\"test\" />",
                            target.Render("test", 123));

            target.Format = "HH:mm:ss.fff MM/dd/yyyy";
            Assert.AreEqual("<input type=\"text\" name=\"test\" />",
                            target.Render("test", null));
            Assert.AreEqual("<input type=\"text\" name=\"test\" value=\"10:02:45.234 11/15/2008\" />",
                            target.Render("test", dt));
        }
        public void HienThi(DataGridViewX dGV,
                            BindingNavigator bN,
                            TextBoxX txtMaKH,
                            TextBoxX txtHoTen,
                            TextBoxX txtCMND,
                            DateTimeInput dtNgayCap,
                            TextBoxX txtNoiCap,
                            TextBoxX txtDiaChi,
                            TextBoxX txtSoDienThoai
                            )
        {
            BindingSource bS = new BindingSource();

            bS.DataSource = m_KhachHangData.LayKhachHang();

            txtMaKH.DataBindings.Clear();
            txtMaKH.DataBindings.Add("Text", bS, "MaKH");

            txtHoTen.DataBindings.Clear();
            txtHoTen.DataBindings.Add("Text", bS, "HoTen");

            txtCMND.DataBindings.Clear();
            txtCMND.DataBindings.Add("Text", bS, "CMND");

            dtNgayCap.DataBindings.Clear();
            dtNgayCap.DataBindings.Add("Value", bS, "NgayCap");

            txtNoiCap.DataBindings.Clear();
            txtNoiCap.DataBindings.Add("Text", bS, "NoiCap");

            txtDiaChi.DataBindings.Clear();
            txtDiaChi.DataBindings.Add("Text", bS, "DiaChi");

            txtSoDienThoai.DataBindings.Clear();
            txtSoDienThoai.DataBindings.Add("Text", bS, "DienThoai");

            bN.BindingSource = bS;
            dGV.DataSource   = bS;
        }
        public IEnumerable <Shop> Post([FromBody] DateTimeInput dateTime)
        {
            Log.log("Input Value is  : " + dateTime.value);

            DateTime lastDateTime;

            try
            {
                lastDateTime = DateTime.ParseExact(dateTime.value, "dd/MM/yyyy HH:mm:ss", System.Globalization.CultureInfo.CurrentUICulture);

                Log.log("Date found is  : " + lastDateTime.ToString());
            }
            catch (Exception ex)
            {
                Log.log("Could not parse String to Date time found is 1 : ");
                lastDateTime = DateTime.Now;
            }


            try
            {
                var context = new NestinDBEntities();
                var vendor  = (from vend in context.ViewVendors
                               where vend.InsertDate > lastDateTime && vend.SocietyID == dateTime.SocietyID
                               select new Shop()
                {
                    ID = vend.VendorID, VendorName = vend.VendorName, ContactNum = vend.ContactNumber, Address = vend.Address, ShopCategory = vend.ShopCategory
                }
                               );

                return(vendor);
            }
            catch (Exception ex)
            {
                Log.log("Exception Occured at : " + DateTime.Now.ToString() + "----" + ex.Message);
                return(null);
            }
        }
Beispiel #22
0
        public void HienThi(DataGridViewX dGV,
                            BindingNavigator bN,
                            TextBoxX txtMucLaiSuat,
                            DateTimeInput dtNgay,
                            ComboBoxEx cmbMaLoaiTietKiem)
        {
            BindingSource bS = new BindingSource();

            bS.DataSource = m_LaiSuatTietKiemData.LayLaiSuatTietKiem();

            txtMucLaiSuat.DataBindings.Clear();
            txtMucLaiSuat.DataBindings.Add("Text", bS, "MucLaiSuat");

            dtNgay.DataBindings.Clear();
            dtNgay.DataBindings.Add("Value", bS, "Ngay");

            cmbMaLoaiTietKiem.DataBindings.Clear();
            cmbMaLoaiTietKiem.DataBindings.Add("SelectedValue", bS, "MaLoaiTietKiem");


            bN.BindingSource = bS;
            dGV.DataSource   = bS;
        }
Beispiel #23
0
        public void HienThi(DataGridViewX dGV,
                            BindingNavigator bN,
                            TextBoxX txtMaNguoiDan,
                            TextBoxX txtTenNguoiDan,
                            TextBoxX txtGioiTinh,
                            RadioButton opbNam,
                            RadioButton opbNu,
                            DateTimeInput dtpNgaySinh,
                            TextBoxX txtTenNguoiDanDK
                            )
        {
            BindingSource bS = new BindingSource();

            bS.DataSource = m_NguoiDanData.LayDsNguoiDan();

            DataTable dT = m_NguoiDanData.LayDsNguoiDan();


            txtMaNguoiDan.DataBindings.Clear();
            txtMaNguoiDan.DataBindings.Add("Text", bS, "MaNguoiDan");

            txtTenNguoiDan.DataBindings.Clear();
            txtTenNguoiDan.DataBindings.Add("Text", bS, "TenNguoiDan");

            dtpNgaySinh.DataBindings.Clear();
            dtpNgaySinh.DataBindings.Add("Value", bS, "NgaySinh");

            txtGioiTinh.DataBindings.Clear();
            txtGioiTinh.DataBindings.Add("Text", bS, "GioiTinh");


            txtTenNguoiDanDK.DataBindings.Clear();
            txtTenNguoiDanDK.DataBindings.Add("Text", bS, "TenNguoiDan");

            bN.BindingSource = bS;
            dGV.DataSource   = bS;
        }
 public void LoadTabQLDG(ref DataGridViewX dgvDG, ref TextBoxX txtMaDG, ref TextBoxX txtHoTen, ref DateTimeInput dtpNgaySinh, ref TextBoxX txtDiaChi, ref TextBoxX txtEmail, ref ComboBoxEx cbxLoaiDG, ref DateTimeInput dtpNgayLapThe, ref DateTimeInput dtpNgayHetHan, ref TextBoxX txtSoSachDangMuon, ref TextBoxX txtTongTienNo, ref TextBoxX txtTuoiToiThieu, ref TextBoxX txtTuoiToiDa, ref ComboBoxEx cbxTimKiemDG, ref TextBoxX txtThoiHanThe, QDLoaiDocGiaBUS ldgBUS, TheDocGiaBUS tdgBUS, QuyDinhDocGiaBUS qddgBUS)
 {
     LoadListLoaiDG(ref cbxLoaiDG, ldgBUS);
     LoadDgvDG(ref dgvDG, tdgBUS);
     LoadQDDG(ref txtTuoiToiThieu, ref txtTuoiToiDa, ref txtThoiHanThe, qddgBUS);
     if (dgvDG.RowCount != 0)
     {
         GetDataWhenClickDGVDG(dgvDG.Rows[0], ref txtMaDG, ref txtHoTen, ref dtpNgaySinh, ref txtDiaChi, ref txtEmail, ref cbxLoaiDG, ref dtpNgayLapThe, ref dtpNgayHetHan, ref txtSoSachDangMuon, ref txtTongTienNo);//Load data từ datagridview vào panel
     }
     else
     {
         tdgBUS.ResetSTT();
         ClearPanelDG(tdgBUS, ref txtMaDG, ref txtHoTen, ref dtpNgaySinh, ref txtDiaChi, ref txtEmail, ref cbxLoaiDG, ref dtpNgayLapThe, ref dtpNgayHetHan, ref txtSoSachDangMuon, ref txtTongTienNo, ref cbxTimKiemDG);
     }
 }
Beispiel #25
0
        public void HienThi(DataGridViewX dGV,
                            BindingNavigator bN,
                            TextBoxX txtMaSoTK,
                            TextBoxX txtSoButToan,
                            DateTimeInput dtNgayGiaoDich,
                            TextBoxX txtDaDuyet,
                            CheckBoxX cbDaDuyet,
                            CheckBoxX cbChuaDuyet,

                            ComboBoxEx cmbLoaiGiaoDich,
                            ComboBoxEx cmbNhanVien,
                            ComboBoxEx cmbQuayGD,
                            ComboBoxEx cmbPhongGiaoDich)


        {
            BindingSource bS = new BindingSource();

            bS.DataSource = m_PhatSinhTietKiemData.LayPhatSinhTietKiem();

            DataTable dT    = m_PhatSinhTietKiemData.LayPhatSinhTietKiem();
            bool      duyet = Convert.ToBoolean(dT.Rows[0]["DaDuyet"]);

            if (duyet)
            {
                cbDaDuyet.Checked = true;
            }
            else
            {
                cbChuaDuyet.Checked = true;
            }

            txtMaSoTK.DataBindings.Clear();
            txtMaSoTK.DataBindings.Add("Text", bS, "MaSoTietKiem");

            txtSoButToan.DataBindings.Clear();
            txtSoButToan.DataBindings.Add("Text", bS, "SoButToan");

            dtNgayGiaoDich.DataBindings.Clear();
            dtNgayGiaoDich.DataBindings.Add("Value", bS, "NgayGiaoDich");

            txtDaDuyet.DataBindings.Clear();
            txtDaDuyet.DataBindings.Add("Text", bS, "DaDuyet");

            //cmbLoaiGiaoDich.DataBindings.Clear();
            //cmbLoaiGiaoDich.DataBindings.Add("SelectedValue", bS, "MaLoaiGiaoDich");

            //cmbLoaiGiaoDich.DataBindings.Clear();
            //cmbLoaiGiaoDich.DataBindings.Add("SelectedValue", bS, "MaLoaiGiaoDich");

            cmbNhanVien.DataBindings.Clear();
            cmbNhanVien.DataBindings.Add("SelectedValue", bS, "MaNV");

            cmbPhongGiaoDich.DataBindings.Clear();
            cmbPhongGiaoDich.DataBindings.Add("SelectedValue", bS, "MaPhongGiaoDich");

            cmbQuayGD.DataBindings.Clear();
            cmbQuayGD.DataBindings.Add("SelectedValue", bS, "MaQuayGiaoDich");



            bN.BindingSource = bS;
            dGV.DataSource   = bS;
        }
Beispiel #26
0
        public void LayDanhSachNienHoc(DataGridViewX dataGridView, BindingNavigator bindingNav, TextBoxX txtMaNienHoc, ComboBoxEx cmbTenNienHoc, DateTimeInput dateTimeTGBD, DateTimeInput dateTimeTGKT)
        {
            BindingSource bindingSource = new BindingSource();

            bindingSource.DataSource = nienHocData.LayBangNienHoc();
            bindingNav.BindingSource = bindingSource;
            dataGridView.DataSource  = bindingSource;

            // Buộc text box mã niên học vào bindingSource
            txtMaNienHoc.DataBindings.Clear();
            txtMaNienHoc.DataBindings.Add("Text", bindingSource, "ma_nien_hoc");

            // Buộc combobox tên niên học vào bindingSource
            cmbTenNienHoc.DataBindings.Clear();
            cmbTenNienHoc.DataBindings.Add("Text", bindingSource, "ten_nien_hoc");

            // Buộc dateTime thời gian bắt đầu niên học vào bindingSource
            dateTimeTGBD.DataBindings.Clear();
            dateTimeTGBD.DataBindings.Add("Value", bindingSource, "tg_bat_dau", true).FormatString = "dd/MM/yyyy";

            // Buộc dateTime thời gian kết thúc niên học vào bindingSource
            dateTimeTGKT.DataBindings.Clear();
            dateTimeTGKT.DataBindings.Add("Value", bindingSource, "tg_ket_thuc", true).FormatString = "dd/MM/yyyy";
        }
Beispiel #27
0
        public void HienThi(DataGridViewX dGV,
                            BindingNavigator bN,
                            TextBoxX txtMaPhieu,
                            DateTimeInput dtNgayDat,
                            TextBoxX txtSoLuong,
                            TextBoxX txtGiaBan,
                            TextBoxX txtThanhTien,
                            TextBoxX txtGhiChu,
                            CheckBoxX cbThanhToan,
                            ComboBoxEx cmbTenMH,
                            ComboBoxEx cmbTenKH,
                            ComboBoxEx cmbLoaiGiaoDich,
                            ComboBoxEx cmbLoaiTienGui)
        {
            BindingSource bS = new BindingSource();

            bS.DataSource = m_DatHangData.LayDatHang();
            DataTable dT      = m_DatHangData.LayDatHang();
            bool      dathang = Convert.ToBoolean(dT.Rows[0]["ThanhToan"]);

            if (dathang)
            {
                cbThanhToan.Checked = true;
            }
            else
            {
                cbThanhToan.Checked = true;
            }

            txtMaPhieu.DataBindings.Clear();
            txtMaPhieu.DataBindings.Add("Text", bS, "MaPhieu");

            dtNgayDat.DataBindings.Clear();
            dtNgayDat.DataBindings.Add("Value", bS, "NgayDat");

            txtSoLuong.DataBindings.Clear();
            txtSoLuong.DataBindings.Add("Text", bS, "SoLuong");

            txtGiaBan.DataBindings.Clear();
            txtGiaBan.DataBindings.Add("Text", bS, "GiaBan");

            txtThanhTien.DataBindings.Clear();
            txtThanhTien.DataBindings.Add("Text", bS, "ThanhTien");

            txtGhiChu.DataBindings.Clear();
            txtGhiChu.DataBindings.Add("Text", bS, "GhiChu");

            cbThanhToan.DataBindings.Clear();
            cbThanhToan.DataBindings.Add("Checked", bS, "ThanhToan");

            cmbLoaiGiaoDich.DataBindings.Clear();
            cmbLoaiGiaoDich.DataBindings.Add("SelectedValue", bS, "MaLoaiGiaoDich");

            cmbTenMH.DataBindings.Clear();
            cmbTenMH.DataBindings.Add("SelectedValue", bS, "MaMH");

            cmbTenKH.DataBindings.Clear();
            cmbTenKH.DataBindings.Add("SelectedValue", bS, "MaKH");

            cmbLoaiTienGui.DataBindings.Clear();
            cmbLoaiTienGui.DataBindings.Add("SelectedValue", bS, "MaLoaiTien");

            bN.BindingSource = bS;
            dGV.DataSource   = bS;
        }
Beispiel #28
0
        public void HienThi(DataGridViewX dGV,
                            BindingNavigator bN,
                            TextBoxX txtMaSoTietKiem,
                            ComboBoxEx cmbMaLoaiTietKiem,
                            ComboBoxEx cmbMaKH,
                            DateTimeInput dtNgayMoSo,
                            DateTimeInput dtNgayHieuLuc,
                            DateTimeInput dtNgayDenHan,
                            DateTimeInput dtNgayTinhLai,
                            DateTimeInput dtNgayTaiKyGui,
                            TextBoxX txtLaiDaTra,
                            TextBoxX txtLaiNhapVon,
                            DateTimeInput dtNgayNhapVon,
                            TextBoxX txtPhongToa,
                            CheckBoxX cbPhongToa,
                            DateTimeInput dtNgayTatToan)
        {
            BindingSource bS = new BindingSource();

            bS.DataSource = m_SoTietKiemData.LaySoTietKiem();
            DataTable DT       = m_SoTietKiemData.LaySoTietKiem();
            bool      PhongToa = Convert.ToBoolean(DT.Rows[0]["PhongToa"]);

            if (PhongToa)
            {
                cbPhongToa.Checked = true;
            }

            txtMaSoTietKiem.DataBindings.Clear();
            txtMaSoTietKiem.DataBindings.Add("Text", bS, "MaSoTietKiem");

            cmbMaLoaiTietKiem.DataBindings.Clear();
            cmbMaLoaiTietKiem.DataBindings.Add("SelectedValue", bS, "MaLoaiTietKiem");

            cmbMaKH.DataBindings.Clear();
            cmbMaKH.DataBindings.Add("SelectedValue", bS, "MaKH");

            dtNgayMoSo.DataBindings.Clear();
            dtNgayMoSo.DataBindings.Add("Value", bS, "NgayMoSo");

            dtNgayHieuLuc.DataBindings.Clear();
            dtNgayHieuLuc.DataBindings.Add("Value", bS, "NgayHieuLuc");

            dtNgayDenHan.DataBindings.Clear();
            dtNgayDenHan.DataBindings.Add("Value", bS, "NgayDenHan");

            dtNgayTinhLai.DataBindings.Clear();
            dtNgayTinhLai.DataBindings.Add("Value", bS, "NgayTinhLaiGanNhat");

            dtNgayTaiKyGui.DataBindings.Clear();
            dtNgayTaiKyGui.DataBindings.Add("Value", bS, "NgayTaiKyGui");

            txtLaiDaTra.DataBindings.Clear();
            txtLaiDaTra.DataBindings.Add("Text", bS, "LaiDaTra");

            txtLaiNhapVon.DataBindings.Clear();
            txtLaiNhapVon.DataBindings.Add("Text", bS, "LaiNhapVon");

            dtNgayNhapVon.DataBindings.Clear();
            dtNgayNhapVon.DataBindings.Add("Value", bS, "NgayNhapVon");

            cbPhongToa.DataBindings.Clear();
            cbPhongToa.DataBindings.Add("checked", bS, "PhongToa");

            dtNgayTatToan.DataBindings.Clear();
            dtNgayTatToan.DataBindings.Add("Value", bS, "NgayTatToan");

            bN.BindingSource = bS;
            dGV.DataSource   = bS;
        }
        public void ClearPanelDG(TheDocGiaBUS tdgBUS, ref TextBoxX txtMaDG, ref TextBoxX txtHoTen, ref DateTimeInput dtpNgaySinh, ref TextBoxX txtDiaChi, ref TextBoxX txtEmail, ref ComboBoxEx cbxLoaiDG, ref DateTimeInput dtpNgayLapThe, ref DateTimeInput dtpNgayHetHan, ref TextBoxX txtSoSachDangMuon, ref TextBoxX txtTongTienNo, ref ComboBoxEx cbxTimKiemDG)
        {
            txtMaDG.Text  = tdgBUS.GetNewSTT();
            txtHoTen.Text = null;
            DateTime date = new DateTime();

            dtpNgaySinh.Value = date; //DevComponents.Editors.DateTimeAdv.DateTimeInput.DateTimeDefaults;
            txtDiaChi.Text    = null;
            txtEmail.Text     = null;
            try
            {
                cbxLoaiDG.Text = cbxLoaiDG.Items[0].ToString();
            }
            catch
            { }

            dtpNgayLapThe.Value    = date; //DevComponents.Editors.DateTimeAdv.DateTimeInput.DateTimeDefaults;
            dtpNgayHetHan.Value    = date; //DevComponents.Editors.DateTimeAdv.DateTimeInput.DateTimeDefaults;
            txtSoSachDangMuon.Text = "0";
            txtTongTienNo.Text     = "0";
            cbxTimKiemDG.Text      = cbxTimKiemDG.Items[0].ToString();
        }
        public void HienThi(DataGridViewX dGV,
                            BindingNavigator bN,
                            TextBoxX txtMaHocSinh,
                            TextBoxX txtTenHocSinh,
                            TextBoxX txtGioiTinh,
                            CheckBoxX ckbGTinhNam,
                            CheckBoxX ckbGTinhNu,
                            DateTimeInput dtpNgaySinh,
                            TextBoxX txtNoiSinh,
                            ComboBoxEx cmbDanToc,
                            ComboBoxEx cmbTonGiao,
                            TextBoxX txtHoTenCha,
                            ComboBoxEx cmbNgheNghiepCha,
                            TextBoxX txtHoTenMe,
                            ComboBoxEx cmbNgheNghiepMe)
        {
            BindingSource bS = new BindingSource();

            bS.DataSource = m_HocSinhData.LayDsHocSinh();

            DataTable dT       = m_HocSinhData.LayDsHocSinh();
            bool      gioiTinh = Convert.ToBoolean(dT.Rows[0]["GioiTinh"]);

            if (gioiTinh)
            {
                ckbGTinhNu.Checked = true;
            }
            else
            {
                ckbGTinhNam.Checked = true;
            }

            txtMaHocSinh.DataBindings.Clear();
            txtMaHocSinh.DataBindings.Add("Text", bS, "MaHocSinh");

            txtTenHocSinh.DataBindings.Clear();
            txtTenHocSinh.DataBindings.Add("Text", bS, "HoTen");

            txtGioiTinh.DataBindings.Clear();
            txtGioiTinh.DataBindings.Add("Text", bS, "GioiTinh");

            dtpNgaySinh.DataBindings.Clear();
            dtpNgaySinh.DataBindings.Add("Value", bS, "NgaySinh");

            txtNoiSinh.DataBindings.Clear();
            txtNoiSinh.DataBindings.Add("Text", bS, "NoiSinh");

            cmbDanToc.DataBindings.Clear();
            cmbDanToc.DataBindings.Add("SelectedValue", bS, "MaDanToc");

            cmbTonGiao.DataBindings.Clear();
            cmbTonGiao.DataBindings.Add("SelectedValue", bS, "MaTonGiao");

            txtHoTenCha.DataBindings.Clear();
            txtHoTenCha.DataBindings.Add("Text", bS, "HoTenCha");

            cmbNgheNghiepCha.DataBindings.Clear();
            cmbNgheNghiepCha.DataBindings.Add("SelectedValue", bS, "MaNNghiepCha");

            txtHoTenMe.DataBindings.Clear();
            txtHoTenMe.DataBindings.Add("Text", bS, "HoTenMe");

            cmbNgheNghiepMe.DataBindings.Clear();
            cmbNgheNghiepMe.DataBindings.Add("SelectedValue", bS, "MaNNghiepMe");

            bN.BindingSource = bS;
            dGV.DataSource   = bS;
        }