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; }
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."); } }
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."); } }
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!"); } }
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; } }
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."); } } } }
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; } }
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."); } }
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."); } }
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."); } } }
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."); } }