private void viewDetails() { try { dgvDetailList.DataSource = loInventoryDetail.getInventoryDetails("ViewAll", dgvList.CurrentRow.Cells[0].Value.ToString()); } catch { dgvDetailList.DataSource = null; } }
private void StockTransferOutDetailUI_Load(object sender, EventArgs e) { try { this.BackColor = Color.FromArgb(int.Parse(GlobalVariables.FormBackColor)); cboToLocation.DataSource = loLocation.getAllData("ViewAll", "", ""); cboToLocation.DisplayMember = "Description"; cboToLocation.ValueMember = "Id"; cboToLocation.SelectedIndex = -1; if (lOperation == GlobalVariables.Operation.Edit) { foreach (DataRow _dr in loInventory.getAllData("", "", lInventoryId, "").Rows) { txtStockTransferOutNo.Text = _dr["Id"].ToString(); dtpDate.Value = GlobalFunctions.ConvertToDate(_dr["Date"].ToString()); txtReference.Text = _dr["Reference"].ToString(); cboToLocation.Text = _dr["Location To"].ToString(); txtTotalQtyOUT.Text = string.Format("{0:n}", decimal.Parse(_dr["Total Qty OuT"].ToString())); txtRemarks.Text = _dr["Remarks"].ToString(); foreach (DataRow _drDetails in loInventoryDetail.getInventoryDetails("", lInventoryId).Rows) { int i = dgvDetail.Rows.Add(); dgvDetail.Rows[i].Cells["Id"].Value = _drDetails["Id"].ToString(); dgvDetail.Rows[i].Cells["StockId"].Value = _drDetails["StockId"].ToString(); dgvDetail.Rows[i].Cells["StockCode"].Value = _drDetails["Stock Code"].ToString(); dgvDetail.Rows[i].Cells["StockDescription"].Value = _drDetails["Stock Description"].ToString(); dgvDetail.Rows[i].Cells["Unit"].Value = _drDetails["Unit"].ToString(); dgvDetail.Rows[i].Cells["LocationId"].Value = _drDetails["LocationId"].ToString(); dgvDetail.Rows[i].Cells["Location"].Value = _drDetails["Location"].ToString(); dgvDetail.Rows[i].Cells["QtyOut"].Value = string.Format("{0:n}", decimal.Parse(_drDetails["Qty Out"].ToString())); dgvDetail.Rows[i].Cells["Remarks"].Value = _drDetails["Remarks"].ToString(); dgvDetail.Rows[i].Cells["Status"].Value = "Saved"; } computeTotalQty(); } } else { foreach (DataRow _dr in loCommon.getNextTabelSequenceId("Inventory").Rows) { txtStockTransferOutNo.Text = _dr[0].ToString(); } } } catch (Exception ex) { ErrorMessageUI em = new ErrorMessageUI(ex.Message, this.Name, "StockTransferOutDetailUI_Load"); em.ShowDialog(); return; } }
public DataTable getInventoryDetails(string pDisplayType, string pId) { return(loInventoryDetail.getInventoryDetails(pDisplayType, pId)); }