示例#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.GetGMIDPrinted())
            {
                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.GetGMIDPrinted())
            {
                if (delete_ || rddGajiMingguan.SelectedValue.ToString() == NBConfig.IGMID.ToString())
                {
                    frmAddGajiDetail frm = new frmAddGajiDetail(int.Parse(tipeRincianddl.SelectedValue.ToString())
                                                                , int.Parse(rddGajiMingguan.SelectedValue.ToString())
                                                                , 2
                                                                , tipeRincianddl.Text
                                                                , decimal.Parse(tipeRincianddl.Tag.ToString()));
                    frm.ShowDialog(this);

                    //refresh grid
                    this.vrinciangajiTableAdapter.FillByGID(this.sinarekDataSet.vrinciangaji, int.Parse(rddGajiMingguan.SelectedValue.ToString()), 2);
                }
            }
            else
            {
                SetPrintedForms();
                MessageBox.Show("Gaji Minggu ini telah di print maka input sudah tidak diperbolehkan"
                                + "./nJika ada kesalahan harap dilaporkan.");
            }
        }
示例#3
0
文件: frmGaji.cs 项目: m0ch4/Sinarek
 private void radGridView3_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
 {
     if (NBConfig.GetGMIDPrinted())
     {
         e.Cancel = true;
         MessageBox.Show("Gaji telah di print maka perubahan data gaji sudah tidak diperbolehkan.");
     }
 }
示例#4
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
                    rptGajiMingguan gj = new rptGajiMingguan();
                    gj.ReportParameters[0].Value      = NBConfig.IGMID;
                    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.GetGMIDPrinted())
                    {
                        using (sinarekDataSetTableAdapters.gajimingguanTableAdapter gm = new sinarekDataSetTableAdapters.gajimingguanTableAdapter())
                        {
                            gm.UpdatePrinted(NBConfig.ValidUserName, NBConfig.IGMID);
                        }
                        SetPrintedForms();
                        MessageBox.Show("Data Gaji telah terkunci dan tidak dapat di ubah lagi.");
                    }
                }
            }
            else
            {
                //Silahkan pilih halaman untuk di print
                MessageBox.Show("Pilih halaman untuk di print!");
            }
        }
示例#5
0
        private void frmHistoryGaji_Load(object sender, EventArgs e)
        {
            this.gajimingguanTableAdapter.Fill(this.sinarekDataSet.gajimingguan);
            if (!NBConfig.GetGMIDPrinted())
            {
                rptGajiPreview1.ReportParameters["GMID"].Value = NBConfig.IGMID - 1;

                //Always filter gajimingguan value to only historical
                gajimingguanBindingSource.Filter = "GMID < " + NBConfig.IGMID;
            }
            else
            {
                //Always filter gajimingguan value to only historical
                gajimingguanBindingSource.Filter = "GMID <= " + NBConfig.IGMID;
            }
        }
示例#6
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.GetGMIDPrinted())
                    {
                        using (sinarekDataSetTableAdapters.gajimingguanTableAdapter gm = new sinarekDataSetTableAdapters.gajimingguanTableAdapter())
                        {
                            gm.UpdatePrinted(NBConfig.ValidUserName, NBConfig.IGMID);
                        }
                        SetPrintedForms();
                        MessageBox.Show("Data Gaji telah terkunci dan tidak dapat di ubah lagi.");
                    }
                }
            }
        }
示例#7
0
文件: frmGaji.cs 项目: m0ch4/Sinarek
        private void frmGaji_Load(object sender, EventArgs e)
        {
            #region "Print"
            string frmName = this.GetType().Name;
            bool   delete  = NBConfig.CheckPermission((this.Tag != null ? this.Tag.ToString() : ""), frmName, "delete");

            btnPindah.Enabled = delete;
            btnPindah.Visible = delete;


            #endregion
            this.tiperinciangajiTableAdapter.Fill(this.sinarekDataSet.tiperinciangaji);
            this.buruhTableAdapter.Fill(this.sinarekDataSet.buruh);
            this.gajidetailtempTableAdapter.FillByGMID(this.sinarekDataSet.gajidetailtemp, NBConfig.IGMID);
            this.vgajidetailabsenTableAdapter.FillByGMID(this.sinarekDataSet.vgajidetailabsen, NBConfig.IGMID);
            //Always check if gaji has been printed
            if (NBConfig.GetGMIDPrinted())
            {
                SetPrintedForms();
            }


            //Setting for INPUTRES
            vgajidetailabsenbindingSource2.Filter = INPUTRESFILTER;
            //Setting for GAJI
            vgajidetailabsenBindingSource.Filter = gajiCurrentFilter;
            radRadioButtonNama.ToggleState       = Telerik.WinControls.Enumerations.ToggleState.On;
            ddlNama2.ResetText();
            ddlTipe2.ResetText();
            radGridView1.BestFitColumns();
            tipeRincianddl.SelectedValue = 12;

            //Make sure borongan is only loaded once
            long lResult = 0;
            if (!long.TryParse(gajidetailtempTableAdapter.CheckBorongan().ToString(), out lResult))
            {
                btnBorongan.Text    = "Borongan Sudah Di Process";
                btnBorongan.Enabled = false;
            }
        }
