protected override DataRow GetGridRow(object obj) { WarehouseFacade _WarehouseFacade = new WarehouseFacade(base.DataProvider); DataRow row = this.DtSource.NewRow(); SAPInvoicesQuery pick = obj as SAPInvoicesQuery; Type type = pick.GetType(); for (int i = 0; i < this.PickHeadViewFieldList.Length; i++) { ViewField field = this.PickHeadViewFieldList[i]; string strValue = string.Empty; System.Reflection.FieldInfo fieldInfo = type.GetField(field.FieldName.ToUpper()); if (fieldInfo != null) { if (field.FieldName == "DNBatchNo") { strValue = pick.DNNO; } else if (field.FieldName == "REMARK1") { strValue = pick.REMARK1; } else if (field.FieldName == "FROMSTORAGECODE") { strValue = pick.FROMSTORAGECODE; if (pick.INVTYPE == "PRC" || pick.INVTYPE == "YFR" || pick.INVTYPE == "GZC") { strValue = pick.STORAGECODE; } } else if (field.FieldName == "STORAGECODE") { strValue = pick.STORAGECODE; if (pick.INVTYPE == "PRC" || pick.INVTYPE == "YFR" || pick.INVTYPE == "GZC") { strValue = ""; } } #region SAP //else if (field.FieldName == "CREATEUSER") //{ // if (!string.IsNullOrEmpty(pick.CREATEUSER)) // { // strValue = pick.CREATEUSER; // } // else // { // strValue = pick.DNMUSER; // } //} //else if (field.FieldName == "POUPDATEDATE") //{ // if (pick.POUPDATEDATE != 0) // { // strValue = FormatHelper.ToDateString(pick.POUPDATEDATE); // } // else // { // strValue = FormatHelper.ToDateString(pick.DNMDATE); // } //} //else if (field.FieldName == "POUPDATETIME") //{ // if (pick.POUPDATEDATE != 0) // { // strValue = FormatHelper.ToTimeString(pick.POUPDATETIME); // } // else // { // strValue = FormatHelper.ToTimeString(pick.DNMTIME); // } //} #endregion #region MES //else if (field.FieldName == "MESCDate") //{ // strValue = FormatHelper.ToDateString(pick.CDate); //} else if (field.FieldName == "MESCTIME") { strValue = FormatHelper.ToTimeString(pick.CTIME); } else if (field.FieldName == "MESCUSER") { strValue = pick.CUSER; } else if (field.FieldName == "MESMUSER") { strValue = pick.MUSER; } //else if (field.FieldName == "MESMTIME") //{ // strValue = FormatHelper.ToDateString(pick.MaintainDate); //} else if (field.FieldName == "MESMTIME") { strValue = FormatHelper.ToTimeString(pick.MTIME); } else if (field.FieldName == "NOTOUTCHECKFLAG") { if (string.IsNullOrEmpty(pick.NOTOUTCHECKFLAG)) { strValue = "否"; } else if (pick.NOTOUTCHECKFLAG.ToUpper() == "X") { strValue = "是"; } else { strValue = pick.NOTOUTCHECKFLAG; } } #endregion else { strValue = fieldInfo.GetValue(pick).ToString(); } } row[this.PickHeadViewFieldList[i].FieldName] = strValue; if (this.PickHeadViewFieldList[i].FieldName == "DQMCODE") { BenQGuru.eMES.Domain.MOModel.Material m = (BenQGuru.eMES.Domain.MOModel.Material)_WarehouseFacade.GetMaterialFromDQMCode(((SAPInvoicesQuery)obj).DQMCODE); if (m != null) { row["DQMCHLONGDESC"] = m.MchlongDesc; } else { row["DQMCHLONGDESC"] = string.Empty; } } } return(row); }
protected override string[] FormatExportRecord(object obj) { string[] objs = new string[this.PickHeadViewFieldList.Length]; SAPInvoicesQuery pick = obj as SAPInvoicesQuery; Type type = pick.GetType(); for (int i = 0; i < this.PickHeadViewFieldList.Length; i++) { ViewField field = this.PickHeadViewFieldList[i]; string strValue = string.Empty; System.Reflection.FieldInfo fieldInfo = type.GetField(field.FieldName.ToUpper()); if (fieldInfo != null) { if (field.FieldName == "DNBatchNo") { strValue = pick.DNNO; } else if (field.FieldName == "REMARK1") { strValue = pick.REMARK1; } else if (field.FieldName == "FROMSTORAGECODE") { strValue = pick.FROMSTORAGECODE; if (pick.INVTYPE == "PRC" || pick.INVTYPE == "YFR" || pick.INVTYPE == "GZC") { strValue = pick.STORAGECODE; } } else if (field.FieldName == "STORAGECODE") { strValue = pick.STORAGECODE; if (pick.INVTYPE == "PRC" || pick.INVTYPE == "YFR" || pick.INVTYPE == "GZC") { strValue = ""; } } #region SAP //else if (field.FieldName == "CREATEUSER") //{ // if (!string.IsNullOrEmpty(pick.CREATEUSER)) // { // strValue = pick.CREATEUSER; // } // else // { // strValue = pick.DNMUSER; // } //} //else if (field.FieldName == "POUPDATEDATE") //{ // if (pick.POUPDATEDATE != 0) // { // strValue = FormatHelper.ToDateString(pick.POUPDATEDATE); // } // else // { // strValue = FormatHelper.ToDateString(pick.DNMDATE); // } //} //else if (field.FieldName == "POUPDATETIME") //{ // if (pick.POUPDATEDATE != 0) // { // strValue = FormatHelper.ToTimeString(pick.POUPDATETIME); // } // else // { // strValue = FormatHelper.ToTimeString(pick.DNMTIME); // } //} else if (field.FieldName == "POCREATEDATE") { strValue = FormatHelper.ToDateString(pick.POCREATEDATE); } else if (field.FieldName == "POUPDATEDATE") { strValue = FormatHelper.ToDateString(pick.POUPDATEDATE); } else if (field.FieldName == "POUPDATETIME") { strValue = FormatHelper.ToTimeString(pick.POUPDATETIME); } #endregion #region MES //else if (field.FieldName == "MESCDate") //{ // strValue = FormatHelper.ToDateString(pick.CDate); //} else if (field.FieldName == "MESCTIME") { strValue = FormatHelper.ToTimeString(pick.CTIME); } else if (field.FieldName == "MESCUSER") { strValue = pick.CUSER; } else if (field.FieldName == "MESMUSER") { strValue = pick.MUSER; } //else if (field.FieldName == "MESMTIME") //{ // strValue = FormatHelper.ToDateString(pick.MaintainDate); //} else if (field.FieldName == "MESMTIME") { strValue = FormatHelper.ToTimeString(pick.MTIME); } #endregion else { strValue = fieldInfo.GetValue(pick).ToString(); } } objs[i] = strValue; } return(objs); }
protected override DataRow GetGridRow(object obj) { DataRow row = this.DtSource.NewRow(); SAPInvoicesQuery pick = obj as SAPInvoicesQuery; Type type = pick.GetType(); for (int i = 0; i < this.PickHeadViewFieldList.Length; i++) { ViewField field = this.PickHeadViewFieldList[i]; string strValue = string.Empty; System.Reflection.FieldInfo fieldInfo = type.GetField(field.FieldName.ToUpper()); if (fieldInfo != null) { if (field.FieldName == "DNBatchNo") { strValue = pick.DNNO; } else if (field.FieldName == "REMARK1") { strValue = pick.REMARK1; } else if (field.FieldName == "FROMSTORAGECODE") { strValue = pick.FROMSTORAGECODE; if (pick.INVTYPE == "PRC" || pick.INVTYPE == "YFR" || pick.INVTYPE == "GZC") { strValue = pick.STORAGECODE; } } else if (field.FieldName == "STORAGECODE") { strValue = pick.STORAGECODE; if (pick.INVTYPE == "PRC" || pick.INVTYPE == "YFR" || pick.INVTYPE == "GZC") { strValue = ""; } } #region SAP //else if (field.FieldName == "CREATEUSER") //{ // if (!string.IsNullOrEmpty(pick.CREATEUSER)) // { // strValue = pick.CREATEUSER; // } // else // { // strValue = pick.DNMUSER; // } //} //else if (field.FieldName == "POUPDATEDATE") //{ // if (pick.POUPDATEDATE != 0) // { // strValue = FormatHelper.ToDateString(pick.POUPDATEDATE); // } // else // { // strValue = FormatHelper.ToDateString(pick.DNMDATE); // } //} //else if (field.FieldName == "POUPDATETIME") //{ // if (pick.POUPDATEDATE != 0) // { // strValue = FormatHelper.ToTimeString(pick.POUPDATETIME); // } // else // { // strValue = FormatHelper.ToTimeString(pick.DNMTIME); // } //} #endregion #region MES //else if (field.FieldName == "MESCDate") //{ // strValue = FormatHelper.ToDateString(pick.CDate); //} else if (field.FieldName == "MESCTIME") { strValue = FormatHelper.ToTimeString(pick.CTIME); } else if (field.FieldName == "MESCUSER") { strValue = pick.CUSER; } else if (field.FieldName == "MESMUSER") { strValue = pick.MUSER; } //else if (field.FieldName == "MESMTIME") //{ // strValue = FormatHelper.ToDateString(pick.MaintainDate); //} else if (field.FieldName == "MESMTIME") { strValue = FormatHelper.ToTimeString(pick.MTIME); } else if (field.FieldName == "NOTOUTCHECKFLAG") { if (string.IsNullOrEmpty(pick.NOTOUTCHECKFLAG)) { strValue = "否"; } else if (pick.NOTOUTCHECKFLAG.ToUpper() == "X") { strValue = "是"; } else { strValue = pick.NOTOUTCHECKFLAG; } } #endregion else { strValue = fieldInfo.GetValue(pick).ToString(); } } row[i + 1] = strValue; } return(row); }