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); } } }
private void EditLaporan(string lappenid, string NOSJ, bool printed) { sinarekDataSet.vlogproductDataTable sjData = new sinarekDataSet.vlogproductDataTable(); using (sinarekDataSetTableAdapters.vlogproductTableAdapter tbl = new sinarekDataSetTableAdapters.vlogproductTableAdapter()) { try { tbl.FillBySJ(sjData, NOSJ); DataRow row_ = sjData.Rows[0]; frmInputUJ frm = new frmInputUJ(row_ , lappenid , printed); frm.StartPosition = FormStartPosition.CenterScreen; frm.ShowDialog(this); } catch (Exception ex) { helper.ErrorMessage("Error mengedit laporan.!"); helper.SysLog(this.GetType().Name, this.Text, "Error : " + ex.Message); } } }
private void btnSimpanBotol_Click(object sender, EventArgs e) { string parentid = string.Empty; string logid = string.Empty; if (txtBotol.Text != "________") { try { using (sinarekDataSetTableAdapters.vlogproductTableAdapter tbl = new sinarekDataSetTableAdapters.vlogproductTableAdapter()) { logid = row_["logid"].ToString(); parentid = tbl.CheckParent(txtBotol.Text.Replace(" ", "")).ToString(); } if (parentid == "-1") { using (sinarekDataSetTableAdapters.logproductTableAdapter tbl = new sinarekDataSetTableAdapters.logproductTableAdapter()) { tbl.UpdateParent(int.Parse(logid), NBConfig.ValidUserName, int.Parse(rddSales.SelectedValue.ToString()), txtBotol.Text); } this.vlogproductdetailTableAdapter.FillByParent(this.sinarekDataSet.vlogproductdetail, int.Parse(row_["logid"].ToString())); btnSimpanBotol.Enabled = false; txtBotol.Enabled = false; } else { helper.ErrorMessage("Surat jalan sudah terpakai!"); txtReturn.ResetText(); } } catch (Exception ex) { helper.ErrorMessage("No Transaksi Tidak ada!"); helper.SysLog(this.GetType().Name, this.Text, ex.Message); } //Associate barang return dgn sj } }
private void GetSJDetail() { sinarekDataSet.vlogproductDataTable sjData = new sinarekDataSet.vlogproductDataTable(); using (sinarekDataSetTableAdapters.vlogproductTableAdapter tbl = new sinarekDataSetTableAdapters.vlogproductTableAdapter()) { try { tbl.FillBySJ(sjData, txtSuratJalan.Text.Replace(" ", "")); //Fill the necessary fields if (sjData.Rows.Count == 1) { row_ = sjData.Rows[0]; //rddSales.SelectedValue = int.Parse(row_["SalesID"].ToString()); rddSales.FindItemExact(row_["SalesName"].ToString(), false).Selected = true; dtpTglSJ.Value = DateTime.Parse(row_["Tanggal"].ToString()); txtSuratJalan.Enabled = false; btnMulai.Enabled = false; dtpKembali.Enabled = true; dtpTanggal.Enabled = true; btnSimpan.Enabled = true; btnMulai.Enabled = false; dtpKembali.Focus(); } else { MessageBox.Show("Surat Jalan tidak ada"); txtSuratJalan.SelectAll(); } } catch (Exception ex) { helper.ErrorMessage(ex.Message); } } }
private void LoadDataSJ(string NoSJ) { sinarekDataSet.vlogproductDataTable tb = new NB.sinarekDataSet.vlogproductDataTable(); using (sinarekDataSetTableAdapters.vlogproductTableAdapter tbAdapt = new sinarekDataSetTableAdapters.vlogproductTableAdapter()) { tbAdapt.FillBySJ(tb, NoSJ); } editRow_ = tb.Rows[0]; string transtypeid = editRow_["transtypetypeid"].ToString(); logid_ = long.Parse(editRow_["logid"].ToString()); if (int.Parse(rddTipe.SelectedValue.ToString()) == int.Parse(transtypeid)) { rddTipe_SelectedValueChanged(rddTipe, new EventArgs()); } else { rddTipe.SelectedValue = int.Parse(transtypeid); } tanggalDateTimePicker.Value = DateTime.Parse(editRow_["tanggal"].ToString()); switch (rddTipe.Text.ToLower()) { case "pelanggan": mrddPel.SelectedValue = int.Parse(editRow_["custid"].ToString()); rddPelSales.FindItemExact(editRow_["SalesShort"].ToString(), false).Selected = true; if (editRow_["sopirid"].ToString() != "-1") { chkAntar.ToggleState = Telerik.WinControls.Enumerations.ToggleState.On; } if (chkAntar.ToggleState == Telerik.WinControls.Enumerations.ToggleState.On) { rddPelSopir.FindItemExact(editRow_["sopirname"].ToString(), false).Selected = true; rddPelMobil.FindItemExact(editRow_["mobilname"].ToString(), false).Selected = true; rddPelKernet.FindItemExact(editRow_["kernetname"].ToString(), false).Selected = true; } break; case "sales": rddSales.FindItemExact(editRow_["SalesShort"].ToString(), false).Selected = true; //rddCust.FindItemExact(editRow_["SalesShort"].ToString(), false).Selected = true; rddSopir.FindItemExact(editRow_["sopirname"].ToString(), false).Selected = true; rddMobil.FindItemExact(editRow_["mobilname"].ToString(), false).Selected = true; rddKernet.FindItemExact(editRow_["kernetname"].ToString(), false).Selected = true; break; case "staff": case "satpam": case "buruh": rddPelSales.FindItemExact(editRow_["SalesShort"].ToString(), false).Selected = true; rddCust.FindItemExact(editRow_["CustName"].ToString(), false).Selected = true; break; case "contoh": break; case "rusak": break; case "return": //custtypeid and custtypetoid is switched break; } //Load Product //radGridView1.DataSource = logdetailBindingSource; radGridView1.DataSource = null; this.sinarekDataSet.logdetail.Clear(); logdetailTableAdapter.FillBySJ(this.sinarekDataSet.logdetail, long.Parse(editRow_["logid"].ToString())); foreach (DataRow row in sinarekDataSet.logdetail.Rows) { GridViewRowInfo newRow = radGridView1.Rows.AddNew(); newRow.Cells["detailid"].Value = row["detailid"]; newRow.Cells["productid"].Value = row["baseid"]; newRow.Cells["custtypeid"].Value = row["custtypeid"]; newRow.Cells["quantity"].Value = row["quantity"]; } }