private void SetRelatedItemData(string itemCode) { //Set defalt valur dgcInventory.SetRowCellValue("ItemName", CommonData.StringEmpty); dgcInventory.SetRowCellValue("Unit", CommonData.StringEmpty); if (!CommonMethod.IsNullOrEmpty(itemCode)) { DataTable dtResult = new DataTable(); _commonBl.SelectCurrentItemInRepositoryControl(out dtResult, ShowProductionLine, ShowDocument, itemCode); MS_ItemDto itemDto = new MS_ItemDto() { Code = itemCode, }; //Set data for relational column if (dtResult.Rows.Count > 0) { dgcInventory.SetRowCellValue("ItemName", CommonMethod.ParseString(dtResult.Rows[0]["Name"])); dgcInventory.SetRowCellValue("Unit", CommonMethod.ParseString(dtResult.Rows[0]["InvUnitCode"])); dgcInventory.SetRowCellValue("QualityStatus", CommonMethod.ParseString(dtResult.Rows[0]["QuanlityStatus"])); if (ShowProductionLine) { dgcInventory.SetRowCellValue("ProductionLine", CommonMethod.ParseString(dtResult.Rows[0]["Line"])); } } } dgvInventory.RefreshData(); }
protected override void FillData() { //Select item data DataTable dtResult = new DataTable(); CommonBl commonBl = new CommonBl(); MS_ItemDto itemDto = new MS_ItemDto() { GroupCode = this.ItemGroupCode, ItemType = this.ItemType }; commonBl.SelectProductData(itemDto, out dtResult); if (dtResult.Columns.Count > 0) { if (this.HasNull) { DataRow newRow = dtResult.NewRow(); newRow[1] = CommonData.StringEmpty; dtResult.Rows.InsertAt(newRow, 0); } } this.Properties.DataSource = dtResult; this.Properties.NullText = CommonData.StringEmpty; //this.EditValue = CommonData.StringEmpty; //this.SetLanguage(); }
protected override void FillData() { if (CommonMethod.IsNullOrEmpty(this.ItemType) && CommonMethod.IsNullOrEmpty(this.DocumentNo)) { base.FillData(); } else { CommonBl commonBl = new CommonBl(); if (!CommonMethod.IsNullOrEmpty(this.ItemType)) { MS_ItemDto itemDto = new MS_ItemDto() { ItemType = this.ItemType, }; commonBl.SelectItemData(itemDto, out dtNewSource); } if (!CommonMethod.IsNullOrEmpty(this.DocumentNo)) { ST_StockTransactionDetailDto stockDetailDto = new ST_StockTransactionDetailDto() { DocumentNumber = this.DocumentNo, }; commonBl.SelectItemDataByDocument(stockDetailDto, out dtNewSource); } if (dtNewSource.Columns.Count > 0) { if (this.HasNull) { dtNewSource.Rows.InsertAt(dtNewSource.NewRow(), 0); } } this.DataSource = dtNewSource; // this.EditValue = CommonData.StringEmpty; this.NullText = CommonData.StringEmpty; } }