Browse Source

新增加需求

master
wugang 8 years ago
parent
commit
07844fc289
15 changed files with 204 additions and 38 deletions
  1. +7
    -0
      CowOutputClient/CowOutputClient.csproj
  2. +5
    -4
      CowOutputClient/OperateWindow.xaml
  3. +9
    -10
      CowOutputClient/OperateWindow.xaml.cs
  4. +44
    -0
      CowOutputClient/ProductCatalogSequenceWindow.xaml
  5. +82
    -0
      CowOutputClient/ProductCatalogSequenceWindow.xaml.cs
  6. +4
    -3
      CowOutputClient/SelectedProductWindow.xaml
  7. +10
    -2
      CowOutputClient/SelectedProductWindow.xaml.cs
  8. +2
    -2
      CowOutputClient/app.config
  9. +5
    -11
      FireBirdUtil/SqlHelper/CreateTableHelper.cs
  10. +21
    -3
      WeighBusiness/BL/ProductCatalogBL.cs
  11. +11
    -3
      WeighBusiness/BL/ProductPlanBL.cs
  12. +1
    -0
      WeighBusiness/BO/ButcherDetail.cs
  13. +1
    -0
      WeighBusiness/BO/CreateTables/CreateButcherDetail.cs
  14. +1
    -0
      WeighBusiness/BO/CreateTables/CreateProductCatalog.cs
  15. +1
    -0
      WeighBusiness/BO/ProductCatalog.cs

+ 7
- 0
CowOutputClient/CowOutputClient.csproj View File

@ -67,6 +67,9 @@
<Compile Include="OperateWindow.xaml.cs">
<DependentUpon>OperateWindow.xaml</DependentUpon>
</Compile>
<Compile Include="ProductCatalogSequenceWindow.xaml.cs">
<DependentUpon>ProductCatalogSequenceWindow.xaml</DependentUpon>
</Compile>
<Compile Include="SelectedProductWindow.xaml.cs">
<DependentUpon>SelectedProductWindow.xaml</DependentUpon>
</Compile>
@ -98,6 +101,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="ProductCatalogSequenceWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="SelectedProductWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>


+ 5
- 4
CowOutputClient/OperateWindow.xaml View File

@ -18,7 +18,7 @@
</StackPanel>
<ScrollViewer x:Name="scrList2" Margin="30,150,0,0" VerticalScrollBarVisibility="Auto" Width="350" Height="100" HorizontalAlignment="Left" VerticalAlignment="Top">
<WrapPanel Name="ProductCatalogPanel" ItemHeight="45" ItemWidth="110" Margin="0" Width="{Binding ElementName=scrList, Path=Width, Mode=OneWay}" >
<Button Focusable="False" Content="鲜品" Name="btn4" FontSize="20" Margin="10,10,0,0" />
<!--<Button Focusable="False" Content="鲜品" Name="btn4" FontSize="20" Margin="10,10,0,0" />
<Button Focusable="False" Content="鲜品" Name="btn3" FontSize="20" Margin="10,10,0,0" />
<Button Focusable="False" Content="鲜品" Name="btn2" FontSize="20" Margin="10,10,0,0" />
<Button Focusable="False" Content="鲜品" Name="btn5" FontSize="20" Margin="10,10,0,0" />
@ -27,7 +27,7 @@
<Button Focusable="False" Content="鲜品" Name="btn9" FontSize="20" Margin="10,0,0,0" />
<Button Focusable="False" Content="鲜品" Name="btn10" FontSize="20" Margin="10,0,0,0" />
<Button Focusable="False" Content="鲜品" Name="btn11" FontSize="20" Margin="10,0,0,0" />
<Button Focusable="False" Content="鲜品" Name="btn12" FontSize="20" Margin="10,0,0,0" />
<Button Focusable="False" Content="鲜品" Name="btn12" FontSize="20" Margin="10,0,0,0" />-->
</WrapPanel>
</ScrollViewer>
<Grid Name="Grid1" Margin="30,260,0,0" Width="350" Height="480" HorizontalAlignment="Left" VerticalAlignment="Top">
@ -77,8 +77,8 @@ Property="HorizontalContentAlignment" Value="Center">
<DataGridTextColumn Binding="{Binding Remark}" IsReadOnly="True" Header="备注" Width="1.6*"/>
<DataGridTextColumn Binding="{Binding Goods_Name}" IsReadOnly="True" Header="产品名称" Width="1.7*"/>
<DataGridTextColumn Binding="{Binding Goods_Spec}" IsReadOnly="True" Header="规格" Width="1*"/>
<DataGridTextColumn IsReadOnly="True" Binding="{Binding PlanNumber}" Header="计划数" Width="1*"/>
<DataGridTextColumn IsReadOnly="True" Binding="{Binding FinishNum}" Header="完工数" Width="1*"/>
<DataGridTextColumn IsReadOnly="True" Binding="{Binding PlanNumber}" Header="计划数" Width="1*"/>
<DataGridTextColumn IsReadOnly="True" Binding="{Binding FinishNum}" Header="完工数" Width="1*"/>
<DataGridTextColumn IsReadOnly="True" Binding="{Binding SurplusNum}" Header="余数" Width="1*"/>
<DataGridTemplateColumn Header="操作" Width="1*">
<DataGridTemplateColumn.CellTemplate>
@ -92,6 +92,7 @@ Property="HorizontalContentAlignment" Value="Center">
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Binding="{Binding DeliveryDateStr}" IsReadOnly="True" Header="日期" />
<DataGridTextColumn IsReadOnly="True" Header="" Width="0.1*"/>
</DataGrid.Columns>
</DataGrid>


