public BaseResponseModel AddUser(ResponseUserInfoModel request) { try { string result = HttpUtils.PostRequest(AppConfigMoel.URL + ConstantsValue.HTTP_ADD_USER_URI, JsonConvert.SerializeObject(request), AppConfigMoel.token); BaseResponseModel responseModel = JsonConvert.DeserializeObject <BaseResponseModel>(result); return(responseModel); } catch (Exception) { throw; } }
public BaseResponseModel UpdateUser(ResponseUserInfoModel request) { throw new NotImplementedException(); }
private void add_btn(object sender, RoutedEventArgs e) { if (this.userId.Text == String.Empty) { System.Windows.MessageBox.Show("用户名不能为空", "系统提示", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Information); return; } if (this.phone.Text == String.Empty) { System.Windows.MessageBox.Show("联系方式不能为空", "系统提示", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Information); return; } if (this.usertype.SelectedIndex == -1) { System.Windows.MessageBox.Show("用户类型不能为空", "系统提示", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Information); return; } if (this.area.Text == String.Empty) { System.Windows.MessageBox.Show("供热面积不能为空", "系统提示", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Information); return; } if (this.controllerType.SelectedIndex == -1) { System.Windows.MessageBox.Show("门阀类型不能为空", "系统提示", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Information); return; } if (this.controllerCode.Text == String.Empty) { System.Windows.MessageBox.Show("门阀序列号不能为空", "系统提示", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Information); return; } if (this.build.Text == String.Empty) { System.Windows.MessageBox.Show("楼号不能为空", "系统提示", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Information); return; } if (this.unit.Text == String.Empty) { System.Windows.MessageBox.Show("单元不能为空", "系统提示", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Information); return; } if (this.room.Text == String.Empty) { System.Windows.MessageBox.Show("室不能为空", "系统提示", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Information); return; } if (this.com_province.SelectedIndex == -1) { System.Windows.MessageBox.Show("省份不能为空", "系统提示", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Information); return; } var userId = this.userId.Text.Trim(); var phone = this.phone.Text.Trim(); var usertype = this.usertype.SelectedIndex.ToString(); var area = this.area.Text.Trim(); var controllerType = this.controllerType.SelectedIndex.ToString(); var controllerCode = this.controllerCode.Text.Trim(); var build = this.build.Text.Trim(); var unit = this.unit.Text.Trim(); var room = this.room.Text.Trim(); ResponseUserInfoModel request = new ResponseUserInfoModel(); request.name = userId; request.phone = phone; request.userType = usertype; request.area = area; request.controllerType = controllerType; request.controllerCode = controllerCode; request.build = build; request.unit = unit; request.room = room; request.hourseCode = "1231"; request.provice = "浙江"; request.city = "杭州";; request.county = "滨江";; request.street = "浦沿";; request.village = "新村";; BaseResponseModel response = new ApiImpl().AddUser(request); if (response != null && response.code == "200") { //System.Windows.MessageBox.Show("添加成功", "系统提示", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Information); System.Windows.MessageBox.Show(response.msg.ToString(), "系统提示", System.Windows.MessageBoxButton.OK, System.Windows.MessageBoxImage.Information); } }