コード例 #1
0
    public static void BindDDLCompany(DropDownList ddl)
    {
        SysCompanyDAL _ddlSysCompany = null;
        Hashtable     _htParameters  = null;

        try
        {
            _ddlSysCompany = new SysCompanyDAL();
            _htParameters  = new Hashtable();
            _htParameters["p_keywords"] = "";

            ddl.DataSource     = _ddlSysCompany.GetRows(_htParameters);
            ddl.DataValueField = "C_CODE";
            ddl.DataTextField  = "C_NAME";
            ddl.DataBind();
        }
        catch (Exception ex)
        {
        }
    }
コード例 #2
0
    protected void btnPrintAll_Click(object sender, EventArgs e)
    {
        int              row_count      = 0;
        int              counter_row    = 0;
        SysCompanyDAL    _dalSysCompany = null;
        Hashtable        _htParameters  = null;
        ExportFormatType export         = ExportFormatType.PortableDocFormat;

        //if (rboPrinterOption.SelectedValue.Equals("3"))
        //{
        //    export = ExportFormatType.Excel;
        //}

        try
        {
            _dalSysCompany = new SysCompanyDAL();
            _htParameters  = new Hashtable();

            _htParameters["p_keywords"] = txtSearch.Text;

            DataTable _dt = _dalSysCompany.GetRows(_htParameters);
            //foreach (DataRow dr in _dt.Rows)
            //{
            _htParameters.Clear();
            MPF23.Shared.Mapper.UIToDB.Map(pnlBody.Controls, _htParameters);
            //_htParameters["p_c_code"] = dr["C_CODE"].ToString();
            //_htParameters["p_c_company"] = dr["C_NAME"].ToString();
            //_htParameters["p_module"] = rboModule.SelectedValue;
            _htParameters["p_user_id"]     = Utility.CurrentUID;
            _htParameters["p_status"]      = rboStatus.SelectedValue;
            _htParameters["p_employee_id"] = 0;
            _htParameters["p_flag"]        = 1;
            // end isi parameter

            // nama report yang dibuat di Crystal Report
            string rptName = Server.MapPath(@"..\..\rpt\RPT_LS_HREMPLOYEE.rpt");

            // nama pdf yang akan dicreate dan path nya
            string pdfName  = "rpt_ls_hremployee" + Utility.CurrentUID + DateTime.Now.ToString("ddMMyyyyHHmmss") + ".pdf";
            string pdfPath  = Server.MapPath(@"..\..\temp\pdf\" + pdfName);
            string filetype = "pdf";

            //if (rboPrinterOption.SelectedValue.Equals("3"))
            //{
            //    pdfName = "rpt_ls_mktleasereje" + Utility.CurrentUID + DateTime.Now.ToString("ddMMyyyyHHmmss") + ".xls";
            //    pdfPath = Server.MapPath(@"..\..\..\temp\xls\" + pdfName);
            //    filetype = "xls";
            //}

            // membuat pdf
            Utility.ExecuteReport(this, "sp_rpt_ls_hremployee", _htParameters, rptName, pdfPath, "RPT_LS_HREMPLOYEE", export);

            // menampilkan pdf yang sudah dibuat
            if (counter_row == row_count)
            {
                ScriptManager.RegisterStartupScript(this, GetType(), "Report", "window.open('../../temp/" + filetype + "/" + pdfName + "', 'Report', 'fullscreen=0,menubar=0,status=0,scrollbars=0,resizable=1,toolbar=0,width=600,height=400');", true);
            }
            //}
        }
        catch (Exception ex)
        {
            Utility.ShowMessageBox(this, Utility.LOAD_DATA_FAIL_MESSAGE, ex, null, null);
        }
    }