public void btnSave_Click(object sender, EventArgs e) { string strErr=""; if(!PageValidate.IsDecimal(txtlocation_lat.Text)) { strErr+="location_lat格式错误!\\n"; } if(!PageValidate.IsDecimal(txtlocation_lng.Text)) { strErr+="location_lng格式错误!\\n"; } if(strErr!="") { MessageBox.Show(this,strErr); return; } int gps_id=int.Parse(this.lblgps_id.Text); string user_telphone=this.lbluser_telphone.Text; decimal location_lat=decimal.Parse(this.txtlocation_lat.Text); decimal location_lng=decimal.Parse(this.txtlocation_lng.Text); la.Model.gpslocation model=new la.Model.gpslocation(); model.gps_id=gps_id; model.user_telphone=user_telphone; model.location_lat=location_lat; model.location_lng=location_lng; la.BLL.gpslocation bll=new la.BLL.gpslocation(); bll.Update(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this,"保存成功!","list.aspx"); }
private void ShowInfo(int gps_id,string user_telphone) { la.BLL.gpslocation bll=new la.BLL.gpslocation(); la.Model.gpslocation model=bll.GetModel(gps_id,user_telphone); this.lblgps_id.Text=model.gps_id.ToString(); this.lbluser_telphone.Text=model.user_telphone; this.lbllocation_lat.Text=model.location_lat.ToString(); this.lbllocation_lng.Text=model.location_lng.ToString(); }
protected void btnSave_Click(object sender, EventArgs e) { string strErr=""; if(!PageValidate.IsNumber(txtgps_id.Text)) { strErr+="gps定位编码格式错误!\\n"; } if(this.txtuser_telphone.Text.Trim().Length==0) { strErr+="用户Phone不能为空!\\n"; } if(!PageValidate.IsDecimal(txtlocation_lat.Text)) { strErr+="location_lat格式错误!\\n"; } if(!PageValidate.IsDecimal(txtlocation_lng.Text)) { strErr+="location_lng格式错误!\\n"; } if(strErr!="") { MessageBox.Show(this,strErr); return; } int gps_id=int.Parse(this.txtgps_id.Text); string user_telphone=this.txtuser_telphone.Text; decimal location_lat=decimal.Parse(this.txtlocation_lat.Text); decimal location_lng=decimal.Parse(this.txtlocation_lng.Text); la.Model.gpslocation model=new la.Model.gpslocation(); model.gps_id=gps_id; model.user_telphone=user_telphone; model.location_lat=location_lat; model.location_lng=location_lng; la.BLL.gpslocation bll=new la.BLL.gpslocation(); bll.Add(model); Maticsoft.Common.MessageBox.ShowAndRedirect(this,"保存成功!","add.aspx"); }