コード例 #1
0
 //private void load_data_2_grid2()
 //{
 //    m_ds = new DS_V_DM_HOC_SINH();
 //    m_ds.Clear();
 //    m_ds.EnforceConstraints = false;
 //    m_us.FillDataset(m_ds
 //        , CIPConvert.ToDecimal(m_cbo_lop_mon.SelectedValue)
 //        , m_txt_search.Text.Trim());
 //    m_fg.Redraw = false;
 //    CGridUtils.Dataset2C1Grid(m_ds, m_fg, m_obj_trans);
 //    m_fg.Subtotal(AggregateEnum.Count
 //        , 0
 //        , 0
 //        , (int)e_col_Number.HO_TEN
 //        , "Tổng");
 //    wrap_text_cell();
 //    m_fg.Redraw = true;
 //}
 private void grid2us_object(US_GD_HOC i_us
     , int i_grid_row)
 {
     DataRow v_dr;
     v_dr = (DataRow)m_fg.Rows[i_grid_row].UserData;
     m_obj_trans.GridRow2DataRow(i_grid_row, v_dr);
     i_us.DataRow2Me(v_dr);
 }
コード例 #2
0
        private void cho_lop_cu_nghi_hoat_dong()
        {
            US_GD_HOC v_us = new US_GD_HOC();
            DS_GD_HOC v_ds = new DS_GD_HOC();
            v_us.FillDataset(v_ds, "WHERE ID_LOP_MON = " + CIPConvert.ToDecimal(m_cbo_lop_mon_cu.SelectedValue) + " and TRANG_THAI_YN = 'Y'");
            for (int i = 0; i < v_ds.Tables[0].Rows.Count; i++)
            {
                DataRow v_dr = v_ds.Tables[0].Rows[i];
                US_GD_HOC v_us_gd_hoc = new US_GD_HOC(CIPConvert.ToDecimal(v_dr[GD_HOC.ID]));
                v_us_gd_hoc.BeginTransaction();
                v_us_gd_hoc.strTRANG_THAI_YN = "N";
                v_us_gd_hoc.datNGAY_KET_THUC = DateTime.Now.Date;
                v_us_gd_hoc.Update();
                v_us_gd_hoc.CommitTransaction();
            }

            US_DM_LOP_MON v_us_dm_lop_mon = new US_DM_LOP_MON(CIPConvert.ToDecimal(m_cbo_lop_mon_cu.SelectedValue));
            v_us_dm_lop_mon.BeginTransaction();
            v_us_dm_lop_mon.dcTRANG_THAI_LOP_MON = 89;
            v_us_dm_lop_mon.Update();
            v_us_dm_lop_mon.CommitTransaction();
        }
コード例 #3
0
 private void delete_v_dm_hoc_sinh()
 {
     if(!CGridUtils.IsThere_Any_NonFixed_Row(m_fg)) return;
     if(!CGridUtils.isValid_NonFixed_RowIndex(m_fg, m_fg.Row)) return;
     if(BaseMessages.askUser_DataCouldBeDeleted(8) != BaseMessages.IsDataCouldBeDeleted.CouldBeDeleted) return;
     US_GD_HOC v_us = new US_GD_HOC();
     grid2us_object(v_us, m_fg.Row);
     try {
         v_us.BeginTransaction();
         v_us.Delete();
         v_us.CommitTransaction();
         m_fg.Rows.Remove(m_fg.Row);
         //v_us.DeleteByID(v_us.dcID);
         //m_fg.Rows.Remove(m_fg.Row);
     }
     catch(Exception v_e) {
         v_us.Rollback();
         CDBExceptionHandler v_objErrHandler = new CDBExceptionHandler(v_e,
             new CDBClientDBExceptionInterpret());
         v_objErrHandler.showErrorMessage();
     }
 }
