You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
74 lines
2.0 KiB
C#
74 lines
2.0 KiB
C#
using CommonFunc;
|
|
using CommonFunc.Tools;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Data;
|
|
using System.Windows.Documents;
|
|
using System.Windows.Input;
|
|
using System.Windows.Media;
|
|
using System.Windows.Media.Imaging;
|
|
using System.Windows.Navigation;
|
|
using System.Windows.Shapes;
|
|
using XGL.Dats.DBServiceFinishProd;
|
|
namespace XGLFinishPro.Views
|
|
{
|
|
/// <summary>
|
|
/// LanJu_UserRecord.xaml 的交互逻辑
|
|
/// </summary>
|
|
public partial class LanJu_UserRecord : UserControl
|
|
{
|
|
FinishProdDBService userDbWareHouse = new FinishProdDBService();
|
|
string deviceCode = Utils.GetAppSetting("DeviceCode");
|
|
|
|
public LanJu_UserRecord()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
|
|
|
|
private void DataGrid_LoadingRow(object sender, DataGridRowEventArgs e)
|
|
{
|
|
e.Row.Header = (e.Row.GetIndex() + 1).ToString();
|
|
}
|
|
|
|
private void UserControl_Loaded(object sender, RoutedEventArgs e)
|
|
{
|
|
GetRecordInfo();
|
|
}
|
|
|
|
private void GetRecordInfo()
|
|
{
|
|
DataTable dt = userDbWareHouse.GetAttendanceRecord(deviceCode, LoginUser.WorkDate);
|
|
if (dt == null)
|
|
{
|
|
dgUserInfo.ItemsSource = null;
|
|
}
|
|
else
|
|
{
|
|
dgUserInfo.ItemsSource = dt.DefaultView;
|
|
}
|
|
}
|
|
|
|
private void Button_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
if (dgUserInfo.SelectedItem != null)
|
|
{
|
|
DataRowView selectedItem = dgUserInfo.SelectedItem as DataRowView;
|
|
var bol = userDbWareHouse.Updaterdaka(selectedItem["user_id"].ToString(), deviceCode, LoginUser.WorkDate);
|
|
GetRecordInfo();
|
|
}
|
|
else
|
|
{
|
|
Console.WriteLine("未选择任何项。");
|
|
}
|
|
}
|
|
}
|
|
}
|