private void resProcessType_EditValueChanged(object sender, EventArgs e) { LookUpEdit LookupEdit = sender as LookUpEdit; DataRowView SelectedDataRow = (DataRowView)LookupEdit.GetSelectedDataRow(); if (SelectedDataRow != null) { if (CommonMethod.ParseString(SelectedDataRow[CommonKey.Code]) == CommonData.ProcessType.FG) { dgcInventory.SetRowCellValue(CommonKey.ProductionLine, "FG"); } //else if (CommonMethod.ParseString(SelectedDataRow[CommonKey.Code]) == CommonData.ProcessType.WIP) //{ // dgcInventory.SetRowCellValue(CommonKey.ProductionLine, CommonData.ProductionLineBlank.Code); //} else { dgcInventory.SetRowCellValue(CommonKey.ProductionLine, CommonData.StringEmpty); } } dgcInventory.SetRowCellValue(CommonKey.ItemCode, CommonData.StringEmpty); dgcInventory.SetRowCellValue(CommonKey.ItemName, CommonData.StringEmpty); dgcInventory.SetRowCellValue(CommonKey.InputUnit, CommonData.StringEmpty); dgcInventory.SetRowCellValue(CommonKey.QualityStatus, CommonData.StringEmpty); dgvInventory.PostEditor(); }
private void TransferType_EditValueChanged(object sender, EventArgs e) { string qualityStatus = string.Empty;; LookUpEdit LookupEdit = sender as LookUpEdit; DataRowView SelectedDataRow = (DataRowView)LookupEdit.GetSelectedDataRow(); if (SelectedDataRow != null) { switch (CommonMethod.ParseString(SelectedDataRow["Key"])) { case CommonData.TransferStatusType.OK2NC: case CommonData.TransferStatusType.OK2NG: case CommonData.TransferStatusType.OK2QI: qualityStatus = CommonData.QualityStatus.OK; break; case CommonData.TransferStatusType.NC2NG: qualityStatus = CommonData.QualityStatus.NC; break; case CommonData.TransferStatusType.QI2NC: case CommonData.TransferStatusType.QI2NG: case CommonData.TransferStatusType.QI2OK: qualityStatus = CommonData.QualityStatus.QI; break; } } dgcInventory.SetRowCellValue(CommonKey.QualityStatus, qualityStatus); dgvInventory.PostEditor(); }
private void RefreshItemDataByParent(object sender) { if (ViewMode == CommonData.Mode.View) { return; } try { LookUpEdit LookupEdit = sender as LookUpEdit; DataRowView SelectedDataRow = (DataRowView)LookupEdit.GetSelectedDataRow(); if (SelectedDataRow != null) { dgcInventory.SetRowCellValue(CommonKey.ItemType, CommonMethod.ParseString(SelectedDataRow[CommonKey.ItemType])); dgcInventory.SetRowCellValue(CommonKey.ItemCode, CommonMethod.ParseString(SelectedDataRow["Code"])); dgcInventory.SetRowCellValue(CommonKey.ItemName, CommonMethod.ParseString(SelectedDataRow["Name"])); dgcInventory.SetRowCellValue(CommonKey.InputUnit, CommonMethod.ParseString(SelectedDataRow["InvUnitCode"])); //if (ShowUnitPrice) //{ dgcInventory.SetRowCellValue(CommonKey.InputUnitPrice, CommonMethod.ParseString(SelectedDataRow[CommonKey.PurchasePrice])); decimal quantity = CommonMethod.ParseDecimal(dgvInventory.GetRowCellValue(dgvInventory.FocusedRowHandle, CommonKey.InputQuantity)); dgcInventory.SetRowCellValue(CommonKey.InputAmount, (quantity * CommonMethod.ParseDecimal(SelectedDataRow[CommonKey.PurchasePrice])).ToString()); //} if (!string.IsNullOrEmpty(QuanlityStatus)) { if (QuanlityStatus.IndexOf(",") == -1) { dgcInventory.SetRowCellValue(CommonKey.QualityStatus, QuanlityStatus); } else { dgcInventory.SetRowCellValue(CommonKey.QualityStatus, QuanlityStatus.Split(",".ToCharArray())[0]); } } } else { dgcInventory.SetRowCellValue(CommonKey.ItemCode, CommonData.StringEmpty); dgcInventory.SetRowCellValue(CommonKey.ItemName, CommonData.StringEmpty); dgcInventory.SetRowCellValue(CommonKey.InputUnit, CommonData.StringEmpty); dgcInventory.SetRowCellValue(CommonKey.QualityStatus, CommonData.StringEmpty); dgcInventory.SetRowCellValue(CommonKey.InputUnitPrice, "0"); dgcInventory.SetRowCellValue(CommonKey.InputAmount, "0"); //dgcInventory.SetRowCellValue("ProductionLine", CommonData.StringEmpty); } } catch { dgcInventory.SetRowCellValue(CommonKey.ItemCode, CommonData.StringEmpty); dgcInventory.SetRowCellValue(CommonKey.ItemName, CommonData.StringEmpty); dgcInventory.SetRowCellValue(CommonKey.InputUnit, CommonData.StringEmpty); dgcInventory.SetRowCellValue(CommonKey.QualityStatus, CommonData.StringEmpty); dgcInventory.SetRowCellValue(CommonKey.InputUnitPrice, "0"); dgcInventory.SetRowCellValue(CommonKey.InputAmount, "0"); } }
private void repositoryItemLookUpEditCate_EditValueChanged(object sender, EventArgs e) { LookUpEdit editor = gridView1.ActiveEditor as LookUpEdit; DataRowView rowView = (DataRowView)editor.GetSelectedDataRow(); DataRow dr = rowView.Row; contentFTTextEdit.Text = dr["ListIDSearch"].ToString(); }
private void grvTakeInDetail_CellValueChanged(object sender, DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs e) { if (e.Column.Name.Equals("bandedGridColumn10")) { if (l_CurItem != null) { int l_Unit_pk = CnvToInt32(((DataRowView)l_CurItem.GetSelectedDataRow()).Row["Unit_Pk"]); replkeditstyle.DataSource = UnitStyleDao.GetList_1(_ConfigItem, l_Unit_pk); } } }
private void lookUpCategory_EditValueChanged(object sender, EventArgs e) { LookUpEdit lookup = sender as LookUpEdit; ReferenceViewModel category = lookup.GetSelectedDataRow() as ReferenceViewModel; if (category.Code == DbConstant.REF_SPK_CATEGORY_SALE) { this.IsSPKSales = true; } }
protected object getValue(LookUpEdit lueControl, string strColName) { try { DataRow dr = ((DataRowView)lueControl.GetSelectedDataRow()).Row; return(dr[strColName]); } catch (Exception ex) { throw ex; } }
private void LkCustomerGroup_EditValueChanged(object sender, EventArgs e) { LookUpEdit lookUp = sender as LookUpEdit; if (lookUp.GetSelectedDataRow() is DataRowView dataRow) { if (dataRow != null) { CustomerGroupId = Convert.ToInt32(dataRow["ProductId"]); } } }
private void LkCustomerTypes_EditValueChanged(object sender, EventArgs e) { LookUpEdit lookUp = sender as LookUpEdit; if (lookUp.GetSelectedDataRow() is DataRowView dataRow) { if (dataRow != null) { sCustomerTypeId = Convert.ToInt32(dataRow["CustomerTypeId"]); } LoadCustomer(); } }
private void lookUpChangedSerialNumber_EditValueChanged(object sender, EventArgs e) { LookUpEdit lookup = sender as LookUpEdit; SpecialSparepartDetailViewModel wheelDetail = lookup.GetSelectedDataRow() as SpecialSparepartDetailViewModel; if (wheelDetail != null) { if (wheelDetail.PurchasingDetailId > 0) { this.Price = wheelDetail.PurchasingDetail.Price; } else if (wheelDetail.SparepartManualTransactionId > 0) { this.Price = wheelDetail.SparepartManualTransaction.Price; } this.txtChangedCode.EditValue = wheelDetail.Sparepart.Code; } }
private void resUnit_EditValueChanged(object sender, EventArgs e) { if (ViewMode == CommonData.Mode.View) { return; } LookUpEdit LookupEdit = sender as LookUpEdit; DataRowView SelectedDataRow = (DataRowView)LookupEdit.GetSelectedDataRow(); if (SelectedDataRow != null) { decimal unitPrice = CommonMethod.ParseDecimal(SelectedDataRow[CommonKey.SalesPrice]); decimal quantity = CommonMethod.ParseDecimal(dgvInventory.GetDataRow(dgvInventory.FocusedRowHandle)[CommonKey.InputQuantity]); decimal amount = unitPrice * quantity; dgcInventory.SetRowCellValue(CommonKey.InputUnitPrice, CommonMethod.ParseString(unitPrice)); dgcInventory.SetRowCellValue(CommonKey.InputAmount, CommonMethod.ParseString(amount)); } dgvInventory.PostEditor(); }
private void lookUpSparepart_EditValueChanged(object sender, EventArgs e) { if (this.SparepartId > 0) { //check if special sparepart LookUpEdit lookup = (LookUpEdit)sender; SparepartViewModel sparepart = (SparepartViewModel)lookup.GetSelectedDataRow(); if (sparepart.IsSpecialSparepart) { lookUpSerialNumber.Enabled = true; txtQty.Text = "1"; txtQty.Enabled = false; _presenter.LoadSSDetails(sparepart.Id); } else { lookUpSerialNumber.Enabled = false; txtQty.Text = "0"; txtQty.Enabled = true; } //check if used good ckeIsReturnRequired.Enabled = _presenter.IsUsedSparepartRequired(); ckeIsReturnRequired.Checked = false; //get last usage info _presenter.GetLastUsageRecord(); if (this.LastUsageRecord != null) { lblValLastUsageDate.Text = this.LastUsageRecord.CreateDate.ToShortDateString(); lblValLastUsageQty.Text = this.LastUsageRecord.TotalQuantity.ToString(); } else { lblValLastUsageDate.Text = "--"; lblValLastUsageQty.Text = "--"; } } }
private void lkCustomer_EditValueChanged(object sender, EventArgs e) { if (sender is LookUpEdit) { LookUpEdit lkTemp = sender as LookUpEdit; if (lkTemp.EditValue != null) { txtCustomerID.Text = lkTemp.EditValue.ToString(); DataRowView rowView = (DataRowView)lkTemp.GetSelectedDataRow(); DataRow row = rowView.Row; txtAddress.Text = row["Address"].ToString(); txtNumberID.Text = row["IDNumber"].ToString(); } else { txtCustomerID.Text = ""; txtAddress.Text = ""; txtNumberID.Text = ""; } } }
private void RefreshItemDataByParent(object sender) { if (ViewMode == CommonData.Mode.View) { return; } LookUpEdit LookupEdit = sender as LookUpEdit; DataRowView SelectedDataRow = (DataRowView)LookupEdit.GetSelectedDataRow(); if (SelectedDataRow != null) { dgcAdjustment.SetRowCellValueForBandedGridView(CommonKey.ItemType, CommonMethod.ParseString(SelectedDataRow[CommonKey.ItemType])); dgcAdjustment.SetRowCellValueForBandedGridView(CommonKey.ItemCode, CommonMethod.ParseString(SelectedDataRow["Code"])); dgcAdjustment.SetRowCellValueForBandedGridView(CommonKey.ItemName, CommonMethod.ParseString(SelectedDataRow["Name"])); dgcAdjustment.SetRowCellValueForBandedGridView("InputUnit", CommonMethod.ParseString(SelectedDataRow["InvUnitCode"])); //if (ProcessType == CommonData.ProcessType.FG) // dgcAdjustment.SetRowCellValueForBandedGridView(CommonKey.ProductionLine, CommonData.FG); if (!string.IsNullOrEmpty(QuanlityStatus)) { if (QuanlityStatus.IndexOf(",") == -1) { dgcAdjustment.SetRowCellValueForBandedGridView("QualityStatus", QuanlityStatus); } else { dgcAdjustment.SetRowCellValueForBandedGridView("QualityStatus", QuanlityStatus.Split(",".ToCharArray())[0]); } } else if (!string.IsNullOrEmpty(DefaultQualityStatus)) { dgcAdjustment.SetRowCellValueForBandedGridView("QualityStatus", DefaultQualityStatus); } //--StartUpdate 2014/06/05 (Kien) if (IsMinus) { dgcAdjustment.SetRowCellValueForBandedGridView(CommonKey.InputUnitPrice, CommonMethod.ParseString(SelectedDataRow[CommonKey.SalesPrice])); } else { dgcAdjustment.SetRowCellValueForBandedGridView(CommonKey.InputUnitPrice, CommonMethod.ParseString(SelectedDataRow[CommonKey.PurchasePrice])); } decimal quantity = CommonMethod.ParseDecimal(dgvAdjustment.GetRowCellValue(dgvAdjustment.FocusedRowHandle, CommonKey.InputQuantity)); dgcAdjustment.SetRowCellValueForBandedGridView(CommonKey.InputAmount, (quantity * CommonMethod.ParseDecimal(SelectedDataRow[CommonKey.PurchasePrice])).ToString()); //--EndUpdate //if (ShowProductionLine) // dgcInventory.SetRowCellValue("ProductionLine", CommonMethod.ParseString(SelectedDataRow["Line"])); } else { dgcAdjustment.SetRowCellValueForBandedGridView(CommonKey.ItemType, CommonData.StringEmpty); dgcAdjustment.SetRowCellValueForBandedGridView(CommonKey.ItemCode, CommonData.StringEmpty); dgcAdjustment.SetRowCellValueForBandedGridView(CommonKey.ItemName, CommonData.StringEmpty); dgcAdjustment.SetRowCellValueForBandedGridView("InputUnit", CommonData.StringEmpty); dgcAdjustment.SetRowCellValueForBandedGridView("QualityStatus", CommonData.StringEmpty); //--StartUpdate 2014/06/05 (Kien) dgcAdjustment.SetRowCellValueForBandedGridView(CommonKey.InputUnitPrice, "0"); dgcAdjustment.SetRowCellValueForBandedGridView(CommonKey.InputAmount, "0"); //--EndUpdate // dgcInventory.SetRowCellValue("ProductionLine", CommonData.StringEmpty); } }