Ejemplo n.º 1
0
        /// <summary>
        /// EditWellInfoForm
        /// </summary>
        /// <param name="terminal_ID">人井编号</param>
        /// <param name="isInsert">是否是添加</param>
        /// <param name="isaddMaker">是否是在地图上添加</param>
        /// <param name="menuPositon">在地图上添加时经纬度</param>
        public EditWellInfoForm(string terminal_ID, bool isInsert, bool isaddMaker, string menuPositon)
        {
            InitializeComponent();
            wellInfo.Terminal_ID = terminal_ID;
            _isInsert            = isInsert;

            cbState.DataSource    = wellStateService.GetWellStateInfo();
            cbOperator.DataSource = userService.GetOperator();
            if (isInsert)
            {
                if (isaddMaker)
                {
                    txtLongitude.Text = menuPositon.Split(',')[0];
                    txtLatitude.Text  = menuPositon.Split(',')[1];
                }
                this.Text = "添加数据";
                this.Icon = new Icon("resource/images/add.ico");
            }
            else
            {
                this.Text = "更新数据";
                this.Icon = new Icon("resource/images/update.ico");
                txtTerminal_ID.Enabled = false;
                wellInfo = wellInfoService.GetWellInfoByTerminal_ID(wellInfo.Terminal_ID);

                txtTerminal_ID.Text    = wellInfo.Terminal_ID;
                txtName.Text           = wellInfo.Name;
                txtLongitude.Text      = wellInfo.Longitude;
                txtLatitude.Text       = wellInfo.Latitude;
                txtPlace.Text          = wellInfo.Place;
                txtTerminal_Phone.Text = wellInfo.Terminal_Phone;
                cbState.Text           = wellInfo.WellStateInfo.State;
                cbOperator.Text        = wellInfo.OperatorInfo.RealName;
                tbReportInterval.Text  = wellInfo.ReportNumInfo.ReportInterval.ToString();
            }
        }