コード例 #4
0
        private void cho_hoc_sinh_hoc_lop_moi()
        {
            for (int i = 0; i < m_ds.Tables[0].Rows.Count; i++)
            {
                DataRow v_dr = m_ds.Tables[0].Rows[i];
                US_V_DM_HOC_SINH v_us_v_dm_hs = new US_V_DM_HOC_SINH(CIPConvert.ToDecimal(v_dr[V_DM_HOC_SINH.ID]));
                US_GD_HOC v_us_gd_hoc = new US_GD_HOC();

                v_us_gd_hoc.BeginTransaction();
                v_us_gd_hoc.dcID_HOC_SINH = v_us_v_dm_hs.dcID;
                v_us_gd_hoc.dcID_LOP_MON = CIPConvert.ToDecimal(m_cbo_lop_mon_moi.SelectedValue);
                v_us_gd_hoc.strTRANG_THAI_YN = "Y";
                v_us_gd_hoc.datNGAY_BAT_DAU = DateTime.Now.Date;
                v_us_gd_hoc.datNGAY_KET_THUC = CIPConvert.ToDatetime("01/01/3000", "dd/MM/yyyy");
                v_us_gd_hoc.Insert();
                v_us_gd_hoc.CommitTransaction();
            }
        }
コード例 #5
0
        private bool check_hs_dang_hoc_yn()
        {
            string v_op_kq_yn = "";
            US_GD_HOC v_us_gd_hoc = new US_GD_HOC();
            v_us_gd_hoc.check_hoc_sinh_dang_hoc_yn(m_us_v_hoc_sinh.dcID, CIPConvert.ToDecimal(m_cbo_nhap_vao_lop_mon.SelectedValue), ref v_op_kq_yn);

            if (v_op_kq_yn == "Y")
            {
                return true;
            }
            else return false;
        }
コード例 #6
0
 private void cho_hoc_sinh_hoc_lai()
 {
     US_GD_HOC v_us = new US_GD_HOC();
     decimal op_dc_id_gd_hoc = 0;
     v_us.Find_ID_GD_HOC(CIPConvert.ToDecimal(m_cbo_nhap_vao_lop_mon.SelectedValue), m_us_v_hoc_sinh.dcID, ref op_dc_id_gd_hoc);
     US_GD_HOC v_us_gd_hoc = new US_GD_HOC(op_dc_id_gd_hoc);
     v_us_gd_hoc.strTRANG_THAI_YN = "Y";
     v_us_gd_hoc.datNGAY_BAT_DAU = m_dat_tai_ngay.Value.Date;
     v_us_gd_hoc.datNGAY_KET_THUC = CIPConvert.ToDatetime("01/01/3000", "dd/MM/yyyy");
     v_us_gd_hoc.Update();
 }
コード例 #7
0
        private bool check_hs_in_lop_mon()
        {
            //xem voi id hoc sinh day va lop day, da co trong gd_hoc_chua
            //Neu co roi thi hien form thong bao ra la co roi
            string v_op_kq_yn = "";
            US_GD_HOC v_us_gd_hoc = new US_GD_HOC();
            v_us_gd_hoc.check_hoc_sinh_lm(m_us_v_hoc_sinh.dcID, CIPConvert.ToDecimal(m_cbo_nhap_vao_lop_mon.SelectedValue), ref v_op_kq_yn);

            if (v_op_kq_yn == "Y")
            {
                return true;
            }
            else return false;
        }
コード例 #8
0
 private void hoc_sinh_nghi_hoc()
 {
     if (DialogResult.Yes == BaseMessages.MsgBox_YES_NO_CANCEL("Bạn có chắc chắc muốn học sinh này nghỉ học không?"))
     {
         US_GD_HOC v_us = new US_GD_HOC();
         decimal op_dc_id_gd_hoc = 0;
         v_us.Find_ID_GD_HOC(CIPConvert.ToDecimal(m_cbo_lop_mon.SelectedValue), CIPConvert.ToDecimal(m_cbo_hs.SelectedValue), ref op_dc_id_gd_hoc);
         US_GD_HOC v_us_gd_hoc = new US_GD_HOC(op_dc_id_gd_hoc);
         v_us_gd_hoc.strTRANG_THAI_YN = "N";
         v_us_gd_hoc.datNGAY_KET_THUC = m_dat_tu_ngay.Value.Date;
         v_us_gd_hoc.Update();
         BaseMessages.MsgBox_Infor("Xong!!!");
         load_data_2_cbo_hoc_sinh(CIPConvert.ToDecimal(m_cbo_lop_mon.SelectedValue));
         load_data_2_lbl_tong_so_hoc_sinh(CIPConvert.ToDecimal(m_cbo_lop_mon.SelectedValue));
     }
 }