Commit 13cc06cf authored by 姜春辉's avatar 姜春辉

修正宿舍考勤页面列表显示不正确的BUG

parent 7e59fa22
...@@ -40,6 +40,6 @@ namespace DashBoard.ServiceModel ...@@ -40,6 +40,6 @@ namespace DashBoard.ServiceModel
/// <summary> /// <summary>
/// 考勤状态 /// 考勤状态
/// </summary> /// </summary>
public string State { get; set; } public string Remark { get; set; }
} }
} }
...@@ -51,5 +51,5 @@ using System.Windows; ...@@ -51,5 +51,5 @@ using System.Windows;
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 // 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
// 方法是按如下所示使用“*”: : // 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.1.2")] [assembly: AssemblyVersion("1.0.1.3")]
[assembly: AssemblyFileVersion("1.0.1.2")] [assembly: AssemblyFileVersion("1.0.1.3")]
...@@ -20,7 +20,7 @@ namespace SchoolSituation ...@@ -20,7 +20,7 @@ namespace SchoolSituation
get { return _PingFen; } get { return _PingFen; }
set { _PingFen = value; RaisePropertyChanged("PingFen"); } set { _PingFen = value; RaisePropertyChanged("PingFen"); }
} }
private ObservableCollection<ViewPingFen> _PF; private ObservableCollection<ViewPingFen> _PF = new ObservableCollection<ViewPingFen>();
public ObservableCollection<ViewPingFen> PF public ObservableCollection<ViewPingFen> PF
{ {
...@@ -96,7 +96,7 @@ namespace SchoolSituation ...@@ -96,7 +96,7 @@ namespace SchoolSituation
public Visibility kqhide public Visibility kqhide
{ {
get { return _kqhide; } get { return _kqhide; }
set { _kqhide = value;RaisePropertyChanged("kqhide"); } set { _kqhide = value; RaisePropertyChanged("kqhide"); }
} }
private Visibility _pfhide; private Visibility _pfhide;
public Visibility pfhide public Visibility pfhide
...@@ -123,21 +123,29 @@ namespace SchoolSituation ...@@ -123,21 +123,29 @@ namespace SchoolSituation
} }
else else
{ {
Application.Current.Dispatcher.BeginInvoke(new Action(() =>
{
ShowList.Clear();
}));
KQTipMsg = "并没有找到任何数据..."; KQTipMsg = "并没有找到任何数据...";
kqhide = Visibility.Visible; kqhide = Visibility.Visible;
} }
} }
else else
{ {
Application.Current.Dispatcher.BeginInvoke(new Action(() =>
{
ShowList.Clear();
}));
KQTipMsg = "网络好像出现了异常..."; KQTipMsg = "网络好像出现了异常...";
kqhide = Visibility.Visible; kqhide = Visibility.Visible;
} }
}).ContinueWith(task => }).ContinueWith(task =>
{ {
CanCloseDetail = true; CanCloseDetail = true;
}); });
} }
private void Loaddatapf(Guid id) private void Loaddatapf(Guid id)
{ {
var serviceUrl = new Uri($"{Source}?DataType=pingfen&RoomID={id}&NowTime={DateTime.Now.ToString("MM-dd")}"); var serviceUrl = new Uri($"{Source}?DataType=pingfen&RoomID={id}&NowTime={DateTime.Now.ToString("MM-dd")}");
Task.Run(() => Task.Run(() =>
...@@ -149,24 +157,32 @@ namespace SchoolSituation ...@@ -149,24 +157,32 @@ namespace SchoolSituation
if (result) if (result)
{ {
PingFen = (ViewSuShe_PingFen)pingfen; PingFen = (ViewSuShe_PingFen)pingfen;
if (PingFen.msg!=null) if (PingFen.msg != null)
{ {
PF = new ObservableCollection<ViewPingFen>(PingFen.msg); PF = new ObservableCollection<ViewPingFen>(PingFen.msg);
pfhide = Visibility.Hidden; pfhide = Visibility.Hidden;
} }
else else
{ {
Application.Current.Dispatcher.BeginInvoke(new Action(() =>
{
PF.Clear();
}));
PFTipMsg = "并没有找到任何数据..."; PFTipMsg = "并没有找到任何数据...";
pfhide = Visibility.Visible; pfhide = Visibility.Visible;
} }
} }
else else
{ {
Application.Current.Dispatcher.BeginInvoke(new Action(() =>
{
PF.Clear();
}));
PFTipMsg = "网络好像出现了异常..."; PFTipMsg = "网络好像出现了异常...";
pfhide = Visibility.Visible; pfhide = Visibility.Visible;
} }
}).ContinueWith(task => }).ContinueWith(task =>
{ {
CanCloseDetail = true; CanCloseDetail = true;
}); });
} }
...@@ -182,7 +198,7 @@ namespace SchoolSituation ...@@ -182,7 +198,7 @@ namespace SchoolSituation
public Guid dorID public Guid dorID
{ {
get { return _dorID; } get { return _dorID; }
set { _dorID = value;RaisePropertyChanged("dorID"); } set { _dorID = value; RaisePropertyChanged("dorID"); }
} }
public RelayCommand<ViewSuShe> ShowDetailCommand => new RelayCommand<ViewSuShe>(item => public RelayCommand<ViewSuShe> ShowDetailCommand => new RelayCommand<ViewSuShe>(item =>
{ {
...@@ -224,7 +240,7 @@ namespace SchoolSituation ...@@ -224,7 +240,7 @@ namespace SchoolSituation
{ {
Days.Clear(); Days.Clear();
DateTime startDate = DateTime.Now.AddDays((obj.PageIndex - 1) * -7); DateTime startDate = DateTime.Now.AddDays((obj.PageIndex - 1) * -7);
for (int i =-6; i<=0; i++) for (int i = -6; i <= 0; i++)
{ {
Days.Add(new CustomDay(startDate.AddDays(i))); Days.Add(new CustomDay(startDate.AddDays(i)));
} }
...@@ -234,19 +250,19 @@ namespace SchoolSituation ...@@ -234,19 +250,19 @@ namespace SchoolSituation
public string Par public string Par
{ {
get { return _Par; } get { return _Par; }
set { _Par = value;RaisePropertyChanged("Par"); } set { _Par = value; RaisePropertyChanged("Par"); }
} }
private string _DateStr; private string _DateStr;
public string DateStr public string DateStr
{ {
get { return _DateStr; } get { return _DateStr; }
set { _DateStr = value;RaisePropertyChanged("DateStr"); } set { _DateStr = value; RaisePropertyChanged("DateStr"); }
} }
private string _WeekStr; private string _WeekStr;
public string WeekStr public string WeekStr
{ {
get { return _WeekStr; } get { return _WeekStr; }
set { _WeekStr = value;RaisePropertyChanged("WeekStr"); } set { _WeekStr = value; RaisePropertyChanged("WeekStr"); }
} }
public CustomDay CurrentDay { get; set; } public CustomDay CurrentDay { get; set; }
public RelayCommand<CustomDay> SelectDay => new RelayCommand<CustomDay>(item => public RelayCommand<CustomDay> SelectDay => new RelayCommand<CustomDay>(item =>
...@@ -260,13 +276,13 @@ namespace SchoolSituation ...@@ -260,13 +276,13 @@ namespace SchoolSituation
Par = CurrentDay.Date.ToString("MM-dd"); Par = CurrentDay.Date.ToString("MM-dd");
DateStr = CurrentDay.Date.ToString("yyyy-MM-dd"); DateStr = CurrentDay.Date.ToString("yyyy-MM-dd");
WeekStr = CurrentDay.WeekString; WeekStr = CurrentDay.WeekString;
if(PF!=null) if (PF != null)
PF.Clear(); PF.Clear();
LoadData(id); LoadData(id);
LoadDatapf(id); LoadDatapf(id);
} }
}); });
private bool isfirstkq = true; private bool isfirstkq = true;
private bool isfirstpf = true; private bool isfirstpf = true;
public void LoadData(Guid cid) public void LoadData(Guid cid)
...@@ -277,7 +293,7 @@ namespace SchoolSituation ...@@ -277,7 +293,7 @@ namespace SchoolSituation
return; return;
} }
var serviceUrl = new Uri($"{Source}?DataType=kaoqin&RoomID={cid}&NowTime={Par}"); var serviceUrl = new Uri($"{Source}?DataType=kaoqin&RoomID={cid}&NowTime={Par}");
Task.Run(() => Task.Run(() =>
{ {
kqhide = Visibility.Visible; kqhide = Visibility.Visible;
...@@ -288,19 +304,27 @@ namespace SchoolSituation ...@@ -288,19 +304,27 @@ namespace SchoolSituation
{ {
if (list.Count > 0) if (list.Count > 0)
{ {
ShowList = new ObservableCollection<ViewSuShe_KaoQin>(list.Select(ss => (ViewSuShe_KaoQin)ss).ToList()); ShowList = new ObservableCollection<ViewSuShe_KaoQin>(list.Select(ss => (ViewSuShe_KaoQin)ss).ToList());
kqhide = Visibility.Hidden; kqhide = Visibility.Hidden;
} }
else else
{ {
Application.Current.Dispatcher.BeginInvoke(new Action(() =>
{
ShowList.Clear();
}));
KQTipMsg = "并没有找到任何数据..."; KQTipMsg = "并没有找到任何数据...";
kqhide = Visibility.Visible; kqhide = Visibility.Visible;
} }
} }
else else
{ {
Application.Current.Dispatcher.BeginInvoke(new Action(() =>
{
ShowList.Clear();
}));
KQTipMsg = "网络好像出现了异常..."; KQTipMsg = "网络好像出现了异常...";
kqhide = Visibility.Visible; kqhide = Visibility.Visible;
} }
...@@ -319,7 +343,7 @@ namespace SchoolSituation ...@@ -319,7 +343,7 @@ namespace SchoolSituation
isfirstpf = false; isfirstpf = false;
return; return;
} }
var serviceUrl = new Uri($"{Source}?DataType=pingfen&RoomID={cid}&NowTime={Par}"); var serviceUrl = new Uri($"{Source}?DataType=pingfen&RoomID={cid}&NowTime={Par}");
Task.Run(() => Task.Run(() =>
{ {
pfhide = Visibility.Visible; pfhide = Visibility.Visible;
...@@ -329,24 +353,32 @@ namespace SchoolSituation ...@@ -329,24 +353,32 @@ namespace SchoolSituation
if (result) if (result)
{ {
PingFen = (ViewSuShe_PingFen)pingfen; PingFen = (ViewSuShe_PingFen)pingfen;
if (PingFen.msg!=null) if (PingFen.msg != null)
{ {
PF = new ObservableCollection<ViewPingFen>(PingFen.msg); PF = new ObservableCollection<ViewPingFen>(PingFen.msg);
pfhide = Visibility.Hidden; pfhide = Visibility.Hidden;
} }
else else
{ {
Application.Current.Dispatcher.BeginInvoke(new Action(() =>
{
PF.Clear();
}));
PFTipMsg = "并没有找到任何数据..."; PFTipMsg = "并没有找到任何数据...";
pfhide = Visibility.Visible; pfhide = Visibility.Visible;
} }
} }
else else
{ {
Application.Current.Dispatcher.BeginInvoke(new Action(() =>
{
PF.Clear();
}));
PFTipMsg = "网络好像出现了异常..."; PFTipMsg = "网络好像出现了异常...";
pfhide = Visibility.Visible; pfhide = Visibility.Visible;
} }
}).ContinueWith(task => }).ContinueWith(task =>
{ {
CanCloseDetail = true; CanCloseDetail = true;
}); });
...@@ -412,7 +444,7 @@ namespace SchoolSituation ...@@ -412,7 +444,7 @@ namespace SchoolSituation
public DateTime Date { get; set; } public DateTime Date { get; set; }
} }
} }
} }
...@@ -7,9 +7,9 @@ using GalaSoft.MvvmLight; ...@@ -7,9 +7,9 @@ using GalaSoft.MvvmLight;
namespace SchoolSituation namespace SchoolSituation
{ {
public class ViewSuSheState:ObservableObject public class ViewSuSheState : ObservableObject
{ {
private int _FloorNumber; private int _FloorNumber;
/// <summary> /// <summary>
/// 楼层编号 /// 楼层编号
...@@ -17,10 +17,10 @@ namespace SchoolSituation ...@@ -17,10 +17,10 @@ namespace SchoolSituation
public int FloorNumber public int FloorNumber
{ {
get { return _FloorNumber; } get { return _FloorNumber; }
set { _FloorNumber = value;RaisePropertyChanged("FloorNumber"); } set { _FloorNumber = value; RaisePropertyChanged("FloorNumber"); }
} }
private List<ViewSuShe> _list; private List<ViewSuShe> _list;
/// <summary> /// <summary>
/// 楼层房间信息集合 /// 楼层房间信息集合
...@@ -28,7 +28,7 @@ namespace SchoolSituation ...@@ -28,7 +28,7 @@ namespace SchoolSituation
public List<ViewSuShe> list public List<ViewSuShe> list
{ {
get { return _list; } get { return _list; }
set { _list = value;RaisePropertyChanged("list"); } set { _list = value; RaisePropertyChanged("list"); }
} }
public static explicit operator ViewSuSheState(DashBoard.ServiceModel.School_SuSheState data) public static explicit operator ViewSuSheState(DashBoard.ServiceModel.School_SuSheState data)
{ {
...@@ -39,7 +39,7 @@ namespace SchoolSituation ...@@ -39,7 +39,7 @@ namespace SchoolSituation
} }
} }
public class ViewSuShe: ObservableObject public class ViewSuShe : ObservableObject
{ {
/// <summary> /// <summary>
/// 房间编号 /// 房间编号
...@@ -48,7 +48,7 @@ namespace SchoolSituation ...@@ -48,7 +48,7 @@ namespace SchoolSituation
public Guid RoomID public Guid RoomID
{ {
get { return _RoomID; } get { return _RoomID; }
set { _RoomID = value;RaisePropertyChanged("RoomID"); } set { _RoomID = value; RaisePropertyChanged("RoomID"); }
} }
/// <summary> /// <summary>
/// 房间名称 /// 房间名称
...@@ -57,7 +57,7 @@ namespace SchoolSituation ...@@ -57,7 +57,7 @@ namespace SchoolSituation
public string RoomName public string RoomName
{ {
get { return _RoomName; } get { return _RoomName; }
set { _RoomName = value;RaisePropertyChanged("RoomName"); } set { _RoomName = value; RaisePropertyChanged("RoomName"); }
} }
/// <summary> /// <summary>
/// 宿舍已安排人数 /// 宿舍已安排人数
...@@ -66,7 +66,7 @@ namespace SchoolSituation ...@@ -66,7 +66,7 @@ namespace SchoolSituation
public int Sum public int Sum
{ {
get { return _Sum; } get { return _Sum; }
set { _Sum = value;RaisePropertyChanged("Sum"); } set { _Sum = value; RaisePropertyChanged("Sum"); }
} }
/// <summary> /// <summary>
/// 在宿舍人数 /// 在宿舍人数
...@@ -75,7 +75,7 @@ namespace SchoolSituation ...@@ -75,7 +75,7 @@ namespace SchoolSituation
public int In public int In
{ {
get { return _In; } get { return _In; }
set { _In = value;RaisePropertyChanged("In"); } set { _In = value; RaisePropertyChanged("In"); }
} }
public static explicit operator ViewSuShe(DashBoard.ServiceModel.SuShe data) public static explicit operator ViewSuShe(DashBoard.ServiceModel.SuShe data)
{ {
...@@ -85,7 +85,7 @@ namespace SchoolSituation ...@@ -85,7 +85,7 @@ namespace SchoolSituation
entity.Sum = data.Sum; entity.Sum = data.Sum;
entity.In = data.In; entity.In = data.In;
return entity; return entity;
} }
} }
public class ViewSuShe_KaoQin : ObservableObject public class ViewSuShe_KaoQin : ObservableObject
{ {
...@@ -167,30 +167,30 @@ namespace SchoolSituation ...@@ -167,30 +167,30 @@ namespace SchoolSituation
entity.StudentID = data.StudentID; entity.StudentID = data.StudentID;
entity.StudentName = data.StudentName; entity.StudentName = data.StudentName;
entity.RecordTime = data.RecordTime; entity.RecordTime = data.RecordTime;
entity.State = data.State; entity.State = data.Remark;
return entity; return entity;
} }
} }
public class ViewSuShe_PingFen:ObservableObject public class ViewSuShe_PingFen : ObservableObject
{ {
private decimal _Sum; private decimal _Sum;
public decimal Sum public decimal Sum
{ {
get { return _Sum; } get { return _Sum; }
set { _Sum = value;RaisePropertyChanged("Sum"); } set { _Sum = value; RaisePropertyChanged("Sum"); }
} }
private List<ViewPingFen> _msg; private List<ViewPingFen> _msg;
public List<ViewPingFen> msg public List<ViewPingFen> msg
{ {
get { return _msg; } get { return _msg; }
set { _msg = value;RaisePropertyChanged("msg"); } set { _msg = value; RaisePropertyChanged("msg"); }
} }
public static explicit operator ViewSuShe_PingFen(DashBoard.ServiceModel.SuShe_PingFen data) public static explicit operator ViewSuShe_PingFen(DashBoard.ServiceModel.SuShe_PingFen data)
{ {
var entity = new ViewSuShe_PingFen(); var entity = new ViewSuShe_PingFen();
entity.Sum = data.Sum; entity.Sum = data.Sum;
if(data.msg!=null) if (data.msg != null)
entity.msg = data.msg.Select(r => (ViewPingFen)r).ToList(); entity.msg = data.msg.Select(r => (ViewPingFen)r).ToList();
return entity; return entity;
} }
} }
...@@ -221,7 +221,7 @@ namespace SchoolSituation ...@@ -221,7 +221,7 @@ namespace SchoolSituation
public int ProjectID public int ProjectID
{ {
get { return _ProjectID; } get { return _ProjectID; }
set { _ProjectID = value;RaisePropertyChanged("ProjectID"); } set { _ProjectID = value; RaisePropertyChanged("ProjectID"); }
} }
private string _ProjectName; private string _ProjectName;
/// <summary> /// <summary>
...@@ -230,7 +230,7 @@ namespace SchoolSituation ...@@ -230,7 +230,7 @@ namespace SchoolSituation
public string ProjectName public string ProjectName
{ {
get { return _ProjectName; } get { return _ProjectName; }
set { _ProjectName = value;RaisePropertyChanged("ProjectName"); } set { _ProjectName = value; RaisePropertyChanged("ProjectName"); }
} }
private decimal _Score; private decimal _Score;
/// <summary> /// <summary>
...@@ -239,7 +239,7 @@ namespace SchoolSituation ...@@ -239,7 +239,7 @@ namespace SchoolSituation
public decimal Score public decimal Score
{ {
get { return _Score; } get { return _Score; }
set { _Score = value;RaisePropertyChanged("Score"); } set { _Score = value; RaisePropertyChanged("Score"); }
} }
private Guid _ClassID; private Guid _ClassID;
/// <summary> /// <summary>
...@@ -248,7 +248,7 @@ namespace SchoolSituation ...@@ -248,7 +248,7 @@ namespace SchoolSituation
public Guid ClassID public Guid ClassID
{ {
get { return _ClassID; } get { return _ClassID; }
set { _ClassID = value;RaisePropertyChanged("ClassID"); } set { _ClassID = value; RaisePropertyChanged("ClassID"); }
} }
/// <summary> /// <summary>
/// 评分班级名称 /// 评分班级名称
...@@ -257,7 +257,7 @@ namespace SchoolSituation ...@@ -257,7 +257,7 @@ namespace SchoolSituation
public string ClassName public string ClassName
{ {
get { return _ClassName; } get { return _ClassName; }
set { _ClassName = value;RaisePropertyChanged("ClassName"); } set { _ClassName = value; RaisePropertyChanged("ClassName"); }
} }
private string _Remark; private string _Remark;
/// <summary> /// <summary>
...@@ -266,7 +266,7 @@ namespace SchoolSituation ...@@ -266,7 +266,7 @@ namespace SchoolSituation
public string Remark public string Remark
{ {
get { return _Remark; } get { return _Remark; }
set { _Remark = value;RaisePropertyChanged("Remark"); } set { _Remark = value; RaisePropertyChanged("Remark"); }
} }
public static explicit operator ViewPingFen(DashBoard.ServiceModel.PingFen data) public static explicit operator ViewPingFen(DashBoard.ServiceModel.PingFen data)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment