Browse Source

需求单No.2864

master
Robin_PC\robin 1 month ago
parent
commit
e133f0c832
5 changed files with 103 additions and 5 deletions
  1. +4
    -0
      ButcherFactory.BO/BaseInfo/ClientGoodsSet.cs
  2. +2
    -1
      ButcherFactory.BO/BaseInfo/Goods.cs
  3. +33
    -0
      ButcherFactory.BO/LocalBL/FormClientGoodsSetBL.cs
  4. +32
    -0
      ButcherFactory.Form/Dialogs/ClientGoodsSetDialog.Designer.cs
  5. +32
    -4
      ButcherFactory.Form/Dialogs/ClientGoodsSetDialog.cs

+ 4
- 0
ButcherFactory.BO/BaseInfo/ClientGoodsSet.cs View File

@ -61,6 +61,10 @@ namespace ButcherFactory.BO
[Join("Goods_ID", "ID")] [Join("Goods_ID", "ID")]
public string Goods_CustomerDefine { get; set; } public string Goods_CustomerDefine { get; set; }
[ReferenceTo(typeof(Goods), "Spell")]
[Join("Goods_ID", "ID")]
public string Goods_Spell { get; set; }
public decimal? StandardWeight { get; set; } public decimal? StandardWeight { get; set; }
public decimal? StandardWeightUp { get; set; } public decimal? StandardWeightUp { get; set; }


+ 2
- 1
ButcherFactory.BO/BaseInfo/Goods.cs View File

@ -9,7 +9,8 @@ namespace ButcherFactory.BO
{ {
[MapToTable("Butcher_Goods")] [MapToTable("Butcher_Goods")]
public class Goods : BaseInfo public class Goods : BaseInfo
{
{
public string Spell { get; set; }
public string Code { get; set; } public string Code { get; set; }
public string Spec { get; set; } public string Spec { get; set; }


+ 33
- 0
ButcherFactory.BO/LocalBL/FormClientGoodsSetBL.cs View File

@ -60,6 +60,39 @@ namespace ButcherFactory.BO.LocalBL
return result; return result;
} }
public static IEnumerable<ClientGoodsSet_Detail> GetGoodsSetDic2(string spell)
{
var main = new JoinAlias(typeof(ClientGoodsSet));
var detail = new JoinAlias(typeof(ClientGoodsSet_Detail));
var set = new JoinAlias(typeof(GoodsSetTemp));
var query = new DQueryDom(main);
query.RegisterQueryTable(typeof(GoodsSetTemp), new string[] { "DetailID" }, GoodsSetTemp.GetQueryDom());
query.From.AddJoin(JoinType.Inner, new DQDmoSource(detail), DQCondition.EQ(main, "ID", detail, "ClientGoodsSet_ID"));
query.From.AddJoin(JoinType.Left, new DQDmoSource(set), DQCondition.EQ(detail, "ID", set, "DetailID"));
query.Columns.Add(DQSelectColumn.Field("Goods_Name", detail));
query.Columns.Add(DQSelectColumn.Field("ID", detail));
query.Columns.Add(DQSelectColumn.Field("DetailID", set));
if (!string.IsNullOrEmpty(spell))
{
query.Where.Conditions.Add(DQCondition.Or(
DQCondition.Like(detail, "Goods_Name", spell),
DQCondition.Like(detail, "Goods_Spell", spell)));
}
var list = query.EExecuteList< string, long, long? >();
var result = new List<ClientGoodsSet_Detail>();
foreach (var item in list )
{
result.Add(new ClientGoodsSet_Detail {
Goods_Name = item.Item1,
ID = item.Item2,
Selected = item.Item3.HasValue });
}
return result;
}
public static Dictionary<string, List<ClientGoodsSet_Detail>> GetSelectedDetail() public static Dictionary<string, List<ClientGoodsSet_Detail>> GetSelectedDetail()
{ {
var main = new JoinAlias(typeof(ClientGoodsSet)); var main = new JoinAlias(typeof(ClientGoodsSet));


+ 32
- 0
ButcherFactory.Form/Dialogs/ClientGoodsSetDialog.Designer.cs View File

@ -32,6 +32,8 @@
this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();
this.colseBtn = new ButcherFactory.Controls.ColorButton(); this.colseBtn = new ButcherFactory.Controls.ColorButton();
this.flowLayoutPanel3 = new System.Windows.Forms.FlowLayoutPanel(); this.flowLayoutPanel3 = new System.Windows.Forms.FlowLayoutPanel();
this.textBox1 = new System.Windows.Forms.TextBox();
this.searchBtn = new ButcherFactory.Controls.ColorButton();
this.SuspendLayout(); this.SuspendLayout();
// //
// flowLayoutPanel2 // flowLayoutPanel2
@ -87,12 +89,39 @@
this.flowLayoutPanel3.Size = new System.Drawing.Size(1108, 144); this.flowLayoutPanel3.Size = new System.Drawing.Size(1108, 144);
this.flowLayoutPanel3.TabIndex = 28; this.flowLayoutPanel3.TabIndex = 28;
// //
// textBox1
//
this.textBox1.Font = new System.Drawing.Font("宋体", 14F);
this.textBox1.Location = new System.Drawing.Point(13, 13);
this.textBox1.Margin = new System.Windows.Forms.Padding(4);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(257, 34);
this.textBox1.TabIndex = 29;
this.textBox1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.textBox1_MouseDown);
//
// searchBtn
//
this.searchBtn.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(21)))), ((int)(((byte)(198)))), ((int)(((byte)(58)))));
this.searchBtn.Font = new System.Drawing.Font("宋体", 12F);
this.searchBtn.ForeColor = System.Drawing.Color.White;
this.searchBtn.Location = new System.Drawing.Point(290, 10);
this.searchBtn.Margin = new System.Windows.Forms.Padding(4);
this.searchBtn.Name = "searchBtn";
this.searchBtn.SelectedColor = System.Drawing.Color.FromArgb(((int)(((byte)(158)))), ((int)(((byte)(234)))), ((int)(((byte)(106)))));
this.searchBtn.Size = new System.Drawing.Size(107, 38);
this.searchBtn.TabIndex = 30;
this.searchBtn.Text = "查询";
this.searchBtn.UseVisualStyleBackColor = false;
this.searchBtn.Click += new System.EventHandler(this.searchBtn_Click);
//
// ClientGoodsSetDialog // ClientGoodsSetDialog
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F); this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.Color.White; this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(1112, 666); this.ClientSize = new System.Drawing.Size(1112, 666);
this.Controls.Add(this.searchBtn);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.flowLayoutPanel3); this.Controls.Add(this.flowLayoutPanel3);
this.Controls.Add(this.colseBtn); this.Controls.Add(this.colseBtn);
this.Controls.Add(this.flowLayoutPanel2); this.Controls.Add(this.flowLayoutPanel2);
@ -104,6 +133,7 @@
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "存货设置"; this.Text = "存货设置";
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout();
} }
@ -113,5 +143,7 @@
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1; private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;
private Controls.ColorButton colseBtn; private Controls.ColorButton colseBtn;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel3; private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel3;
private System.Windows.Forms.TextBox textBox1;
private Controls.ColorButton searchBtn;
} }
} }

