Пример #1
0
        private void frmGaji_Load(object sender, EventArgs e)
        {
            initializeButtons();
            SetDefault();
            try
            {
                this.gajibulananTableAdapter.Fill(this.sinarekDataSet.gajibulanan);
                this.memberTableAdapter.Fill(this.sinarekDataSet.member);
                this.tiperinciangajiTableAdapter.Fill(this.sinarekDataSet.tiperinciangaji);
                rddGajiMingguan.SelectedValue = NBConfig.IGBID;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + " : " + ex.StackTrace);
            }
            //Always check if gaji has been printed
            if (NBConfig.GetGBIDPrintedStaff())
            {
                SetPrintedForms();
            }

            //Setting for GAJI
            radRadioButtonNama.ToggleState = Telerik.WinControls.Enumerations.ToggleState.On;
            ddlNama2.ResetText();
            ddlTipe2.ResetText();
            //radGridView1.BestFitColumns();
            tipeRincianddl.SelectedValue = 12;
        }
Пример #2
0
        private void btnBonus_Click(object sender, EventArgs e)
        {
            //Always check if gaji total has been printed or not
            if (!NBConfig.GetGBIDPrintedStaff())
            {
                if (delete_ || rddGajiMingguan.SelectedValue.ToString() == NBConfig.IGBID.ToString())
                {
                    frmAddGajiDetail frm = new frmAddGajiDetail(int.Parse(tipeRincianddl.SelectedValue.ToString())
                                                                , int.Parse(rddGajiMingguan.SelectedValue.ToString())
                                                                , 3
                                                                , tipeRincianddl.Text
                                                                , decimal.Parse(tipeRincianddl.Tag.ToString()));
                    frm.ShowDialog(this);

                    //refresh grid
                    this.vrinciangajiTableAdapter.FillByStaff(this.sinarekDataSet.vrinciangaji, int.Parse(rddGajiMingguan.SelectedValue.ToString()), 1);
                }
            }
            else
            {
                SetPrintedForms();
                helper.NotifMessage("Gaji Minggu ini telah di print maka input sudah tidak diperbolehkan"
                                    + "./nJika ada kesalahan harap dilaporkan.");
            }
        }
Пример #3
0
        private void btPrintPages_Click(object sender, EventArgs e)
        {
            if (int.Parse(txtFrom.Value.ToString()) > 0)
            {
                DialogResult res = MessageBox.Show("Print Slip Gaji. Siap kan kertas di printer."
                                                   , "Print Slip Gaji"
                                                   , MessageBoxButtons.OKCancel
                                                   , MessageBoxIcon.Question
                                                   , MessageBoxDefaultButton.Button2
                                                   , MessageBoxOptions.DefaultDesktopOnly);

                if (res == System.Windows.Forms.DialogResult.OK)
                {
                    //Print Slip Gaji
                    rptGajiStaff gj = new rptGajiStaff();
                    gj.ReportParameters["GBID"].Value = rddGajiMingguan.SelectedValue;
                    gj.ReportParameters["User"].Value = NBConfig.ValidUserName;
                    IReportDocument report1 = (IReportDocument)gj;
                    ////set parameters when necessary

                    //// PrinterSettings
                    PrinterSettings printerSettings = new PrinterSettings();
                    printerSettings.DefaultPageSettings.PaperSize      = new PaperSize("Mini Letter", 850, 550);
                    printerSettings.DefaultPageSettings.Margins.Top    = 17;
                    printerSettings.DefaultPageSettings.Margins.Bottom = 17;
                    printerSettings.DefaultPageSettings.Margins.Left   = 12;
                    printerSettings.DefaultPageSettings.Margins.Right  = 12;

                    //// Adjust the printer settings if necessary...
                    printerSettings.PrintRange = PrintRange.SomePages;
                    printerSettings.FromPage   = int.Parse(txtFrom.Value.ToString());
                    printerSettings.ToPage     = int.Parse(txtTo.Value.ToString());

                    InstanceReportSource reportSource = new InstanceReportSource();
                    reportSource.ReportDocument = report1;
                    // Print the report using the printer settings.
                    ReportProcessor reportProcessor = new ReportProcessor();

                    reportProcessor.PrintReport(reportSource, printerSettings);

                    //process printed
                    if (!NBConfig.GetGBIDPrintedStaff())
                    {
                        using (sinarekDataSetTableAdapters.gajibulananTableAdapter gb = new sinarekDataSetTableAdapters.gajibulananTableAdapter())
                        {
                            gb.UpdatePrintedStaff(NBConfig.ValidUserName, NBConfig.IGBID);
                        }
                        SetPrintedForms();
                        helper.NotifMessage("Data Gaji telah terkunci dan tidak dapat di ubah lagi.");
                    }
                }
            }
            else
            {
                //Silahkan pilih halaman untuk di print
                MessageBox.Show("Pilih halaman untuk di print!");
            }
        }
Пример #4
0
        private void btnPrintNama_Click(object sender, EventArgs e)
        {
            if (rddMember.SelectedValue != null)
            {
                DialogResult res = MessageBox.Show("Print Slip Gaji Untuk " + rddMember.Text + ". Siap kan kertas di printer."
                                                   , "Print Slip Gaji Per Nama"
                                                   , MessageBoxButtons.OKCancel
                                                   , MessageBoxIcon.Question
                                                   , MessageBoxDefaultButton.Button2
                                                   , MessageBoxOptions.DefaultDesktopOnly);

                if (res == System.Windows.Forms.DialogResult.OK)
                {
                    //Print Slip Gaji
                    rptGajiMingguanNama gj = new rptGajiMingguanNama();
                    gj.ReportParameters["GMID"].Value     = rddGajiMingguan.SelectedValue;
                    gj.ReportParameters["User"].Value     = NBConfig.ValidUserName;
                    gj.ReportParameters["memberid"].Value = rddMember.SelectedValue;
                    IReportDocument report1 = (IReportDocument)gj;
                    ////set parameters when necessary

                    //// PrinterSettings
                    PrinterSettings printerSettings = new PrinterSettings();
                    //// Adjust the printer settings if necessary...
                    InstanceReportSource reportSource = new InstanceReportSource();
                    reportSource.ReportDocument = report1;
                    // Print the report using the printer settings.
                    ReportProcessor reportProcessor = new ReportProcessor();
                    reportProcessor.PrintReport(reportSource, printerSettings);

                    //process printed
                    if (!NBConfig.GetGBIDPrintedStaff())
                    {
                        using (sinarekDataSetTableAdapters.gajibulananTableAdapter gb = new sinarekDataSetTableAdapters.gajibulananTableAdapter())
                        {
                            gb.UpdatePrintedStaff(NBConfig.ValidUserName, NBConfig.IGBID);
                        }
                        SetPrintedForms();
                        helper.NotifMessage("Data Gaji telah terkunci dan tidak dapat di ubah lagi.");
                    }
                }
            }
        }