You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

64 lines
1.6 KiB

using ButcherFactory.BO;
using ButcherFactory.BO.LocalBL;
using ButcherFactory.BO.Utils;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace ButcherFactory.Dialogs
{
public partial class AddWeightRecord : Form
{
SaleOutStore_Detail mDetail;
decimal number = 1;
public AddWeightRecord(SaleOutStore_Detail detail)
{
InitializeComponent();
mDetail = detail;
goodsLabel.Text = mDetail.Goods_Name;
}
private void okBtn_Click(object sender, EventArgs e)
{
decimal weight = 0;
if (!decimal.TryParse(weightInput.Text, out weight))
throw new Exception("请输入重量");
var record = new CarcassSaleOut_Detail();
record.BillID = mDetail.SaleOutStore_ID;
record.DetailID = mDetail.ID;
record.Filled = true;
record.Goods_Code = mDetail.Goods_Code;
record.Goods_ID = mDetail.Goods_ID;
record.Goods_Name = mDetail.Goods_Name;
record.Number = number;
record.Weight = weight;
record.Operator = AppContext.Worker.Name;
CarcassSaleOutBL.AddAndUpdate(record);
DialogResult = DialogResult.OK;
this.Close();
}
private void cancelBtn_Click(object sender, EventArgs e)
{
this.Close();
}
private void helfBtn_Click(object sender, EventArgs e)
{
number = 0.5m;
}
private void fullBtn_Click(object sender, EventArgs e)
{
number = 1;
}
}
}