+ 32
- 4
ButcherFactory.Form/Dialogs/ClientGoodsSetDialog.cs View File

@ -10,7 +10,9 @@ using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows.Forms; using System.Windows.Forms;
using System.Windows.Input;
using WinFormControl;
namespace ButcherFactory.Dialogs namespace ButcherFactory.Dialogs
{ {
public partial class ClientGoodsSetDialog : Form public partial class ClientGoodsSetDialog : Form
@ -32,8 +34,7 @@ namespace ButcherFactory.Dialogs
btn.Click += GroupBtnClick01; btn.Click += GroupBtnClick01;
flowLayoutPanel1.Controls.Add(btn); flowLayoutPanel1.Controls.Add(btn);
} }
} }
string SelectName = ""; string SelectName = "";
@ -84,6 +85,33 @@ namespace ButcherFactory.Dialogs
private void closeBtn_Click(object sender, EventArgs e) private void closeBtn_Click(object sender, EventArgs e)
{ {
this.Close(); this.Close();
}
}
private void searchBtn_Click(object sender, EventArgs e)
{
var goodsSet = FormClientGoodsSetBL.GetGoodsSetDic2(textBox1.Text.ToLower());
flowLayoutPanel2.Controls.Clear();
foreach (var item in goodsSet)
{
var btn = new ColorButton() { Width = 140, Height = 90, Text = item.Goods_Name, Tag = item, Font = new Font("宋体", 12, FontStyle.Bold), BackColor = goodsColor, Margin = new Padding(10, 10, 10, 35), PlaySound = true, StateHold = true };
if (item.Selected)
btn.Selected = true;
btn.Click += GoodsBtnClick;
flowLayoutPanel2.Controls.Add(btn);
}
}
private void PwdTextBoxClick(object sender, MouseButtonEventArgs e)
{
}
private void textBox1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
var keyBoard = new VirtualKeyPad();
if (keyBoard.ShowDialog() == true)
textBox1.Text = keyBoard.Result;
}
} }
} }

Loading…
Cancel
Save