private void setLottableValue(flrs2_res.UtilityHeader header) { this.receivelinereq.UtilityHeader.receiptkey = header.pro; this.receivelinereq.UtilityHeader.lottable01 = header.lottable1; this.receivelinereq.UtilityHeader.lottable02 = header.lottable2; this.receivelinereq.UtilityHeader.lottable03 = header.lottable3; this.receivelinereq.UtilityHeader.lottable04 = header.lottable4; this.receivelinereq.UtilityHeader.lottable05 = header.lottable5 == null ? string.Empty : header.lottable5; this.receivelinereq.UtilityHeader.lottable06 = header.lottable6 == null ? string.Empty : header.lottable6; ; this.receivelinereq.UtilityHeader.lottable07 = header.lottable7; this.receivelinereq.UtilityHeader.lottable08 = header.lottable8; this.receivelinereq.UtilityHeader.lottable09 = header.lottable9; this.receivelinereq.UtilityHeader.lottable10 = header.Lottable10; this.receivelinereq.UtilityHeader.lottable11 = header.lottable11; this.receivelinereq.UtilityHeader.lottable12 = header.lottable12; this.receivelinereq.UtilityHeader.lottable13 = header.lottable13; this.receivelinereq.UtilityHeader.lottable14 = header.lottable14; this.receivelinereq.UtilityHeader.lottable15 = header.lottable15; this.receivelinereq.UtilityHeader.lottable16 = header.lottable16; this.receivelinereq.UtilityHeader.lottable17 = header.lottable17; this.receivelinereq.UtilityHeader.lottable18 = header.lottable18; this.receivelinereq.UtilityHeader.lottable19 = header.lottable19; this.receivelinereq.UtilityHeader.lottable20 = header.lottable20; this.receivelinereq.UtilityHeader.lottable21 = header.lottable21; this.receivelinereq.UtilityHeader.lottable22 = header.lottable22; this.receivelinereq.UtilityHeader.lottable23 = header.lottable23; this.receivelinereq.UtilityHeader.lottable24 = header.lottable24; this.receivelinereq.UtilityHeader.lottable25 = header.lottable25; this.receivelinereq.UtilityHeader.lottable26 = header.lottable26; this.receivelinereq.UtilityHeader.lottable27 = header.lottable27; this.receivelinereq.UtilityHeader.lottable28 = header.lottable28; this.receivelinereq.UtilityHeader.lottable29 = header.lottable29; this.receivelinereq.UtilityHeader.lottable30 = header.lottable30; this.receivelinereq.UtilityHeader.lottable31 = header.lottable31; this.receivelinereq.UtilityHeader.lottable32 = header.lottable32; this.receivelinereq.UtilityHeader.lottable33 = header.lottable33; this.receivelinereq.UtilityHeader.lottable34 = header.lottable34; this.receivelinereq.UtilityHeader.lottable35 = header.lottable35; this.receivelinereq.UtilityHeader.lottable36 = header.lottable36; this.receivelinereq.UtilityHeader.lottable37 = header.lottable37; this.receivelinereq.UtilityHeader.lottable38 = header.lottable38; this.receivelinereq.UtilityHeader.lottable39 = header.lottable39; this.receivelinereq.UtilityHeader.lottable40 = header.lottable40; this.receivelinereq.UtilityHeader.lottable41 = header.lottable41; this.receivelinereq.UtilityHeader.lottable42 = header.lottable42; this.receivelinereq.UtilityHeader.lottable43 = header.lottable43; this.receivelinereq.UtilityHeader.lottable44 = header.lottable44; this.receivelinereq.UtilityHeader.lottable45 = header.lottable45; this.receivelinereq.UtilityHeader.lottable46 =""; this.receivelinereq.UtilityHeader.lottable47 = ""; }
private void createLottableControl(flrs2_res.UtilityHeader header) { int tab=28; if (header.VISISRP == "1") { this.receivelinereq.UtilityHeader.isrp = "Y"; this.AddControlToPanel("载具ID", this.dropid, tab++, true, "UtilityHeader.drid"); //InvokeHelper.Invoke(this, "AddControlToPanel", "载具ID", "", tab++, true, "UtilityHeader.drid"); //InvokeHelper.Invoke(this, "AddControlToPanel", "载具ID", this.dropid, tab++, true, "UtilityHeader.drid"); } foreach (var prop in header.GetType().GetProperties()) { if (prop.Name.ToLower().IndexOf("field") > -1) { //System.Diagnostics.Debug.WriteLine(prop.Name + "-" + prop.GetValue(header, new object[] { }).ToString()); int val=Convert.ToInt32( prop.GetValue(header, new object[] { }).ToString()); string fieldname = prop.Name; string[] numbers = Regex.Split(fieldname, @"\D+"); int num =Convert.ToInt32(numbers[1]); if (val > 0) { if (Convert.ToBoolean(num & 1)) { int isrequirednum = Convert.ToInt32(header.GetPropValue(string.Format("Field{0}", num + 1)).ToString()); bool isrequired = Convert.ToBoolean(isrequirednum); int valfieldidx =1; if(num>2) valfieldidx = (num / 2)+1; string label = header.GetPropValue(string.Format("lo{0}", valfieldidx)).ToString(); string text =string.Empty; if(valfieldidx==10) text = header.GetPropValue(string.Format("Lottable{0}", valfieldidx)).ToString(); else text = header.GetPropValue(string.Format("lottable{0}", valfieldidx)).ToString(); string filedmember = string.Format("UtilityHeader.lottable{0}", valfieldidx.ToString("00")); //rfFieldTextBox fieldtext = new rfFieldTextBox(label, text); //fieldtext.DataBinding(this.receivelinereq, filedmember); //InvokeHelper.Invoke(this, "AddControlToPanel", label, text, tab++, isrequired, filedmember); this.AddControlToPanel(label, text, tab++, isrequired, filedmember); } } } } }