+ 9
- 10
CowOutputClient/OperateWindow.xaml.cs View File

@ -77,6 +77,7 @@ namespace CowOutputClient
output.Set<long?>("Department_ID", wpfUser.Department_ID);
output.Set<long?>("Domain_ID", long.Parse(domain_ID));
output.Set<long?>("Employee_ID", wpfUser.Employee_ID ?? 0);
output.Set<long?>("ProductTeam_ID", mTeam.ProductTeam_ID);
var batch = (ProductBatch)combProductBatch.SelectedItem;
output.Set<long?>("ProductBatch_ID", batch.Batch_ID);
output.Set<string>("Product_Batch", batch.Batch);
@ -91,7 +92,7 @@ namespace CowOutputClient
details.Add(inputDetail);
}
output.Set("Details", details);
var list = RpcFacade.Call<List<long?>>("/MainSystem/B3_HaoYue/Rpcs/B3CowButcherManageRpc/CreateOutput", output,mTeam.ProductTeam_ID,false,null);
var list = RpcFacade.Call<List<long?>>("/MainSystem/B3_HaoYue/Rpcs/B3CowButcherManageRpc/CreateOutput", output,mTeam.ProductTeam_ID,false,null,mTeam.Name);
if (list.Count() > 0) {
var outputId = list[0].Value;
WeightInfoBL.UpdateOutputId(selectedItems.Select(x => x.ID).ToArray(),outputId);
@ -111,7 +112,7 @@ namespace CowOutputClient
gridProductPlan.ItemsSource = resultList;
}
WindowUtil.Inf("生成产出单No." + outputId);
WindowUtil.Inf("创建产出单No." + outputId);
}
}
@ -384,6 +385,7 @@ namespace CowOutputClient
output.Set<long?>("ProductBatch_ID", batch.Batch_ID);
output.Set<string>("Product_Batch", batch.Batch);
output.Set<DateTime?>("Date", DateTime.Now);
output.Set<long?>("ProductTeam_ID", mTeam.ProductTeam_ID);
var details = new ManyList("/MainSystem/B3CowButcherManage/BO/Output_Detail");
var inputDetail = new RpcObject("/MainSystem/B3CowButcherManage/BO/Output_Detail");
@ -393,7 +395,7 @@ namespace CowOutputClient
details.Add(inputDetail);
output.Set("Details", details);
}
var list = RpcFacade.Call<List<long?>>("/MainSystem/B3_HaoYue/Rpcs/B3CowButcherManageRpc/CreateOutput", output, mTeam.ProductTeam_ID, true, selectedItem.DetailID);
var list = RpcFacade.Call<List<long?>>("/MainSystem/B3_HaoYue/Rpcs/B3CowButcherManageRpc/CreateOutput", output, mTeam.ProductTeam_ID, true, selectedItem.DetailID,mTeam.Name);
if (list == null) {
ProductPlanBL.UpdateButhcerDetailFinish(selectedItem.DetailID);
var butDetails = gridProductPlan.ItemsSource as List<ButcherDetailData>;
@ -540,14 +542,11 @@ namespace CowOutputClient
private void btnTare_Click_1(object sender, RoutedEventArgs e)
{
var w = ConfigurationManager.AppSettings["Weight"];
if (!string.IsNullOrEmpty(w)) {
ComWeight.Text = w;
var keypadWindow = new Keypad(this);
if (keypadWindow.ShowDialog() == true && !string.IsNullOrEmpty(keypadWindow.Result)) {
tare = decimal.Parse(keypadWindow.Result);
btnTare.Content = keypadWindow.Result;
}
if (string.IsNullOrEmpty(ComWeight.Text))
WindowUtil.Err("称上没有重量");
tare = decimal.Parse(ComWeight.Text);
btnTare.Content = ComWeight.Text;
}
private void btnClear_Click_1(object sender, RoutedEventArgs e)


+ 44
- 0
CowOutputClient/ProductCatalogSequenceWindow.xaml View File

@ -0,0 +1,44 @@
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:cc="clr-namespace:CowOutputClient"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
x:Class="CowOutputClient.ProductCatalogSequenceWindow"
Title="ProductCatalogSequenceWindow" Height="500" Width="705" Loaded="Window_Loaded" WindowStyle="None" AllowsTransparency="True" Background="#0fff" WindowStartupLocation="CenterScreen" >
<Grid MouseLeftButtonDown="Grid_MouseLeftButtonDown">
<Border CornerRadius="20" Background="#ccc">
<Border Margin="20" Background="White">
</Border>
</Border>
<Grid Name="Grid2" Margin="30,20,0,0" Width="650" Height="400" HorizontalAlignment="Left" VerticalAlignment="Top">
<ScrollViewer x:Name="scrList2" Margin="0" VerticalScrollBarVisibility="Auto">
<WrapPanel Name="ProductCatalogPanel" ItemHeight="45" ItemWidth="160" Width="{Binding ElementName=scrList2, Path=Width, Mode=OneWay}" Margin="0,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Top">
<!--<Button Focusable="False" Content="鲜品" FontSize="20" Margin="10,10,0,0" />
<TextBox FontSize="20" Text="123" Height="32" Margin="10,10,0,0" Width="50"/>
<Button Focusable="False" Content="鲜品" FontSize="20" Margin="10,10,0,0" />
<TextBox FontSize="20" Text="123" TextAlignment="Justify" VerticalContentAlignment="Center" PreviewMouseDown="txtProduceStartDate_PreviewMouseDown_1" HorizontalAlignment="Left" Height="32" Margin="10,10,0,0" VerticalAlignment="Top" Width="50"/>-->
<!--<Button Focusable="False" Content="鲜品" Name="btn3" FontSize="20" Margin="10,10,0,0" />
<Button Focusable="False" Content="鲜品" Name="btn2" FontSize="20" Margin="10,10,0,0" />
<Button Focusable="False" Content="鲜品" Name="btn5" FontSize="20" Margin="10,10,0,0" />
<Button Focusable="False" Content="鲜品" Name="btn6" FontSize="20" Margin="10,10,0,0" />
<Button Focusable="False" Content="鲜品" Name="btn8" FontSize="20" Margin="10,10,0,0" />
<Button Focusable="False" Content="鲜品" Name="btn9" FontSize="20" Margin="10,10,0,0" />
<Button Focusable="False" Content="鲜品" Name="btn10" FontSize="20" Margin="10,10,0,0" />
<Button Focusable="False" Content="鲜品" Name="btn11" FontSize="20" Margin="10,10,0,0" />
<Button Focusable="False" Content="鲜品" Name="btn12" FontSize="20" Margin="10,10,0,0" />
<Button Focusable="False" Content="鲜品" Name="btn13" FontSize="20" Margin="10,10,0,0" />
<Button Focusable="False" Content="鲜品" Name="btn14" FontSize="20" Margin="10,10,0,0" />-->
</WrapPanel>
</ScrollViewer>
</Grid>
<Button Focusable="False" Content="保存" Name="btnSave" Click="btnSave_Click_1" FontSize="20" Margin="0,425,120,0" Width="70" Height="50" HorizontalAlignment="Right" VerticalAlignment="Top"/>
<Button Focusable="False" Content="关闭" Name="btnClose" Click="btnClose_Click_1" FontSize="20" Margin="0,425,30,0" Width="70" Height="50" HorizontalAlignment="Right" VerticalAlignment="Top"/>
</Grid>
</Window>

+ 82
- 0
CowOutputClient/ProductCatalogSequenceWindow.xaml.cs View File

@ -0,0 +1,82 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
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.Shapes;
using KeyPad;
using WeighBusiness.BL;
using WeighBusiness.BO;
namespace CowOutputClient
{
public partial class ProductCatalogSequenceWindow : Window
{
private List<ProductCatalog> catalogs = new List<ProductCatalog>();
List<long> detailIds = new List<long>();
public ProductCatalogSequenceWindow()
{
InitializeComponent();
}
private void Grid_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
DragMove();
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
BindProductCatalogs();
}
private void BindProductCatalogs()
{
ProductCatalogPanel.Children.Clear();
catalogs = ProductCatalogBL.GetProductCatalogs();
if (catalogs.Count() > 0) {
foreach (var catalog in catalogs) {
var txtCatalog = new TextBlock() { Text = catalog.Name, FontSize = 20, TextWrapping = TextWrapping.Wrap, TextAlignment = TextAlignment.Center };
var txtCatalogSequence = new TextBox() { Text = (catalog.Sequence == null ? string.Empty : catalog.Sequence.ToString()), FontSize = 20, TextWrapping = TextWrapping.Wrap, TextAlignment = TextAlignment.Center, Tag = catalog, Margin = new Thickness(10, 10, 0, 0) };
txtCatalogSequence.PreviewMouseDown += (object sende, MouseButtonEventArgs args) => {
var keypadWindow = new Keypad(this);
if (keypadWindow.ShowDialog() == true && !string.IsNullOrEmpty(keypadWindow.Result)) {
int num;
if(int.TryParse(keypadWindow.Result,out num)){
txtCatalogSequence.Text = num.ToString();
var cata = (ProductCatalog)txtCatalogSequence.Tag;
cata.Sequence = num;
}else{
throw new ApplicationException("输入的数字不正确");
}
}
};
var border = new Border();
border.BorderThickness = new Thickness(1, 1, 1, 1);
border.BorderBrush = Brushes.Black;
border.Child = txtCatalog;
border.Margin = new Thickness(10, 10, 0, 0);
ProductCatalogPanel.Children.Add(border);
ProductCatalogPanel.Children.Add(txtCatalogSequence);
}
}
}
private void btnClose_Click_1(object sender, RoutedEventArgs e)
{
this.DialogResult = false;
}
private void btnSave_Click_1(object sender, RoutedEventArgs e)
{
ProductCatalogBL.UpdateSequence(catalogs);
this.DialogResult = true;
}
}
}

+ 4
- 3
CowOutputClient/SelectedProductWindow.xaml View File

@ -30,9 +30,10 @@
</WrapPanel>
</ScrollViewer>
</Grid>
<Button Focusable="False" Content="保存" Name="btnSave" Click="btnSave_Click_1" FontSize="20" Margin="0,40,120,0" Width="70" Height="50" HorizontalAlignment="Right" VerticalAlignment="Top"/>
<Button Focusable="False" Content="关闭" Name="btnClose" Click="btnClose_Click_1" FontSize="20" Margin="0,40,30,0" Width="70" Height="50" HorizontalAlignment="Right" VerticalAlignment="Top"/>
<Button Focusable="False" Content="设置顺序" Name="btnSequence" Click="btnSequence_Click_1" FontSize="20" Margin="0,24,30,0" Width="100" Height="35" HorizontalAlignment="Right" VerticalAlignment="Top"/>
<Button Focusable="False" Content="保存" Name="btnSave" Click="btnSave_Click_1" FontSize="20" Margin="0,70,120,0" Width="70" Height="35" HorizontalAlignment="Right" VerticalAlignment="Top"/>
<Button Focusable="False" Content="关闭" Name="btnClose" Click="btnClose_Click_1" FontSize="20" Margin="0,70,30,0" Width="70" Height="35" HorizontalAlignment="Right" VerticalAlignment="Top"/>
<Grid Name="Grid1" Margin="30,115,0,0" Width="650" Height="360" HorizontalAlignment="Left" VerticalAlignment="Top">
<Border BorderThickness="1" BorderBrush="Black">
</Border>


+ 10
- 2
CowOutputClient/SelectedProductWindow.xaml.cs View File

@ -22,7 +22,7 @@ namespace CowOutputClient
{
private List<ProCataGoods> catalogsDetails = new List<ProCataGoods>();
List<long> detailIds = new List<long>();
bool? useSequenceWindow = null;
public SelectedProductWindow()
{
InitializeComponent();
@ -112,7 +112,7 @@ namespace CowOutputClient
private void btnClose_Click_1(object sender, RoutedEventArgs e)
{
this.DialogResult = false;
this.DialogResult = useSequenceWindow == true ? true : false;
}
private void btnSave_Click_1(object sender, RoutedEventArgs e)
@ -120,5 +120,13 @@ namespace CowOutputClient
ProductCatalogBL.UpdateProductCatalogDetails(catalogsDetails.Where(x => x.IsSelected));
this.DialogResult = true;
}
private void btnSequence_Click_1(object sender, RoutedEventArgs e)
{
useSequenceWindow = new ProductCatalogSequenceWindow().ShowDialog();
if (useSequenceWindow == true) {
BindProductCatalogs();
}
}
}
}

