Beispiel #1
0
        private void InDuLieu()
        {
            frmViewReport frm = new frmViewReport();

            frm.rpt = new rptThamGiaBHXH(Convert.ToInt64(grvCongNhan.GetFocusedRowCellValue("ID_CN")));
            DataTable dt = new DataTable();

            dt           = Commons.Modules.ObjSystems.ConvertDatatable(grvThamGiaBHXH);
            dt.TableName = "DATA";
            frm.AddDataSource(dt);
            frm.AddDataSource(dt);

            frm.ShowDialog();
        }
Beispiel #2
0
        //sự kiện click cha
        //private void Element_Click(object sender, EventArgs e)
        //{

        //    var button = sender as AccordionControlElement;
        //    if (sLoad == button.Name) return;
        //    Commons.Modules.ObjSystems.ShowWaitForm(this);
        //    sLoad = button.Name;
        //    lab_Link.Text = slinkcha + "/" + button.Text;
        //    switch (button.Name)
        //    {
        //        case "mnuBCDonVi":
        //            {
        //                if (!panel2.Controls.Contains(ucKeHoachNghiPhep.Instance))
        //                {
        //                    panel2.Controls.Clear();
        //                    panel2.Controls.Add(ucKeHoachNghiPhep.Instance);
        //                    ucKeHoachNghiPhep.Instance.Dock = DockStyle.Fill;
        //                    ucKeHoachNghiPhep.Instance.BringToFront();
        //                }
        //                break;
        //            }
        //        case "mnuBCXiNghiep":
        //            {
        //                if (!panel2.Controls.Contains(ucDaoTao.Instance))
        //                {
        //                    panel2.Controls.Clear();
        //                    panel2.Controls.Add(ucDaoTao.Instance);
        //                    ucDaoTao.Instance.Dock = DockStyle.Fill;
        //                    ucDaoTao.Instance.BringToFront();
        //                }
        //                break;
        //            }
        //        case "mnuBCTo":
        //            {
        //                ucQuyetDinhThoiViec thoiviec = new ucQuyetDinhThoiViec();
        //                panel2.Controls.Clear();
        //                panel2.Controls.Add(thoiviec);
        //                thoiviec.Dock = DockStyle.Fill;
        //                break;
        //            }
        //        default:
        //            break;
        //    }
        //    Commons.Modules.ObjSystems.HideWaitForm();

        //}
        //sự kiện click con
        private void Elementchill_Click(object sender, EventArgs e)
        {
            var button = sender as AccordionControlElement;

            if (sLoad == button.Name)
            {
                return;
            }
            Commons.Modules.ObjSystems.ShowWaitForm(this);
            sLoad         = button.Name;
            lab_Link.Text = slinkcha + "/" + button.Text;
            switch (button.Name)
            {
            case "mnuBCDonVi":
            {
                frmViewReport frm = new frmViewReport();
                frm.rpt = new rptDSDonVi();
                DataTable dt = new DataTable();
                dt.Load(SqlHelper.ExecuteReader(Commons.IConnections.CNStr, "rptDSDonVi", Commons.Modules.UserName, Commons.Modules.TypeLanguage));
                dt.TableName = "DATA";
                frm.AddDataSource(dt);
                //frm.AddDataSource(dt);

                frm.ShowDialog();
                break;
            }

            case "mnuBCXiNghiep":
            {
                //if (!panel2.Controls.Contains(ucDaoTao.Instance))
                //{
                //    panel2.Controls.Clear();
                //    panel2.Controls.Add(ucDaoTao.Instance);
                //    ucDaoTao.Instance.Dock = DockStyle.Fill;
                //    ucDaoTao.Instance.BringToFront();
                //}
                //break;
                ucDaoTao daotao = new ucDaoTao();
                panel2.Controls.Clear();
                panel2.Controls.Add(daotao);
                daotao.Dock = DockStyle.Fill;
                break;
            }

            case "mnuBCTo":
            {
                ucQuyetDinhThoiViec thoiviec = new ucQuyetDinhThoiViec();
                panel2.Controls.Clear();
                panel2.Controls.Add(thoiviec);
                thoiviec.Dock = DockStyle.Fill;
                break;
            }

            default:
                break;
            }
            Commons.Modules.ObjSystems.HideWaitForm();
        }
Beispiel #3
0
        private void  PrintData()
        {
            if (grvChung.RowCount == 0 || grdChung.DataSource == null)
            {
                Commons.Modules.ObjSystems.msgChung(Commons.ThongBao.msgKhongCoDuLieuIn);
                return;
            }
            frmViewReport frm = new frmViewReport();

            frm.rpt = new rptTienThuongXepLoai();
            DataTable dt     = new DataTable();
            DateTime  dThang = Convert.ToDateTime("01/01/1900");

            try
            {
                dThang = Convert.ToDateTime(cboThang.Text.ToString());
            }
            catch { }


            System.Data.SqlClient.SqlConnection conn;
            try
            {
                conn = new System.Data.SqlClient.SqlConnection(Commons.IConnections.CNStr);
                conn.Open();

                System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand("spTienThuongXepLoai", conn);



                //dt.Load(SqlHelper.ExecuteReader(Commons.IConnections.CNStr, "spTienThuongXepLoai", dThang, "01/01/1900",
                //    (cboDV.EditValue.ToString() == "" ? -1 : cboDV.EditValue),
                //    (cboXN.EditValue.ToString() == "" ? -1 : cboXN.EditValue),
                //    (cboTo.EditValue.ToString() == "" ? -1 : cboTo.EditValue), Commons.Modules.UserName,
                //    Commons.Modules.TypeLanguage, "", "Print"));


                cmd.Parameters.Add("@NgayTTXL", SqlDbType.Date).Value      = dThang;
                cmd.Parameters.Add("@DVi", SqlDbType.BigInt).Value         = (cboDV.EditValue.ToString() == "" ? -1 : cboDV.EditValue);
                cmd.Parameters.Add("@XNghiep", SqlDbType.BigInt).Value     = (cboXN.EditValue.ToString() == "" ? -1 : cboXN.EditValue);
                cmd.Parameters.Add("@To", SqlDbType.BigInt).Value          = (cboTo.EditValue.ToString() == "" ? -1 : cboTo.EditValue);
                cmd.Parameters.Add("@UName", SqlDbType.NVarChar, 50).Value = Commons.Modules.UserName;
                cmd.Parameters.Add("@NNgu", SqlDbType.Int).Value           = Commons.Modules.TypeLanguage;
                cmd.Parameters.Add("@sBT", SqlDbType.NVarChar, 50).Value   = "rptTienThuongXepLoai";
                cmd.Parameters.Add("@Loai", SqlDbType.NVarChar, 50).Value  = "Print";
                cmd.CommandType = CommandType.StoredProcedure;
                System.Data.SqlClient.SqlDataAdapter adp = new System.Data.SqlClient.SqlDataAdapter(cmd);
                DataSet ds = new DataSet();
                adp.Fill(ds);

                dt           = new DataTable();
                dt           = ds.Tables[0].Copy();
                dt.TableName = "DATA_REPORT";
                frm.AddDataSource(dt);

                dt           = new DataTable();
                dt           = ds.Tables[1].Copy();
                dt.TableName = "DATA_NNGU";
                frm.AddDataSource(dt);
            }
            catch
            {}



            frm.rpt = new rptTienThuongXepLoai();
            frm.ShowDialog();
        }