protected override string[] FormatExportRecord(object obj) { //return new string[]{((ASN)obj).StNo, // FormatHelper.ToDateString(((ASN)obj).CDate), // ((ASN)obj).CUser, // this.GetInvInName(((ASN)obj).StType), // ((ASN)obj).InvNo, // this.GetStatusName(((ASN)obj).Status), // ((ASN)obj).StorageCode, // FormatHelper.ToDateString(((ASN)obj).PreictDate), // ((ASN)obj).DirectFlag, // ((ASN)obj).PickNo, // ((ASN)obj).VendorCode, // ((ASN)obj).ExigencyFlag, // ((ASN)obj).RejectsFlag, // ((ASN)obj).OANo, // ((ASN)obj).PackingListNo, // FormatHelper.ToDateString(((ASN)obj).ProvideDate), // ((ASN)obj).GrossWeight.ToString(), // ((ASN)obj).Volume, // ((ASN)obj).FromStorageCode, // ((ASN)obj).Remark1 // }; string[] objs = new string[this.SAPHeadViewFieldList.Length]; ASN inv = obj as ASN; Type type = inv.GetType(); for (int i = 0; i < this.SAPHeadViewFieldList.Length; i++) { ViewField field = this.SAPHeadViewFieldList[i]; string strValue = string.Empty; System.Reflection.FieldInfo fieldInfo = type.GetField(field.FieldName); if (fieldInfo != null) { strValue = fieldInfo.GetValue(inv).ToString(); } if (field.FieldName == "CDate") { strValue = FormatHelper.ToDateString(inv.CDate); } else if (field.FieldName == "StorageInType") { strValue = this.GetInvInName(inv.StType); } else if (field.FieldName == "Status") { strValue = this.GetStatusName(inv.Status); } else if (field.FieldName == "PredictDate") { strValue = FormatHelper.ToDateString(inv.PreictDate); } else if (field.FieldName == "ProvideDate") { strValue = inv.ProvideDate;// FormatHelper.ToDateString(inv.ProvideDate); } objs[i] = strValue; } return(objs); }
protected override DataRow GetGridRow(object obj) { DataRow row = this.DtSource.NewRow(); //row["ASN"] = ((ASN)obj).StNo; //row["CDate"] = FormatHelper.ToDateString(((ASN)obj).CDate); //row["CUser"] = ((ASN)obj).CUser; //row["StorageInType"] =this.GetInvInName(((ASN)obj).StType); //row["SAPInvNo"] = ((ASN)obj).InvNo; //row["Status"] = this.GetStatusName(((ASN)obj).Status); //row["StorageInCode"] = ((ASN)obj).StorageCode; //row["PredictDate"] = FormatHelper.ToDateString(((ASN)obj).PreictDate); //row["DirectFlag"] = ((ASN)obj).DirectFlag; //row["PickNo"] = ((ASN)obj).PickNo; //row["VendorCode"] = ((ASN)obj).VendorCode; //row["ExigencyFlag"] = ((ASN)obj).ExigencyFlag; //row["RejectsFlag"] = ((ASN)obj).RejectsFlag; //row["OANo"] = ((ASN)obj).OANo; //row["PackingListNo"] = ((ASN)obj).PackingListNo; //row["ProvideDate"] = FormatHelper.ToDateString(((ASN)obj).ProvideDate); //row["GrossWeight"] = ((ASN)obj).GrossWeight; //row["Volume"] = ((ASN)obj).Volume; //row["FromStorageCode"] = ((ASN)obj).FromStorageCode; //row["Remark1"] = ((ASN)obj).Remark1; ASN inv = obj as ASN; Type type = inv.GetType(); if (this.SAPHeadViewFieldList.Length > 6) { for (int i = 0; i < 6; i++) { ViewField field = this.SAPHeadViewFieldList[i]; string strValue = string.Empty; System.Reflection.FieldInfo fieldInfo = type.GetField(field.FieldName); if (fieldInfo != null) { strValue = fieldInfo.GetValue(inv).ToString(); } if (field.FieldName == "CDate") { strValue = FormatHelper.ToDateString(inv.CDate); } else if (field.FieldName == "StType") { strValue = this.GetInvInName(inv.StType); } else if (field.FieldName == "StorageInType") { strValue = this.GetInvInName(inv.StType); } else if (field.FieldName == "Status") { strValue = this.GetStatusName(inv.Status); } else if (field.FieldName == "PredictDate") { strValue = FormatHelper.ToDateString(inv.PreictDate); } else if (field.FieldName == "ProvideDate") { strValue = inv.ProvideDate;// FormatHelper.ToDateString(inv.ProvideDate); } //PlanSendDate row[i + 1] = strValue; } for (int i = 6; i < this.SAPHeadViewFieldList.Length; i++) { ViewField field = this.SAPHeadViewFieldList[i]; string strValue = string.Empty; System.Reflection.FieldInfo fieldInfo = type.GetField(field.FieldName); if (fieldInfo != null) { strValue = fieldInfo.GetValue(inv).ToString(); } else if (field.FieldName == "StType") { strValue = this.GetInvInName(inv.StType); } if (field.FieldName == "CDate") { strValue = FormatHelper.ToDateString(inv.CDate); } else if (field.FieldName == "StorageInType") { strValue = this.GetInvInName(inv.StType); } else if (field.FieldName == "Status") { strValue = this.GetStatusName(inv.Status); } else if (field.FieldName == "PredictDate") { strValue = FormatHelper.ToDateString(inv.PreictDate); } else if (field.FieldName == "ProvideDate") { strValue = inv.ProvideDate;// FormatHelper.ToDateString(inv.ProvideDate); } //PlanSendDate row[i + 4] = strValue; } } else { for (int i = 0; i < this.SAPHeadViewFieldList.Length; i++) { ViewField field = this.SAPHeadViewFieldList[i]; string strValue = string.Empty; System.Reflection.FieldInfo fieldInfo = type.GetField(field.FieldName); if (fieldInfo != null) { strValue = fieldInfo.GetValue(inv).ToString(); } if (field.FieldName == "CDate") { strValue = FormatHelper.ToDateString(inv.CDate); } else if (field.FieldName == "StorageInType") { strValue = this.GetInvInName(inv.StType); } else if (field.FieldName == "Status") { strValue = this.GetStatusName(inv.Status); } else if (field.FieldName == "PredictDate") { strValue = FormatHelper.ToDateString(inv.PreictDate); } else if (field.FieldName == "ProvideDate") { strValue = inv.ProvideDate;// FormatHelper.ToDateString(inv.ProvideDate); } else if (field.FieldName == "FacName") { strValue = inv.ProvideDate;// FormatHelper.ToDateString(inv.ProvideDate); } //PlanSendDate row[i + 1] = strValue; } } return(row); }