private void capNhatThongTinMuon_Load(object sender, EventArgs e)
        {
            dtpNgayMuon.Format       = DateTimePickerFormat.Custom;
            dtpNgayMuon.CustomFormat = "dd-MM-yyyy";
            dtpNgayTra.Format        = DateTimePickerFormat.Custom;
            dtpNgayTra.CustomFormat  = "dd-MM-yyyy";

            connectSer.Connect();
            connectSer.LoadDataCombobox(cbMaDocGia, "select MADG from tblDocGia");
            connectSer.LoadDataCombobox(cbTenDocGia, "select HOTEN from tblDocGia");
            connectSer.LoadDataListBox(lbMaSach, "select MASACH from tblSach");
            thongTinMuonSer.getAll(dgvThongTinMuon);

            for (int i = 0; i < (dgvThongTinMuon.Rows.Count - 1); i++)
            {
                if (this.dgvThongTinMuon.Rows[i].Cells[0].Value.ToString() != string.Empty)
                {
                    try
                    {
                        string   status    = this.dgvThongTinMuon.Rows[i].Cells[5].Value.ToString();
                        string   deadline  = this.dgvThongTinMuon.Rows[i].Cells[4].Value.ToString();
                        DateTime result    = DateTime.ParseExact(deadline, "dd-MM-yyyy", CultureInfo.InvariantCulture);
                        DateTime localDate = DateTime.Now;
                        if (result.Date < localDate.Date && status.Equals("Chưa trả"))
                        {
                            thongTinMuonSer.updateDeadline(this.dgvThongTinMuon.Rows[i].Cells[0].Value.ToString());
                        }
                    }
                    catch (Exception Ee)
                    {
                        MessageBox.Show(Ee.ToString());
                    }
                }
            }
        }
示例#2
0
文件: SINetwork.cs 项目: zjbsean/TM
                public bool Connect()
                {
                    CloseConnectionService();

                    try
                    {
                        m_connService = new ConnectService(OnRecvServerData,
                                                           OnServerConnectionClose,
                                                           OnOpenNewServerConnection,
                                                           OnOpenConnectionWithSvrInfoFail);
                        //m_connService.RegisterInternalProtocolDealer(InternalProtocolDealer.Instance.Parse);

                        bool result = m_connService.Connect(m_ip, m_port);
                        if (result == true)
                        {
                            SvLogger.Info("Start Connect : Address={0}, Port={1}", m_ip, m_port);
                            return(true);
                        }
                        else
                        {
                            m_connService.Channel.Close();
                            m_connService = null;
                        }
                        return(false);
                    }
                    catch (Exception ex)
                    {
                        SvLogger.Fatal(ex, "OpenConnectionFail : IP={0}, Port={1}, ErrMsg={2}.", m_ip, m_port, ex.Message);
                    }
                    return(false);
                }
        private void capNhatDocGia_Load(object sender, EventArgs e)
        {
            dtpNgaySinh.Format       = DateTimePickerFormat.Custom;
            dtpNgaySinh.CustomFormat = "dd-MM-yyyy";

            connectSer.Connect();
            docGiaSer.getAll(dgvDocGia);
        }
        private void capNhatSach_Load(object sender, EventArgs e)
        {
            dtpNgayNhap.Format       = DateTimePickerFormat.Custom;
            dtpNgayNhap.CustomFormat = "dd-MM-yyyy";

            connectSer.Connect();
            sachSer.getAll(dgvSach);
            connectSer.LoadDataCombobox(cbMaLinhVuc, "select MALV from tblLinhVuc");
            connectSer.LoadDataCombobox(cbTenLinhVuc, "select TENLV from tblLinhVuc");
        }
示例#5
0
 private void frmLogin_Load(object sender, EventArgs e)
 {
     try
     {
         connectSer.Connect();
     }
     catch
     {
         MessageBox.Show("Không thể kết nối");
     }
 }
示例#6
0
 private void frmMain_Load(object sender, EventArgs e)
 {
     try
     {
         connectSer.Connect();
     }
     catch
     {
         MessageBox.Show("Không thể kết nối");
     }
     A           = label1.Text;
     B           = label2.Text;
     C           = label3.Text;
     D           = label4.Text;
     label4.Text = "";
     label3.Text = "";
     label2.Text = "";
     label1.Text = "";
     timer1.Start();
 }
示例#7
0
 public frmPhieuMuonQuaHan()
 {
     InitializeComponent();
     connectSer.Connect();
 }
示例#8
0
 private void capNhatLinhVuc_Load(object sender, EventArgs e)
 {
     connectSer.Connect();
     linhVucSer.getAll(dgvLinhVuc);
 }