Пример #1
0
        private void radGridView2_CommandCellClick(object sender, EventArgs e)
        {
            string lappenjid;
            GridCommandCellElement cell = (GridCommandCellElement)sender;

            if (cell.CommandButton.TextElement.Text == "Input Laporan")
            {
                //Create Laporan
                using (sinarekDataSetTableAdapters.lappenTableAdapter tbl = new sinarekDataSetTableAdapters.lappenTableAdapter())
                {
                    try
                    {
                        lappenjid = tbl.pInsertLapPenj(int.Parse(cell.RowInfo.Cells["LogID"].Value.ToString())
                                                       , DateTime.Now
                                                       , DateTime.Now
                                                       , NBConfig.ValidUserName
                                                       , "UJ").ToString();
                        EditLaporan(lappenjid
                                    , cell.RowInfo.Cells["NOSJ"].Value.ToString()
                                    , false);
                        this.uangjalanTableAdapter.FillByNoLap(this.sinarekDataSet.uangjalan);
                        this.vlappenTableAdapter.FillByTanggal(this.sinarekDataSet.vlappen, dtpTanggalLaporan.Value);
                    }
                    catch (Exception ex)
                    {
                        helper.NotifMessage("Laporan UJ untuk " + cell.RowInfo.Cells["NOSJ"].Value.ToString() + " sudah terinput.");
                        helper.SysLog(this.GetType().Name, this.Text, "Create Laporan UJ :" + ex.Message);
                        lappenjid = tbl.GetLapPenID(int.Parse(cell.RowInfo.Cells["LogID"].Value.ToString())
                                                    , "UJ").ToString();
                    }
                }
            }
        }
Пример #2
0
        private void SaveNewItem()
        {
            string lappenjid = string.Empty;

            if (ValidateFields())
            {
                using (sinarekDataSetTableAdapters.lappenTableAdapter tbl = new sinarekDataSetTableAdapters.lappenTableAdapter())
                {
                    try
                    {
                        lappenjid = tbl.pInsertLapPenj(int.Parse(row_["logid"].ToString())
                                                       , dtpTanggal.Value
                                                       , dtpKembali.Value
                                                       , NBConfig.ValidUserName
                                                       , "Penjualan").ToString();
                    }
                    catch (Exception ex)
                    {
                        helper.NotifMessage("Laporan untuk " + txtSuratJalan.Text + " sudah terinput.");
                        helper.SysLog(this.GetType().Name, this.Text, "SaveNewItem :" + ex.Message);
                        lappenjid = tbl.GetLapPenID(int.Parse(row_["logid"].ToString())
                                                    , "Penjualan").ToString();
                    }
                    finally
                    {
                    }
                }


                //Pas Value to other form
                this.Hide();
                frmInputPenjualan frm = new frmInputPenjualan(row_, lappenjid, dtpKembali.Value, dtpTglSJ.Value, dtpTanggal.Value);
                frm.StartPosition = FormStartPosition.CenterScreen;
                frm.ShowDialog(this.Owner);
                this.Close();
            }
        }