public void InitData(object config) { Reback = config as EBMConfigure.Reback; pnlAddressType.InitAddressType(Reback.B_Address_type); cbBoxB_reback_type.SelectedValue = Reback.B_reback_type; switch (Reback.B_reback_type) { case (byte)1: textS_reback_address.Text = Reback.S_reback_address; textS_reback_address2.Text = "123"; break; case (byte)2: case (byte)4: case (byte)6: case (byte)8: textS_reback_address.Text = Reback.S_reback_address + ":" + Reback.I_reback_port.ToString(); textS_reback_address2.Text = Reback.S_reback_address_backup + ":" + Reback.I_reback_port_Backup.ToString(); break; case (byte)3: case (byte)5: case (byte)7: case (byte)9: textS_reback_address.Text = Reback.S_reback_address + ":" + Reback.I_reback_port.ToString(); break; } pnlTerminalAddress.InitData(Reback.Configure.list_Terminal_Address); }
public void InitData(object config) { Reback = config as EBMConfigure.Reback; pnlAddressType.InitAddressType(Reback.B_Address_type); cbBoxB_reback_type.SelectedValue = Reback.B_reback_type; textS_reback_address.Text = Reback.S_reback_address; pnlTerminalAddress.InitData(Reback.Configure.list_Terminal_Address); }
public EBMConfigure.Reback GetData() { try { if (Reback == null) { Reback = new EBMConfigure.Reback(); } EBConfigureRebackGX config = new EBConfigureRebackGX(); Reback.Configure = config; Reback.B_Address_type = pnlAddressType.GetAddressType(); Reback.B_reback_type = (byte)cbBoxB_reback_type.SelectedValue; switch (Reback.B_reback_type) { case (byte)1: Reback.S_reback_address = textS_reback_address.Text.Trim(); break; case (byte)2: case (byte)4: case (byte)6: case (byte)8: Reback.S_reback_address = textS_reback_address.Text.Trim().Split(':')[0]; Reback.I_reback_port = Convert.ToInt32(textS_reback_address.Text.Trim().Split(':')[1]); Reback.S_reback_address_backup = textS_reback_address2.Text.Trim().Split(':')[0]; Reback.I_reback_port_Backup = Convert.ToInt32(textS_reback_address2.Text.Trim().Split(':')[1]); break; case (byte)3: case (byte)5: case (byte)7: case (byte)9: string[] str = textS_reback_address.Text.Trim().Split(':'); string port = str[str.Length - 1]; Reback.S_reback_address = textS_reback_address.Text.Trim().Replace(":" + port, ""); Reback.I_reback_port = Convert.ToInt32(port); break; } Reback.Configure.list_Terminal_Address = pnlTerminalAddress.GetData(); return(Reback); } catch { return(null); } }
public EBMConfigure.Reback GetData() { try { if (Reback == null) { Reback = new EBMConfigure.Reback(); } EBConfigureReback config = new EBConfigureReback(); Reback.Configure = config; Reback.B_Address_type = pnlAddressType.GetAddressType(); Reback.B_reback_type = (byte)cbBoxB_reback_type.SelectedValue; Reback.S_reback_address = textS_reback_address.Text.Trim(); Reback.Configure.list_Terminal_Address = pnlTerminalAddress.GetData(); return(Reback); } catch { return(null); } }