添加用户权限管理
This commit is contained in:
commit
04f0798c17
10 files changed
+105
-149
No files matched your search
@@ -9,7 +9,7 @@
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:viewmodel="clr-namespace:SunlightCentralizedControlManagement_SCCM_.ViewModel"
|
||||
xmlns:Ngantt="clr-namespace:nGantt;assembly=nGantt"
|
||||
d:DataContext="{d:DesignInstance Type=viewmodel:ProductionPlanningModel}"
|
||||
d:DataContext="{d:DesignInstance Type=viewmodel:MainWindowViewModel}"
|
||||
mc:Ignorable="d" Loaded="UserControl_Loaded"
|
||||
d:DesignHeight="900" d:DesignWidth="1800">
|
||||
<UserControl.Resources>
|
||||
@@ -75,7 +75,7 @@
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Row="1" Height="60" Background="#FF00204E" Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<ListView ScrollViewer.HorizontalScrollBarVisibility="Disabled" Foreground="#FF1368BD">
|
||||
<ListViewItem Width="150" MouseLeftButtonUp="ListViewItem_New" x:Name="Quit">
|
||||
<ListViewItem Width="150" MouseLeftButtonUp="ListViewItem_New" x:Name="Quit" IsEnabled="{Binding USER_Capacity[5]}">
|
||||
<StackPanel Orientation="Horizontal" >
|
||||
<materialDesign:PackIcon Kind="NewBox" Width="40" Height="30" Margin="10" VerticalAlignment="Center" Foreground="#FF1368BD"/>
|
||||
<TextBlock Text="{x:Static lang:Resources.New}" VerticalAlignment="Center" Margin="20 10" Foreground="White"/>
|
||||
|
||||
@@ -54,7 +54,6 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
public ProductionPlanningView()
|
||||
{
|
||||
InitializeComponent();
|
||||
DataContext = new ProductionPlanningModel();
|
||||
Sdatepicker.Language = XmlLanguage.GetLanguage(Configini.IniReadvalue("SYS", "Language"));
|
||||
CountDown();
|
||||
}
|
||||
@@ -74,8 +73,8 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
ganttTaskContextMenuItems.Add(new ContextMenuItem(ViewClicked, Properties.Resources.View + "..."));
|
||||
ganttTaskContextMenuItems.Add(new ContextMenuItem(AdvanceClicked, Properties.Resources.Advance + "..."));
|
||||
ganttTaskContextMenuItems.Add(new ContextMenuItem(DelayedClicked, Properties.Resources.Delayed + "..."));
|
||||
ganttTaskContextMenuItems.Add(new ContextMenuItem(EditClicked, Properties.Resources.edit + "..."));
|
||||
ganttTaskContextMenuItems.Add(new ContextMenuItem(DeleteClicked, Properties.Resources.Delete + "..."));
|
||||
ganttTaskContextMenuItems.Add(new ContextMenuItem(EditClicked, Properties.Resources.edit + "..."));
|
||||
ganttTaskContextMenuItems.Add(new ContextMenuItem(DeleteClicked, Properties.Resources.Delete + "..."));
|
||||
GanttChart.GanttTaskContextMenuItems = ganttTaskContextMenuItems;
|
||||
|
||||
GanttChartNEW();
|
||||
@@ -147,41 +146,47 @@ namespace SunlightCentralizedControlManagement_SCCM_.View
|
||||
}
|
||||
private void EditClicked(GanttTask ganttTask)
|
||||
{
|
||||
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
||||
SQLiteHelpers.Open(); //打开数据库
|
||||
DataTable WorkOrder_dt = SQLiteHelpers.ExecuteDataSet(
|
||||
"select * from WorkOrder where WorkOrder='" + ganttTask.ID + "'Order by StartTime", null).Tables[0]; //读取表写入缓存
|
||||
SQLiteHelpers.Close();
|
||||
if (MainWindowViewModel.USER_Capacity[6])
|
||||
{
|
||||
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
||||
SQLiteHelpers.Open(); //打开数据库
|
||||
DataTable WorkOrder_dt = SQLiteHelpers.ExecuteDataSet(
|
||||
"select * from WorkOrder where WorkOrder='" + ganttTask.ID + "'Order by StartTime", null).Tables[0]; //读取表写入缓存
|
||||
SQLiteHelpers.Close();
|
||||
|
||||
if (DateTime.Now > DateTime.Parse(WorkOrder_dt.Select().First().Field<object>("EndTime").ToString()))
|
||||
{
|
||||
MessageBox.Show(Properties.Resources.EHCIP, "SCCM", MessageBoxButton.OK, MessageBoxImage.Warning);//禁止编辑历史工艺
|
||||
}
|
||||
else
|
||||
{
|
||||
if (WorkOrder_dt.Select().First().Field<object>("State").ToString() == "101")
|
||||
if (DateTime.Now > DateTime.Parse(WorkOrder_dt.Select().First().Field<object>("EndTime").ToString()))
|
||||
{
|
||||
Picture.Content = null;
|
||||
Picture.Width = 600;
|
||||
Picture.Content = new ProductionPlanningEdit(ganttTask.ID, true);
|
||||
MessageBox.Show(Properties.Resources.EHCIP, "SCCM", MessageBoxButton.OK, MessageBoxImage.Warning);//禁止编辑历史工艺
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
MessageBox.Show(Properties.Resources.ENWOIP, "SCCM", MessageBoxButton.OK, MessageBoxImage.Warning);//禁止编辑非等待中的工单
|
||||
if (WorkOrder_dt.Select().First().Field<object>("State").ToString() == "101")
|
||||
{
|
||||
Picture.Content = null;
|
||||
Picture.Width = 600;
|
||||
Picture.Content = new ProductionPlanningEdit(ganttTask.ID, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show(Properties.Resources.ENWOIP, "SCCM", MessageBoxButton.OK, MessageBoxImage.Warning);//禁止编辑非等待中的工单
|
||||
}
|
||||
}
|
||||
}
|
||||
}//编辑
|
||||
private void DeleteClicked(GanttTask ganttTask)//删除
|
||||
{
|
||||
if (System.Windows.Forms.MessageBox.Show(Properties.Resources.Confirm + Properties.Resources.Delete + ganttTask.Name, "Delete ",
|
||||
System.Windows.Forms.MessageBoxButtons.OKCancel, System.Windows.Forms.MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.OK)
|
||||
if (MainWindowViewModel.USER_Capacity[7])
|
||||
{
|
||||
///执行删除
|
||||
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
||||
SQLiteHelpers.Open(); //打开数据库
|
||||
SQLiteHelpers.Delete("WorkOrder", "WorkOrder='" + ganttTask.ID + "'", null);
|
||||
SQLiteHelpers.Close();
|
||||
GanttChartNEW();
|
||||
if (System.Windows.Forms.MessageBox.Show(Properties.Resources.Confirm + Properties.Resources.Delete + ganttTask.Name, "Delete ",
|
||||
System.Windows.Forms.MessageBoxButtons.OKCancel, System.Windows.Forms.MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.OK)
|
||||
{
|
||||
///执行删除
|
||||
SQLiteHelpers = new SQLiteHelper(DBAddress); //数据库连接路径
|
||||
SQLiteHelpers.Open(); //打开数据库
|
||||
SQLiteHelpers.Delete("WorkOrder", "WorkOrder='" + ganttTask.ID + "'", null);
|
||||
SQLiteHelpers.Close();
|
||||
GanttChartNEW();
|
||||
}
|
||||
}
|
||||
}
|
||||
private string FormatYear(Period period)
|
||||
|
||||
Reference in new issue
Block a user