| @ -0,0 +1,23 @@ | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using System.Threading.Tasks; | |||
| namespace BO.BO.Bill | |||
| { | |||
| public class ConfirmOrder | |||
| { | |||
| public long ID { get; set; } | |||
| public int Order { get; set; } | |||
| public long? B3WeighBill_ID { get; set; } | |||
| public string LiveColonyHouse_Name { get; set; } | |||
| public int Number { get; set; } | |||
| public bool Confirmed { get; set; } | |||
| } | |||
| } | |||
| @ -0,0 +1,28 @@ | |||
| using BO.BO.Bill; | |||
| using Forks.JsonRpc.Client; | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using System.Threading.Tasks; | |||
| using System.Web.Script.Serialization; | |||
| namespace BO.Utils.BillRpc | |||
| { | |||
| public static class OrderConfirmRpc | |||
| { | |||
| static JavaScriptSerializer serializer = new JavaScriptSerializer(); | |||
| public static List<ConfirmOrder> GetConfirmOrder(DateTime date) | |||
| { | |||
| const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/OrderConfirmRpc/GetConfirmOrder"; | |||
| var json = RpcFacade.Call<string>(method, date); | |||
| return serializer.Deserialize<List<ConfirmOrder>>(json); | |||
| } | |||
| public static void SetOrderConfirmed(long id) | |||
| { | |||
| const string method = "/MainSystem/B3ClientService/Rpcs/BillRpc/OrderConfirmRpc/SetOrderConfirmed"; | |||
| RpcFacade.Call<int>(method, id); | |||
| } | |||
| } | |||
| } | |||
| @ -0,0 +1,80 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | |||
| <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |||
| <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | |||
| <PropertyGroup> | |||
| <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | |||
| <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | |||
| <ProjectGuid>{D4723253-E102-40C7-819F-8052C5BE241D}</ProjectGuid> | |||
| <OutputType>Library</OutputType> | |||
| <AppDesignerFolder>Properties</AppDesignerFolder> | |||
| <RootNamespace>OrderConfirm</RootNamespace> | |||
| <AssemblyName>OrderConfirm</AssemblyName> | |||
| <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> | |||
| <FileAlignment>512</FileAlignment> | |||
| </PropertyGroup> | |||
| <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | |||
| <DebugSymbols>true</DebugSymbols> | |||
| <DebugType>full</DebugType> | |||
| <Optimize>false</Optimize> | |||
| <OutputPath>bin\Debug\</OutputPath> | |||
| <DefineConstants>DEBUG;TRACE</DefineConstants> | |||
| <ErrorReport>prompt</ErrorReport> | |||
| <WarningLevel>4</WarningLevel> | |||
| </PropertyGroup> | |||
| <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | |||
| <DebugType>pdbonly</DebugType> | |||
| <Optimize>true</Optimize> | |||
| <OutputPath>bin\Release\</OutputPath> | |||
| <DefineConstants>TRACE</DefineConstants> | |||
| <ErrorReport>prompt</ErrorReport> | |||
| <WarningLevel>4</WarningLevel> | |||
| </PropertyGroup> | |||
| <ItemGroup> | |||
| <Reference Include="Forks.JsonRpc.Client, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7254430f49d10aae, processorArchitecture=MSIL" /> | |||
| <Reference Include="PresentationCore" /> | |||
| <Reference Include="PresentationFramework" /> | |||
| <Reference Include="System" /> | |||
| <Reference Include="System.Core" /> | |||
| <Reference Include="System.Drawing" /> | |||
| <Reference Include="System.Windows.Forms" /> | |||
| <Reference Include="System.Xaml" /> | |||
| <Reference Include="System.Xml.Linq" /> | |||
| <Reference Include="System.Data.DataSetExtensions" /> | |||
| <Reference Include="Microsoft.CSharp" /> | |||
| <Reference Include="System.Data" /> | |||
| <Reference Include="System.Xml" /> | |||
| <Reference Include="WindowsBase" /> | |||
| </ItemGroup> | |||
| <ItemGroup> | |||
| <Compile Include="OrderConfirmForm.cs"> | |||
| <SubType>Form</SubType> | |||
| </Compile> | |||
| <Compile Include="OrderConfirmForm.Designer.cs"> | |||
| <DependentUpon>OrderConfirmForm.cs</DependentUpon> | |||
| </Compile> | |||
| <Compile Include="Properties\AssemblyInfo.cs" /> | |||
| </ItemGroup> | |||
| <ItemGroup> | |||
| <EmbeddedResource Include="OrderConfirmForm.resx"> | |||
| <DependentUpon>OrderConfirmForm.cs</DependentUpon> | |||
| </EmbeddedResource> | |||
| </ItemGroup> | |||
| <ItemGroup> | |||
| <ProjectReference Include="..\BO\BO.csproj"> | |||
| <Project>{8968f14a-c7c7-4751-96ce-b114fbfd65ef}</Project> | |||
| <Name>BO</Name> | |||
| </ProjectReference> | |||
| <ProjectReference Include="..\BWP.WinFormControl\BWP.WinFormControl.csproj"> | |||
| <Project>{A782B23E-BE6D-4F51-B5CB-5CD259BA97CC}</Project> | |||
| <Name>BWP.WinFormControl</Name> | |||
| </ProjectReference> | |||
| </ItemGroup> | |||
| <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | |||
| <!-- To modify your build process, add your task inside one of the targets below and uncomment it. | |||
| Other similar extension points exist, see Microsoft.Common.targets. | |||
| <Target Name="BeforeBuild"> | |||
| </Target> | |||
| <Target Name="AfterBuild"> | |||
| </Target> | |||
| --> | |||
| </Project> | |||
| @ -0,0 +1,269 @@ | |||
| namespace OrderConfirm | |||
| { | |||
| partial class OrderConfirmForm | |||
| { | |||
| /// <summary> | |||
| /// Required designer variable. | |||
| /// </summary> | |||
| private System.ComponentModel.IContainer components = null; | |||
| /// <summary> | |||
| /// Clean up any resources being used. | |||
| /// </summary> | |||
| /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> | |||
| protected override void Dispose(bool disposing) | |||
| { | |||
| if (disposing && (components != null)) | |||
| { | |||
| components.Dispose(); | |||
| } | |||
| base.Dispose(disposing); | |||
| } | |||
| #region Windows Form Designer generated code | |||
| /// <summary> | |||
| /// Required method for Designer support - do not modify | |||
| /// the contents of this method with the code editor. | |||
| /// </summary> | |||
| private void InitializeComponent() | |||
| { | |||
| System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); | |||
| System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); | |||
| System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); | |||
| System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); | |||
| this.uDataGridView1 = new BWP.WinFormControl.UDataGridView(); | |||
| this.existBtn = new System.Windows.Forms.Button(); | |||
| this.orderLabel = new System.Windows.Forms.Label(); | |||
| this.label2 = new System.Windows.Forms.Label(); | |||
| this.syncBtn = new System.Windows.Forms.Button(); | |||
| this.uDatePicker1 = new BWP.WinFormControl.UDatePicker(); | |||
| this.label1 = new System.Windows.Forms.Label(); | |||
| this.vScrollBar1 = new System.Windows.Forms.VScrollBar(); | |||
| this.C_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
| this.C_Confirmed = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
| this.C_Order = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
| this.C_B3WeighBill_ID = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
| this.C_LiveColonyHouse_Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
| this.C_Number = new System.Windows.Forms.DataGridViewTextBoxColumn(); | |||
| this.C_OK = new System.Windows.Forms.DataGridViewButtonColumn(); | |||
| ((System.ComponentModel.ISupportInitialize)(this.uDataGridView1)).BeginInit(); | |||
| this.SuspendLayout(); | |||
| // | |||
| // uDataGridView1 | |||
| // | |||
| this.uDataGridView1.AllowUserToAddRows = false; | |||
| this.uDataGridView1.AllowUserToDeleteRows = false; | |||
| this.uDataGridView1.AllowUserToResizeColumns = false; | |||
| this.uDataGridView1.AllowUserToResizeRows = false; | |||
| dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235))))); | |||
| this.uDataGridView1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; | |||
| this.uDataGridView1.BackgroundColor = System.Drawing.Color.White; | |||
| dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; | |||
| dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control; | |||
| dataGridViewCellStyle2.Font = new System.Drawing.Font("宋体", 12F); | |||
| dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText; | |||
| dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; | |||
| dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText; | |||
| dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True; | |||
| this.uDataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; | |||
| this.uDataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; | |||
| this.uDataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { | |||
| this.C_ID, | |||
| this.C_Confirmed, | |||
| this.C_Order, | |||
| this.C_B3WeighBill_ID, | |||
| this.C_LiveColonyHouse_Name, | |||
| this.C_Number, | |||
| this.C_OK}); | |||
| this.uDataGridView1.Location = new System.Drawing.Point(35, 73); | |||
| this.uDataGridView1.MultiSelect = false; | |||
| this.uDataGridView1.Name = "uDataGridView1"; | |||
| this.uDataGridView1.ReadOnly = true; | |||
| this.uDataGridView1.RowHeadersVisible = false; | |||
| dataGridViewCellStyle4.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); | |||
| dataGridViewCellStyle4.ForeColor = System.Drawing.Color.Black; | |||
| dataGridViewCellStyle4.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(66)))), ((int)(((byte)(163)))), ((int)(((byte)(218))))); | |||
| dataGridViewCellStyle4.SelectionForeColor = System.Drawing.Color.Black; | |||
| this.uDataGridView1.RowsDefaultCellStyle = dataGridViewCellStyle4; | |||
| this.uDataGridView1.RowTemplate.Height = 60; | |||
| this.uDataGridView1.ScrollBars = System.Windows.Forms.ScrollBars.None; | |||
| this.uDataGridView1.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; | |||
| this.uDataGridView1.Size = new System.Drawing.Size(753, 525); | |||
| this.uDataGridView1.TabIndex = 0; | |||
| this.uDataGridView1.CellClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.uDataGridView1_CellClick); | |||
| this.uDataGridView1.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.uDataGridView1_CellContentClick); | |||
| // | |||
| // existBtn | |||
| // | |||
| this.existBtn.Font = new System.Drawing.Font("宋体", 15F); | |||
| this.existBtn.Location = new System.Drawing.Point(723, 6); | |||
| this.existBtn.Name = "existBtn"; | |||
| this.existBtn.Size = new System.Drawing.Size(108, 41); | |||
| this.existBtn.TabIndex = 12; | |||
| this.existBtn.Text = "退出"; | |||
| this.existBtn.UseVisualStyleBackColor = true; | |||
| this.existBtn.Click += new System.EventHandler(this.existBtn_Click); | |||
| // | |||
| // orderLabel | |||
| // | |||
| this.orderLabel.AutoSize = true; | |||
| this.orderLabel.Font = new System.Drawing.Font("宋体", 15F); | |||
| this.orderLabel.Location = new System.Drawing.Point(540, 22); | |||
| this.orderLabel.Name = "orderLabel"; | |||
| this.orderLabel.Size = new System.Drawing.Size(19, 20); | |||
| this.orderLabel.TabIndex = 11; | |||
| this.orderLabel.Text = "0"; | |||
| // | |||
| // label2 | |||
| // | |||
| this.label2.AutoSize = true; | |||
| this.label2.Font = new System.Drawing.Font("宋体", 15F); | |||
| this.label2.Location = new System.Drawing.Point(442, 22); | |||
| this.label2.Name = "label2"; | |||
| this.label2.Size = new System.Drawing.Size(109, 20); | |||
| this.label2.TabIndex = 10; | |||
| this.label2.Text = "排宰顺序:"; | |||
| // | |||
| // syncBtn | |||
| // | |||
| this.syncBtn.Font = new System.Drawing.Font("宋体", 15F); | |||
| this.syncBtn.Location = new System.Drawing.Point(315, 12); | |||
| this.syncBtn.Name = "syncBtn"; | |||
| this.syncBtn.Size = new System.Drawing.Size(108, 41); | |||
| this.syncBtn.TabIndex = 9; | |||
| this.syncBtn.Text = "同步数据"; | |||
| this.syncBtn.UseVisualStyleBackColor = true; | |||
| this.syncBtn.Click += new System.EventHandler(this.syncBtn_Click); | |||
| // | |||
| // uDatePicker1 | |||
| // | |||
| this.uDatePicker1.BackColor = System.Drawing.Color.White; | |||
| this.uDatePicker1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; | |||
| this.uDatePicker1.Date = new System.DateTime(2017, 9, 5, 0, 0, 0, 0); | |||
| this.uDatePicker1.Font = new System.Drawing.Font("宋体", 15F); | |||
| this.uDatePicker1.Location = new System.Drawing.Point(142, 17); | |||
| this.uDatePicker1.Name = "uDatePicker1"; | |||
| this.uDatePicker1.Size = new System.Drawing.Size(150, 30); | |||
| this.uDatePicker1.TabIndex = 8; | |||
| this.uDatePicker1.Text = "2017/09/05"; | |||
| this.uDatePicker1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; | |||
| this.uDatePicker1.Type = BWP.WinFormControl.DateTimeType.Date; | |||
| // | |||
| // label1 | |||
| // | |||
| this.label1.AutoSize = true; | |||
| this.label1.Font = new System.Drawing.Font("宋体", 15F); | |||
| this.label1.Location = new System.Drawing.Point(34, 22); | |||
| this.label1.Name = "label1"; | |||
| this.label1.Size = new System.Drawing.Size(109, 20); | |||
| this.label1.TabIndex = 7; | |||
| this.label1.Text = "宰杀日期:"; | |||
| // | |||
| // vScrollBar1 | |||
| // | |||
| this.vScrollBar1.Location = new System.Drawing.Point(791, 73); | |||
| this.vScrollBar1.Name = "vScrollBar1"; | |||
| this.vScrollBar1.Size = new System.Drawing.Size(40, 525); | |||
| this.vScrollBar1.TabIndex = 52; | |||
| // | |||
| // C_ID | |||
| // | |||
| this.C_ID.DataPropertyName = "ID"; | |||
| this.C_ID.HeaderText = "ID"; | |||
| this.C_ID.Name = "C_ID"; | |||
| this.C_ID.ReadOnly = true; | |||
| this.C_ID.Visible = false; | |||
| // | |||
| // C_Confirmed | |||
| // | |||
| this.C_Confirmed.DataPropertyName = "Confirmed"; | |||
| this.C_Confirmed.HeaderText = "Confirmed"; | |||
| this.C_Confirmed.Name = "C_Confirmed"; | |||
| this.C_Confirmed.ReadOnly = true; | |||
| this.C_Confirmed.Visible = false; | |||
| // | |||
| // C_Order | |||
| // | |||
| this.C_Order.DataPropertyName = "Order"; | |||
| this.C_Order.HeaderText = "排宰顺序"; | |||
| this.C_Order.Name = "C_Order"; | |||
| this.C_Order.ReadOnly = true; | |||
| // | |||
| // C_B3WeighBill_ID | |||
| // | |||
| this.C_B3WeighBill_ID.DataPropertyName = "B3WeighBill_ID"; | |||
| this.C_B3WeighBill_ID.HeaderText = "过磅单号"; | |||
| this.C_B3WeighBill_ID.Name = "C_B3WeighBill_ID"; | |||
| this.C_B3WeighBill_ID.ReadOnly = true; | |||
| // | |||
| // C_LiveColonyHouse_Name | |||
| // | |||
| this.C_LiveColonyHouse_Name.DataPropertyName = "LiveColonyHouse_Name"; | |||
| this.C_LiveColonyHouse_Name.HeaderText = "圈舍"; | |||
| this.C_LiveColonyHouse_Name.Name = "C_LiveColonyHouse_Name"; | |||
| this.C_LiveColonyHouse_Name.ReadOnly = true; | |||
| this.C_LiveColonyHouse_Name.Width = 300; | |||
| // | |||
| // C_Number | |||
| // | |||
| this.C_Number.DataPropertyName = "Number"; | |||
| this.C_Number.HeaderText = "头数"; | |||
| this.C_Number.Name = "C_Number"; | |||
| this.C_Number.ReadOnly = true; | |||
| // | |||
| // C_OK | |||
| // | |||
| dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; | |||
| dataGridViewCellStyle3.Padding = new System.Windows.Forms.Padding(10); | |||
| this.C_OK.DefaultCellStyle = dataGridViewCellStyle3; | |||
| this.C_OK.HeaderText = "确定"; | |||
| this.C_OK.Name = "C_OK"; | |||
| this.C_OK.ReadOnly = true; | |||
| this.C_OK.Text = "确定"; | |||
| this.C_OK.UseColumnTextForButtonValue = true; | |||
| this.C_OK.Width = 150; | |||
| // | |||
| // OrderConfirmForm | |||
| // | |||
| this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); | |||
| this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; | |||
| this.ClientSize = new System.Drawing.Size(869, 631); | |||
| this.Controls.Add(this.vScrollBar1); | |||
| this.Controls.Add(this.existBtn); | |||
| this.Controls.Add(this.orderLabel); | |||
| this.Controls.Add(this.label2); | |||
| this.Controls.Add(this.syncBtn); | |||
| this.Controls.Add(this.uDatePicker1); | |||
| this.Controls.Add(this.label1); | |||
| this.Controls.Add(this.uDataGridView1); | |||
| this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; | |||
| this.MaximizeBox = false; | |||
| this.Name = "OrderConfirmForm"; | |||
| this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; | |||
| this.Text = "上线确认"; | |||
| ((System.ComponentModel.ISupportInitialize)(this.uDataGridView1)).EndInit(); | |||
| this.ResumeLayout(false); | |||
| this.PerformLayout(); | |||
| } | |||
| #endregion | |||
| private BWP.WinFormControl.UDataGridView uDataGridView1; | |||
| private System.Windows.Forms.Button existBtn; | |||
| private System.Windows.Forms.Label orderLabel; | |||
| private System.Windows.Forms.Label label2; | |||
| private System.Windows.Forms.Button syncBtn; | |||
| private BWP.WinFormControl.UDatePicker uDatePicker1; | |||
| private System.Windows.Forms.Label label1; | |||
| private System.Windows.Forms.VScrollBar vScrollBar1; | |||
| private System.Windows.Forms.DataGridViewTextBoxColumn C_ID; | |||
| private System.Windows.Forms.DataGridViewTextBoxColumn C_Confirmed; | |||
| private System.Windows.Forms.DataGridViewTextBoxColumn C_Order; | |||
| private System.Windows.Forms.DataGridViewTextBoxColumn C_B3WeighBill_ID; | |||
| private System.Windows.Forms.DataGridViewTextBoxColumn C_LiveColonyHouse_Name; | |||
| private System.Windows.Forms.DataGridViewTextBoxColumn C_Number; | |||
| private System.Windows.Forms.DataGridViewButtonColumn C_OK; | |||
| } | |||
| } | |||
| @ -0,0 +1,186 @@ | |||
| using BO.BO.Bill; | |||
| using BO.Utils; | |||
| using BO.Utils.BillRpc; | |||
| using System; | |||
| using System.Collections.Generic; | |||
| using System.ComponentModel; | |||
| using System.Data; | |||
| using System.Drawing; | |||
| using System.Linq; | |||
| using System.Text; | |||
| using System.Threading; | |||
| using System.Threading.Tasks; | |||
| using System.Windows.Forms; | |||
| namespace OrderConfirm | |||
| { | |||
| public partial class OrderConfirmForm : Form, IAfterLogin | |||
| { | |||
| #region IAfterLogin | |||
| public string RoleName | |||
| { | |||
| get { return "窒晕员"; } | |||
| } | |||
| public Form Generate() | |||
| { | |||
| return this; | |||
| } | |||
| #endregion | |||
| private delegate void InvokeHandler(); | |||
| List<ConfirmOrder> list; | |||
| Thread syncThread; | |||
| public OrderConfirmForm() | |||
| { | |||
| InitializeComponent(); | |||
| uDatePicker1.Date = DateTime.Today; | |||
| uDataGridView1.AutoGenerateColumns = false; | |||
| uDataGridView1.DataSource = null; | |||
| this.FormClosing += delegate | |||
| { | |||
| if (syncThread != null && syncThread.IsAlive) | |||
| syncThread.Abort(); | |||
| }; | |||
| } | |||
| private void syncBtn_Click(object sender, EventArgs e) | |||
| { | |||
| if (syncThread == null || !syncThread.IsAlive) | |||
| { | |||
| syncThread = new Thread(SyncTask); | |||
| syncThread.Start(); | |||
| syncBtn.BackColor = Color.FromArgb(15, 215, 107); | |||
| syncBtn.ForeColor = Color.White; | |||
| } | |||
| else | |||
| { | |||
| syncThread.Abort(); | |||
| syncBtn.BackColor = Color.FromKnownColor(KnownColor.Control); | |||
| syncBtn.ForeColor = Color.FromKnownColor(KnownColor.ControlText); | |||
| } | |||
| } | |||
| private void SyncTask() | |||
| { | |||
| while (true) | |||
| { | |||
| this.Invoke(new InvokeHandler(delegate() | |||
| { | |||
| list = OrderConfirmRpc.GetConfirmOrder(uDatePicker1.Date.Value); | |||
| BindOrderGrid(); | |||
| })); | |||
| Thread.Sleep(5000); | |||
| } | |||
| } | |||
| ConfirmOrder last; | |||
| private void BindOrderGrid() | |||
| { | |||
| uDataGridView1.DataSource = list.OrderBy(x => x.Order).OrderBy(x => x.Confirmed).ToList(); | |||
| if (last == null && uDataGridView1.CurrentRow != null) | |||
| { | |||
| last = uDataGridView1.CurrentRow.DataBoundItem as ConfirmOrder; | |||
| if (last.Confirmed) | |||
| { | |||
| last = null; | |||
| uDataGridView1.CurrentRow.DefaultCellStyle.BackColor = Color.YellowGreen; | |||
| } | |||
| } | |||
| foreach (DataGridViewRow row in uDataGridView1.Rows) | |||
| { | |||
| if ((bool)row.Cells["C_Confirmed"].Value) | |||
| row.DefaultCellStyle.BackColor = Color.YellowGreen; | |||
| if (last != null && last.ID == (long)row.Cells["C_ID"].Value) | |||
| { | |||
| last = row.DataBoundItem as ConfirmOrder; | |||
| if (last.Confirmed) | |||
| row.DefaultCellStyle.BackColor = Color.Yellow; | |||
| else | |||
| row.DefaultCellStyle.BackColor = uDataGridView1.RowsDefaultCellStyle.SelectionBackColor; | |||
| } | |||
| } | |||
| if (last != null && !last.Confirmed) | |||
| orderLabel.Text = last.Order.ToString(); | |||
| else | |||
| orderLabel.Text = "0"; | |||
| InitScrollBar1(); | |||
| uDataGridView1.ClearSelection(); | |||
| try | |||
| { | |||
| if (roll != -1) | |||
| uDataGridView1.FirstDisplayedScrollingRowIndex = roll; | |||
| } | |||
| catch | |||
| { | |||
| roll = -1; | |||
| } | |||
| uDataGridView1.Refresh(); | |||
| } | |||
| private void existBtn_Click(object sender, EventArgs e) | |||
| { | |||
| this.Close(); | |||
| } | |||
| int roll = -1; | |||
| private void InitScrollBar1() | |||
| { | |||
| vScrollBar1.Maximum = (uDataGridView1.RowCount - uDataGridView1.DisplayedRowCount(false) + 30) * uDataGridView1.RowTemplate.Height; | |||
| vScrollBar1.Minimum = 0; | |||
| vScrollBar1.SmallChange = uDataGridView1.RowTemplate.Height; | |||
| vScrollBar1.LargeChange = uDataGridView1.RowTemplate.Height * 30; | |||
| this.vScrollBar1.Scroll += (sender, e) => | |||
| { | |||
| roll = e.NewValue / uDataGridView1.RowTemplate.Height; | |||
| uDataGridView1.FirstDisplayedScrollingRowIndex = roll; | |||
| }; | |||
| } | |||
| private void uDataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) | |||
| { | |||
| if (e.RowIndex == -1) | |||
| return; | |||
| var entity = uDataGridView1.CurrentRow.DataBoundItem as ConfirmOrder; | |||
| if (e.ColumnIndex != uDataGridView1.Columns.Count - 1)//非确定列 | |||
| { | |||
| if (last != null) | |||
| { | |||
| foreach (DataGridViewRow row in uDataGridView1.Rows) | |||
| { | |||
| if (last.ID == (long)row.Cells["C_ID"].Value) | |||
| { | |||
| row.DefaultCellStyle.BackColor = last.Confirmed ? Color.YellowGreen : uDataGridView1.RowsDefaultCellStyle.BackColor; | |||
| break; | |||
| } | |||
| } | |||
| } | |||
| last = entity; | |||
| uDataGridView1.CurrentRow.DefaultCellStyle.SelectionBackColor = last.Confirmed ? Color.Yellow : uDataGridView1.RowsDefaultCellStyle.SelectionBackColor; | |||
| this.orderLabel.Text = last.Order.ToString(); | |||
| } | |||
| else//确定列 | |||
| { | |||
| uDataGridView1.CurrentRow.DefaultCellStyle.SelectionBackColor = last.Confirmed ? Color.YellowGreen : uDataGridView1.RowsDefaultCellStyle.BackColor; | |||
| last = null; | |||
| } | |||
| uDataGridView1.Refresh(); | |||
| } | |||
| private void uDataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) | |||
| { | |||
| if (e.RowIndex == -1) | |||
| return; | |||
| if (e.ColumnIndex == uDataGridView1.ColumnCount - 1)//确定 | |||
| { | |||
| var entity = uDataGridView1.CurrentRow.DataBoundItem as ConfirmOrder; | |||
| if (entity.Confirmed) | |||
| return; | |||
| entity.Confirmed = true; | |||
| OrderConfirmRpc.SetOrderConfirmed(entity.ID); | |||
| BindOrderGrid(); | |||
| } | |||
| } | |||
| } | |||
| } | |||
| @ -0,0 +1,141 @@ | |||
| <?xml version="1.0" encoding="utf-8"?> | |||
| <root> | |||
| <!-- | |||
| Microsoft ResX Schema | |||
| Version 2.0 | |||
| The primary goals of this format is to allow a simple XML format | |||
| that is mostly human readable. The generation and parsing of the | |||
| various data types are done through the TypeConverter classes | |||
| associated with the data types. | |||
| Example: | |||
| ... ado.net/XML headers & schema ... | |||
| <resheader name="resmimetype">text/microsoft-resx</resheader> | |||
| <resheader name="version">2.0</resheader> | |||
| <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> | |||
| <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> | |||
| <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> | |||
| <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> | |||
| <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> | |||
| <value>[base64 mime encoded serialized .NET Framework object]</value> | |||
| </data> | |||
| <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> | |||
| <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> | |||
| <comment>This is a comment</comment> | |||
| </data> | |||
| There are any number of "resheader" rows that contain simple | |||
| name/value pairs. | |||
| Each data row contains a name, and value. The row also contains a | |||
| type or mimetype. Type corresponds to a .NET class that support | |||
| text/value conversion through the TypeConverter architecture. | |||
| Classes that don't support this are serialized and stored with the | |||
| mimetype set. | |||
| The mimetype is used for serialized objects, and tells the | |||
| ResXResourceReader how to depersist the object. This is currently not | |||
| extensible. For a given mimetype the value must be set accordingly: | |||
| Note - application/x-microsoft.net.object.binary.base64 is the format | |||
| that the ResXResourceWriter will generate, however the reader can | |||
| read any of the formats listed below. | |||
| mimetype: application/x-microsoft.net.object.binary.base64 | |||
| value : The object must be serialized with | |||
| : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter | |||
| : and then encoded with base64 encoding. | |||
| mimetype: application/x-microsoft.net.object.soap.base64 | |||
| value : The object must be serialized with | |||
| : System.Runtime.Serialization.Formatters.Soap.SoapFormatter | |||
| : and then encoded with base64 encoding. | |||
| mimetype: application/x-microsoft.net.object.bytearray.base64 | |||
| value : The object must be serialized into a byte array | |||
| : using a System.ComponentModel.TypeConverter | |||
| : and then encoded with base64 encoding. | |||
| --> | |||
| <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> | |||
| <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> | |||
| <xsd:element name="root" msdata:IsDataSet="true"> | |||
| <xsd:complexType> | |||
| <xsd:choice maxOccurs="unbounded"> | |||
| <xsd:element name="metadata"> | |||
| <xsd:complexType> | |||
| <xsd:sequence> | |||
| <xsd:element name="value" type="xsd:string" minOccurs="0" /> | |||
| </xsd:sequence> | |||
| <xsd:attribute name="name" use="required" type="xsd:string" /> | |||
| <xsd:attribute name="type" type="xsd:string" /> | |||
| <xsd:attribute name="mimetype" type="xsd:string" /> | |||
| <xsd:attribute ref="xml:space" /> | |||
| </xsd:complexType> | |||
| </xsd:element> | |||
| <xsd:element name="assembly"> | |||
| <xsd:complexType> | |||
| <xsd:attribute name="alias" type="xsd:string" /> | |||
| <xsd:attribute name="name" type="xsd:string" /> | |||
| </xsd:complexType> | |||
| </xsd:element> | |||
| <xsd:element name="data"> | |||
| <xsd:complexType> | |||
| <xsd:sequence> | |||
| <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |||
| <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> | |||
| </xsd:sequence> | |||
| <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> | |||
| <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> | |||
| <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> | |||
| <xsd:attribute ref="xml:space" /> | |||
| </xsd:complexType> | |||
| </xsd:element> | |||
| <xsd:element name="resheader"> | |||
| <xsd:complexType> | |||
| <xsd:sequence> | |||
| <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | |||
| </xsd:sequence> | |||
| <xsd:attribute name="name" type="xsd:string" use="required" /> | |||
| </xsd:complexType> | |||
| </xsd:element> | |||
| </xsd:choice> | |||
| </xsd:complexType> | |||
| </xsd:element> | |||
| </xsd:schema> | |||
| <resheader name="resmimetype"> | |||
| <value>text/microsoft-resx</value> | |||
| </resheader> | |||
| <resheader name="version"> | |||
| <value>2.0</value> | |||
| </resheader> | |||
| <resheader name="reader"> | |||
| <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||
| </resheader> | |||
| <resheader name="writer"> | |||
| <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | |||
| </resheader> | |||
| <metadata name="C_ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="C_Confirmed.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="C_Order.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="C_B3WeighBill_ID.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="C_LiveColonyHouse_Name.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="C_Number.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| <metadata name="C_OK.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> | |||
| <value>True</value> | |||
| </metadata> | |||
| </root> | |||
| @ -0,0 +1,36 @@ | |||
| using System.Reflection; | |||
| using System.Runtime.CompilerServices; | |||
| using System.Runtime.InteropServices; | |||
| // 有关程序集的常规信息通过以下 | |||
| // 特性集控制。更改这些特性值可修改 | |||
| // 与程序集关联的信息。 | |||
| [assembly: AssemblyTitle("OrderConfirm")] | |||
| [assembly: AssemblyDescription("")] | |||
| [assembly: AssemblyConfiguration("")] | |||
| [assembly: AssemblyCompany("")] | |||
| [assembly: AssemblyProduct("OrderConfirm")] | |||
| [assembly: AssemblyCopyright("Copyright © 2017")] | |||
| [assembly: AssemblyTrademark("")] | |||
| [assembly: AssemblyCulture("")] | |||
| // 将 ComVisible 设置为 false 使此程序集中的类型 | |||
| // 对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, | |||
| // 则将该类型上的 ComVisible 特性设置为 true。 | |||
| [assembly: ComVisible(false)] | |||
| // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID | |||
| [assembly: Guid("6b7a6cf7-f71a-4404-9d32-152bdf5c1814")] | |||
| // 程序集的版本信息由下面四个值组成: | |||
| // | |||
| // 主版本 | |||
| // 次版本 | |||
| // 生成号 | |||
| // 修订号 | |||
| // | |||
| // 可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, | |||
| // 方法是按如下所示使用“*”: | |||
| // [assembly: AssemblyVersion("1.0.*")] | |||
| [assembly: AssemblyVersion("1.0.0.0")] | |||
| [assembly: AssemblyFileVersion("1.0.0.0")] | |||