+ 2
- 2
CowOutputClient/app.config View File

@ -6,9 +6,9 @@
<appSettings>
<add key="UrlPath" value="http://localhost:2000/MainSystem/" />
<!-- 版块ID -->
<add key="Domain_ID" value="4" />
<add key="Domain_ID" value="1" />
<!-- 会计单位ID -->
<add key="AccountingUnit_ID" value="11" />
<add key="AccountingUnit_ID" value="13" />
<!-- 存货ID -->
<add key="Goods_ID" value="2776" />
<!-- ************************* 电子秤1相关 ****************************-->


+ 5
- 11
FireBirdUtil/SqlHelper/CreateTableHelper.cs View File

@ -35,17 +35,11 @@ namespace FireBirdUtil.SqlHelpers
private void AlterTable(string database,string tableName)
{
//if (tableName == "PSInfo")
//{
// AddColumnToTable(database, "PSINFO", "BILLSET", "varchar(100)");
// AddColumnToTable(database, "PSINFO", "WINDOWSET", "varchar(100)");
// AddColumnToTable(database, "PSINFO", "GOODSINSTORE_ID", "Integer");
//}
//else if (tableName == "ProduceBatch")
//{
// AddColumnToTable(database, "PRODUCEBATCH", "MAINNUMBER", "decimal(18,6)");
// AddColumnToTable(database, "PRODUCEBATCH", "BILLID", "Integer");
//}
if (tableName == "ProductCatalog") {
AddColumnToTable(database, "PRODUCTCATALOG", "SEQUENCE", "Integer");
} else if (tableName == "ButcherDetail") {
AddColumnToTable(database, "BUTCHERDETAIL", "DELIVERYDATE", "TIMESTAMP");
}
//else if (tableName == "ProduceIntake")
//{
// AddColumnToTable(database, "PRODUCEINTAKE", "OUTGOODS_ID", "Integer");


+ 21
- 3
WeighBusiness/BL/ProductCatalogBL.cs View File

@ -193,10 +193,10 @@ namespace WeighBusiness.BL
string errorMessage;
using (var she = new SqlHelperEx()) {
she.CreateTransaction();
var sql = SqlUtil.GetDeleteSql(TableNames.);
var sql = SqlUtil.GetDeleteSql(TableNames.);
she.ExecuteNonQuery(sql, out success, out errorMessage);
if (success) {
var sql3 = SqlUtil.GetDeleteSql(TableNames.);
var sql3 = SqlUtil.GetDeleteSql(TableNames.);
she.ExecuteNonQuery(sql3, out success, out errorMessage);
}
if (!success)
@ -209,7 +209,7 @@ namespace WeighBusiness.BL
public static List<ProductCatalog> GetProductCatalogs()
{
var table = SqlHelperEx.DoQuery("select ProductCatalog_ID,Name from {0}".FormatWith(TableNames.));
var table = SqlHelperEx.DoQuery("select ProductCatalog_ID,Name,Sequence from {0} order by Sequence asc".FormatWith(TableNames.));
if (table.Rows.Count == 0)
return new List<ProductCatalog>();
var list = new List<ProductCatalog>();
@ -217,6 +217,7 @@ namespace WeighBusiness.BL
var catalog = new ProductCatalog();
catalog.ProductCatalog_ID = (long)(int.Parse(row[0].ToString()));
catalog.Name = row[1].ToString();
catalog.Sequence = DataTypeUtil.GetIntNullNum(row[2]);
list.Add(catalog);
}
return list;
@ -266,6 +267,23 @@ namespace WeighBusiness.BL
she.Commit();
}
}
public static void UpdateSequence(List<ProductCatalog> catalogs)
{
foreach (var catalog in catalogs) {
string updateSql = string.Format("update " + TableNames. + " set Sequence = {0} where ProductCatalog_ID ={1}", catalog.Sequence == null?"null":catalog.Sequence.ToString(), catalog.ProductCatalog_ID);
bool success = true;
using (var she = new SqlHelperEx()) {
she.CreateTransaction();
she.ExecuteNonQuery(updateSql, out success);
if (!success) {
she.Rollback();
} else {
she.Commit();
}
}
}
}
}
public class ProCataGoods : INotifyPropertyChanged


