Large diffs are not rendered by default.

@@ -1,4 +1,5 @@
using System;
using ChongGuanSafetySupervisionQZ.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -20,9 +21,67 @@ namespace ChongGuanSafetySupervisionQZ.View.WPF.Pages
/// </summary>
public partial class NewTalkPage : Page
{
private bool _isConfimPartyInfo = false;

public NewTalkPage()
{
InitializeComponent();

//TextBox_HomeAddress.DataContext = GlobalData.NewTalkViewModel;
Grid_Hardware_Status.DataContext = GlobalData.CheckingHardwareViewModel;
GlobalData.NewTalkViewModel = new ViewModel.NewTalkViewModel();
GroupBox_PartyInfo.DataContext = GlobalData.NewTalkViewModel;


this.Loaded += NewTalkPage_Loaded;
}

private void NewTalkPage_Loaded(object sender, RoutedEventArgs e)
{
_isConfimPartyInfo = false;
ChongGuanSafetySupervisionQZ.DAL.TalkTypeDAL talkTypeDAL = new DAL.TalkTypeDAL();

var result_t = talkTypeDAL.Query();

if (result_t.IsSuccessed)
{
List<QZ_TalkType> talkTypes = result_t.Data.ToList();

this.ComboBox_TalkTpye.ItemsSource = talkTypes;
this.ComboBox_TalkTpye.SelectedIndex = 0;
}


}

private void Button_Confim_Click(object sender, RoutedEventArgs e)
{
if (!_isConfimPartyInfo)
{
GlobalData.NewTalkViewModel.SavePartyInfo(GlobalData.CurrentDeparment.DeparmentId,GlobalData.CurrentUser.UserId);

GroupBox_PoliceInfo.Visibility = Visibility.Visible;
Button_Confim.Content = "开始谈话";
Button_ReGet.Content = "取消谈话";
_isConfimPartyInfo = true;
}
else
{

}
}

private void Button_ReGetInfo_Click(object sender, RoutedEventArgs e)
{
if (!_isConfimPartyInfo)
{
GlobalData.NewTalkViewModel.GetPartyInfoByIdCard("");
}
else
{
(Window.GetWindow(this) as HomeWindow).GoHome();
}

}
}
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -18,7 +18,11 @@ public class CheckingHardwareViewModel : INotifyPropertyChanged
public bool IsFingerprintGood { get => _isFingerprintGood; set => this.MutateVerbose(ref _isFingerprintGood, value, args => PropertyChanged?.Invoke(this, args)); }

private bool _isSignatureGood;
public bool IsSignatureGood { get => _isSignatureGood; set => this.MutateVerbose(ref _isSignatureGood, value, args => PropertyChanged?.Invoke(this, args)); }
public bool IsSignatureGood
{
get => _isSignatureGood;
set => this.MutateVerbose(ref _isSignatureGood, value, args => PropertyChanged?.Invoke(this, args));
}

private bool _isSceneCameraGood;
public bool IsSceneCameraGood { get => _isSceneCameraGood; set => this.MutateVerbose(ref _isSceneCameraGood, value, args => PropertyChanged?.Invoke(this, args)); }
@@ -42,6 +42,7 @@
<ItemGroup>
<Compile Include="CheckingHardwareViewModel.cs" />
<Compile Include="ChinaCitiesViewModel.cs" />
<Compile Include="NewTalkViewModel.cs" />
<Compile Include="NotifyPropertyChangedExtension.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
@@ -0,0 +1,119 @@
using ChongGuanSafetySupervisionQZ.Model;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ChongGuanSafetySupervisionQZ.ViewModel
{
public class NewTalkViewModel : INotifyPropertyChanged
{
private bool _isPartyInfoInDB = false;
public NewTalkViewModel()
{
_party = new QZ_Party();
_inquiry = new QZ_Inquiry();
}

private QZ_Party _party;

public QZ_Party Party
{
get => _party;
set
{
this.MutateVerbose(ref _party, value, args => PropertyChanged?.Invoke(this, args));
}
}

private QZ_Inquiry _inquiry;

public event PropertyChangedEventHandler PropertyChanged;

public QZ_Inquiry Inquiry
{
get => _inquiry;
set
{
this.MutateVerbose(ref _inquiry, value, args => PropertyChanged?.Invoke(this, args));
}
}


private string _partyAddress = "shit";

public string PartyAddress
{
get => _partyAddress;

set
{
this.MutateVerbose(ref _partyAddress, value, args => PropertyChanged?.Invoke(this, args));
}
}

public async void SavePartyInfo(string deparmentId,string userId)
{
ChongGuanSafetySupervisionQZ.DAL.PartyDAL partyDAL = new DAL.PartyDAL();
ResultData<QZ_Party> result;

if (_isPartyInfoInDB)
{
result = await partyDAL.Update(_party);
}
else
{
_party.CreateDepartmentId = deparmentId;
_party.CreateUserId = userId;
result = await partyDAL.Add(_party);
}

if(result.IsSuccessed)
{
Party = result.Data;
}
}


public void GetPartyInfoByIdCard(string idCardNumber)
{
ChongGuanSafetySupervisionQZ.DAL.PartyDAL partyDAL = new DAL.PartyDAL();

var result = partyDAL.Qurey("", "", "", idCardNumber);
if (result.IsSuccessed && result.Data.Count() > 0)
{
Party = result.Data.FirstOrDefault();
_isPartyInfoInDB = true;
}

//test
{
//Party = new QZ_Party
//{
// PartyAddress = "12点57分"
//};

Party.PartyAddress = "shishishit";
Party.PartyName = "张晓坤";
Party.PartyNational = "厕所吃屎";
Party.PartyCard = "110228198703140101";
Party.PartyNumber = "119";
Party.PartyDetentionDate = DateTime.Now.ToString();
Party.PartyPrison = "北京第一看守所";
Party.PartyMonitoringArea = "重刑犯";
Party.PartyMonitoringRoom = "001";
Party.PartyDetentionReason = "强奸母猪";
Party.PartySex = "";
Party.PartyBirth = "2014-10-10";
Party.PartyCardImageFilePath = @"C:\Users\PETTO\Desktop\xxx\阿里旺旺图片20180721192221.jpg";


Party = Party;

};
}
}

}
@@ -12,8 +12,10 @@ public static class NotifyPropertyChangedExtension
{
public static void MutateVerbose<TField>(this INotifyPropertyChanged instance, ref TField field, TField newValue, Action<PropertyChangedEventArgs> raise, [CallerMemberName] string propertyName = null)
{
if (EqualityComparer<TField>.Default.Equals(field, newValue)) return;
field = newValue;
if (!EqualityComparer<TField>.Default.Equals(field, newValue))
{
field = newValue;
}
raise?.Invoke(new PropertyChangedEventArgs(propertyName));
}
}
BIN +0 Bytes (100%) QZDatabase.db
Binary file not shown.