コード例 #1
0
        private void EditLaporan()
        {
            GridViewRowInfo row = radGridView1.SelectedRows[0];

            sinarekDataSet.vlogproductDataTable sjData = new sinarekDataSet.vlogproductDataTable();
            using (sinarekDataSetTableAdapters.vlogproductTableAdapter tbl = new sinarekDataSetTableAdapters.vlogproductTableAdapter())
            {
                try
                {
                    tbl.FillBySJ(sjData, row.Cells["nosj"].Value.ToString());
                    DataRow           row_ = sjData.Rows[0];
                    frmInputPenjualan frm  = new frmInputPenjualan(row_,
                                                                   row.Cells["lappenid"].Value.ToString(),
                                                                   DateTime.Parse(row.Cells["enddate"].Value.ToString()),
                                                                   DateTime.Parse(row.Cells["tanggalsj"].Value.ToString()),
                                                                   DateTime.Parse(row.Cells["tanggal"].Value.ToString()));
                    frm.StartPosition = FormStartPosition.CenterScreen;
                    frm.ShowDialog(this);
                }
                catch (Exception ex)
                {
                    helper.ErrorMessage("Error mengedit laporan.!" + ex.StackTrace + ex.Message);
                    helper.SysLog(this.GetType().Name, this.Text, ex.Message);
                }
            }
        }
コード例 #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();
            }
        }