+ 11
- 3
WeighBusiness/BL/ProductPlanBL.cs View File

@ -67,8 +67,8 @@ namespace WeighBusiness.BL
if (butcherDetails.Count() > 0) {
foreach (var detail in butcherDetails) {
string insertSql = InsertUtil.GetInsertSql(TableNames.,
new string[] { "ProductPlan_ID", "DetailID", "Goods_Code", "Goods_Name", "Goods_Spec", "Goods_MainUnit", "Goods_ID", "PlanNumber", "IsFinish", "Department_Name", "Remark" },
new string[] { detail.ProductPlan_ID.ToString(), detail.DetailID.ToString(), detail.Goods_Code, detail.Goods_Name, detail.Goods_Spec, detail.Goods_MainUnit, detail.Goods_ID.ToString(), detail.PlanNumber == null ? "null" : detail.PlanNumber.Value.ToString(),detail.IsFinish?"1":"0",detail.Department_Name,detail.Remark });
new string[] { "ProductPlan_ID", "DetailID", "Goods_Code", "Goods_Name", "Goods_Spec", "Goods_MainUnit", "Goods_ID", "PlanNumber", "IsFinish", "Department_Name", "Remark", "DeliveryDate" },
new string[] { detail.ProductPlan_ID.ToString(), detail.DetailID.ToString(), detail.Goods_Code, detail.Goods_Name, detail.Goods_Spec, detail.Goods_MainUnit, detail.Goods_ID.ToString(), detail.PlanNumber == null ? "null" : detail.PlanNumber.Value.ToString(), detail.IsFinish ? "1" : "0", detail.Department_Name, detail.Remark, detail.DeliveryDate == null ? "null" : detail.DeliveryDate.Value.ToString() });
she.ExecuteNonQuery(insertSql, out success, out errorMessage);
if (!success && !string.IsNullOrEmpty(errorMessage)) {
she.Rollback();
@ -245,6 +245,7 @@ namespace WeighBusiness.BL
butcherDetail.PlanNumber = detail.Get<decimal?>("PlanNumber");
butcherDetail.Department_Name = detail.Get<string>("Department_Name");
butcherDetail.Remark = detail.Get<string>("Remark");
butcherDetail.DeliveryDate = detail.Get<DateTime?>("DeliveryDate");
butcherList.Add(butcherDetail);
}
}
@ -316,7 +317,7 @@ namespace WeighBusiness.BL
public static List<ButcherDetailData> GetButcherDetails(DateTime date,DateTime startDate,long planTeamID)
{
var list = new List<ButcherDetailData>();
var sql = "select a.Goods_ID, a.Goods_Name,a.Goods_Spec,a.Goods_MainUnit,a.PlanNumber,a.DetailID,e.FinishNumber,a.Department_Name,a.Remark from {0} a inner join {1} b on a.ProductPlan_ID = b.ProductPlan_ID inner join {2} c on c.Goods_ID = a.Goods_ID inner join {3} d on c.ProductTeam_ID = d.ProductTeam_ID left outer join {4} e on a.DetailID = e.DetailID where a.IsFinish = 0 and d.ProductTeam_ID = {5}".FormatWith(TableNames., TableNames., TableNames., TableNames., TableNames.,planTeamID);
var sql = "select a.Goods_ID, a.Goods_Name,a.Goods_Spec,a.Goods_MainUnit,a.PlanNumber,a.DetailID,e.FinishNumber,a.Department_Name,a.Remark,a.DeliveryDate from {0} a inner join {1} b on a.ProductPlan_ID = b.ProductPlan_ID inner join {2} c on c.Goods_ID = a.Goods_ID inner join {3} d on c.ProductTeam_ID = d.ProductTeam_ID left outer join {4} e on a.DetailID = e.DetailID where a.IsFinish = 0 and d.ProductTeam_ID = {5} order by a.DeliveryDate asc".FormatWith(TableNames., TableNames., TableNames., TableNames., TableNames., planTeamID);
if (!string.IsNullOrEmpty(sql)) {
var table = SqlHelperEx.DoQuery(sql);
foreach (DataRow row in table.Rows) {
@ -330,6 +331,11 @@ namespace WeighBusiness.BL
outDetail.FinishNum = DataTypeUtil.GetDecimalNum(row[6]);
outDetail.Department_Name = (string)row[7];
outDetail.Remark = (string)row[8];
var deliveryDate = DataTypeUtil.GetDateTimeNullData(row[9]);
if (deliveryDate != null) {
outDetail.DeliveryDate = deliveryDate.Value.Date;
outDetail.DeliveryDateStr = deliveryDate.Value.Date.ToShortDateString();
}
list.Add(outDetail);
}
}
@ -347,6 +353,8 @@ namespace WeighBusiness.BL
public decimal? PlanNumber { get; set; }
public string Department_Name { get; set; }
public string Remark { get; set; }
public DateTime? DeliveryDate { get; set; }
public string DeliveryDateStr { get; set; }
private decimal? mFinishNum;
public decimal? FinishNum
{


+ 1
- 0
WeighBusiness/BO/ButcherDetail.cs View File

@ -23,5 +23,6 @@ namespace WeighBusiness.BO
public bool IsFinish { get; set; }
public string Department_Name { get; set; }
public string Remark { get; set; }
public DateTime? DeliveryDate { get; set; }
}
}