示例#8
0
文件: frmGaji.cs 项目: m0ch4/Sinarek
        private void btnKasBon_Click(object sender, EventArgs e)
        {
            if (!NBConfig.GetGMIDPrinted())
            {
                //Hardcoded to input only kasbon
                //frmAddGajiDetail frm = new frmAddGajiDetail(12
                //    , "Kas Bon"
                //    , 50000);
                //frm.ShowDialog(this);

                //refresh grid
                this.sinarekDataSet.vgajidetailabsen.Clear();
                vgajidetailabsenTableAdapter.FillByGMID(this.sinarekDataSet.vgajidetailabsen, NBConfig.IGMID);
                //vgajidetailabsenBindingSource3.Filter = gajiCurrentFilter;
            }
            else
            {
                SetPrintedForms();
                MessageBox.Show("Gaji Minggu ini telah di print maka input sudah tidak diperbolehkan"
                                + "./nJika ada kesalahan harap dilaporkan.");
            }
        }
示例#9
0
文件: frmGaji.cs 项目: m0ch4/Sinarek
        private void btnBonus_Click(object sender, EventArgs e)
        {
            //Always check if gaji total has been printed or not
            if (!NBConfig.GetGMIDPrinted())
            {
                //frmAddGajiDetail frm = new frmAddGajiDetail(int.Parse(tipeRincianddl.SelectedValue.ToString())
                //    , tipeRincianddl.Text
                //    , decimal.Parse(tipeRincianddl.Tag.ToString()));
                //frm.ShowDialog(this);

                //refresh grid
                this.sinarekDataSet.vgajidetailabsen.Clear();
                vgajidetailabsenTableAdapter.FillByGMID(this.sinarekDataSet.vgajidetailabsen, NBConfig.IGMID);
                vgajidetailabsenBindingSource.Filter = gajiCurrentFilter;
            }
            else
            {
                SetPrintedForms();
                MessageBox.Show("Gaji Minggu ini telah di print maka input sudah tidak diperbolehkan"
                                + "./nJika ada kesalahan harap dilaporkan.");
            }
        }
示例#10
0
        private void btnTotalRincian_Click(object sender, EventArgs e)
        {
            DialogResult res = MessageBox.Show("Print Laporan Rincian Total Gaji. Siap kan kertas di printer."
                                               , "Print Laporan Rincian Total Gaji"
                                               , MessageBoxButtons.OKCancel
                                               , MessageBoxIcon.Question
                                               , MessageBoxDefaultButton.Button2
                                               , MessageBoxOptions.DefaultDesktopOnly);

            if (res == System.Windows.Forms.DialogResult.OK)
            {
                //Print Rincian Summary Gaji
                rptGajiTotal gj = new rptGajiTotal();
                gj.ReportParameters[0].Value      = NBConfig.IGMID;
                gj.ReportParameters["user"].Value = NBConfig.ValidUserName;
                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.GetGMIDPrinted())
                {
                    using (sinarekDataSetTableAdapters.gajimingguanTableAdapter gm = new sinarekDataSetTableAdapters.gajimingguanTableAdapter())
                    {
                        gm.UpdatePrinted(NBConfig.ValidUserName, NBConfig.IGMID);
                    }
                    SetPrintedForms();
                    MessageBox.Show("Data Gaji telah terkunci dan tidak dapat di ubah lagi.");
                }
            }
        }
示例#11
0
        private void btnKasBon_Click(object sender, EventArgs e)
        {
            if (!NBConfig.GetGMIDPrinted())
            {
                //Hardcoded to input only kasbon
                frmAddGajiDetail frm = new frmAddGajiDetail(12
                                                            , int.Parse(rddGajiMingguan.SelectedValue.ToString())
                                                            , 2
                                                            , "Kas Bon"
                                                            , 50000);
                frm.ShowDialog(this);

                //refresh grid
                this.rinciangajiTableAdapter.FillByTipeGID(this.sinarekDataSet.rinciangaji, 2, int.Parse(rddGajiMingguan.SelectedValue.ToString()));
            }
            else
            {
                SetPrintedForms();
                MessageBox.Show("Gaji Minggu ini telah di print maka input sudah tidak diperbolehkan"
                                + "./nJika ada kesalahan harap dilaporkan.");
            }
        }