+ 1
- 0
WeighBusiness/BO/CreateTables/CreateButcherDetail.cs View File

@ -24,6 +24,7 @@ namespace WeighBusiness.BO.CreateTables
cth.AddField(new FieldInfo() { FieldName = "IsFinish", FieldType = FBType.Boolean, IsNotNull = true });
cth.AddField(new FieldInfo() { FieldName = "Department_Name", FieldType = FBType.Varchar, FieldTypeParams = "(100)" });
cth.AddField(new FieldInfo() { FieldName = "Remark", FieldType = FBType.Varchar, FieldTypeParams = "(100)" });
cth.AddField(new FieldInfo() { FieldName = "DeliveryDate", FieldType = FBType.Timestamp });
base.AddFields(cth);
}
}


+ 1
- 0
WeighBusiness/BO/CreateTables/CreateProductCatalog.cs View File

@ -16,6 +16,7 @@ namespace WeighBusiness.BO.CreateTables
cth.AddField(new FieldInfo() { FieldName = "ProductCatalog_ID", FieldType = FBType.Integer, IsNotNull = true });
cth.AddField(new FieldInfo() { FieldName = "RowVersion", FieldType = FBType.Integer, IsNotNull = true });
cth.AddField(new FieldInfo() { FieldName = "Name", FieldType = FBType.Varchar, FieldTypeParams = "(100)", IsNotNull = true });
cth.AddField(new FieldInfo() { FieldName = "Sequence", FieldType = FBType.Integer, IsNotNull = false });
base.AddFields(cth);
}


+ 1
- 0
WeighBusiness/BO/ProductCatalog.cs View File

@ -17,6 +17,7 @@ namespace WeighBusiness.BO
public long ProductCatalog_ID { get; set; }
public string Name { get; set; }
public int RowVersion { get; set; }
public int? Sequence { get; set; }
}
}

Loading…
Cancel
Save