@ -27859,11 +27859,11 @@ end ";
string tsql = @ "
if @Id > 0
begin
UPDATE [ dbo ] . [ DT_Quote_New ] SET [ Foto ] = @Foto , [ Nombre ] = @Nombre , [ Caracteristicas ] = @Caracteristicas , [ Modelo ] = @Modelo , [ Recio ] = @Recio , [ QtyOrCtn ] = @QtyOrCtn , [ Cbm ] = @Cbm , [ AllCbm ] = @AllCbm , [ Gw ] = @Gw , [ Nw ] = @Nw , [ CompanyId ] = @CompanyId , [ UserId ] = @UserId , [ CreateDate ] = @CreateDate , [ IsAuthority ] = @IsAuthority , [ FactoryName ] = @FactoryName , [ FactoryImg ] = @FactoryImg , [ Cantidad ] = @Cantidad , [ Valor ] = @Valor , [ ClientId ] = @ClientId , [ CityName ] = @CityName , [ DTQuoteNo ] = @DTQuoteNo WHERE [ Id ] = @Id ;
UPDATE [ dbo ] . [ DT_Quote_New ] SET [ Foto ] = @Foto , [ Nombre ] = @Nombre , [ Caracteristicas ] = @Caracteristicas , [ Modelo ] = @Modelo , [ Recio ] = @Recio , [ QtyOrCtn ] = @QtyOrCtn , [ Cbm ] = @Cbm , [ AllCbm ] = @AllCbm , [ Gw ] = @Gw , [ Nw ] = @Nw , [ CompanyId ] = @CompanyId , [ UserId ] = @UserId , [ CreateDate ] = @CreateDate , [ IsAuthority ] = @IsAuthority , [ FactoryName ] = @FactoryName , [ FactoryImg ] = @FactoryImg , [ Cantidad ] = @Cantidad , [ Valor ] = @Valor , [ ClientId ] = @ClientId , [ CityName ] = @CityName , [ DTQuoteNo ] = @DTQuoteNo , [ IsCustomerUpdate ] = @IsCustomerUpdate WHERE [ Id ] = @Id ;
end
else
begin
INSERT INTO [ dbo ] . [ DT_Quote_New ] ( [ Foto ] , [ Nombre ] , [ Caracteristicas ] , [ Modelo ] , [ Recio ] , [ QtyOrCtn ] , [ Cbm ] , [ AllCbm ] , [ Gw ] , [ Nw ] , [ CompanyId ] , [ UserId ] , [ CreateDate ] , [ IsAuthority ] , [ FactoryName ] , [ FactoryImg ] , [ Cantidad ] , [ Valor ] , [ ClientId ] , [ CityName ] , [ DTQuoteNo ] ) VALUES ( @Foto , @Nombre , @Caracteristicas , @Modelo , @Recio , @QtyOrCtn , @Cbm , @AllCbm , @Gw , @Nw , @CompanyId , @UserId , @CreateDate , @IsAuthority , @FactoryName , @FactoryImg , @Cantidad , @Valor , @ClientId , @CityName , @DTQuoteNo ) ;
INSERT INTO [ dbo ] . [ DT_Quote_New ] ( [ Foto ] , [ Nombre ] , [ Caracteristicas ] , [ Modelo ] , [ Recio ] , [ QtyOrCtn ] , [ Cbm ] , [ AllCbm ] , [ Gw ] , [ Nw ] , [ CompanyId ] , [ UserId ] , [ CreateDate ] , [ IsAuthority ] , [ FactoryName ] , [ FactoryImg ] , [ Cantidad ] , [ Valor ] , [ ClientId ] , [ CityName ] , [ DTQuoteNo ] ,[ IsCustomerUpdate ] ) VALUES ( @Foto , @Nombre , @Caracteristicas , @Modelo , @Recio , @QtyOrCtn , @Cbm , @AllCbm , @Gw , @Nw , @CompanyId , @UserId , @CreateDate , @IsAuthority , @FactoryName , @FactoryImg , @Cantidad , @Valor , @ClientId , @CityName , @DTQuoteNo , @IsCustomerUpdate ) ;
set @Id = SCOPE_IDENTITY ( )
end
select @Id ";
@ -27889,8 +27889,9 @@ select @Id";
db . AddInParameter ( cmd , "@CityName" , DbType . String , Model . CityName ) ;
db . AddInParameter ( cmd , "@DTQuoteNo" , DbType . String , Model . DTQuoteNo ) ;
db . AddInParameter ( cmd , "@Cantidad" , DbType . Int32 , Model . Cantidad ) ;
db . AddInParameter ( cmd , "@Valor" , DbType . Decimal , Model . Valor ) ;
db . AddInParameter ( cmd , "@Valor" , DbType . Decimal , Model . Valor ) ;
db . AddInParameter ( cmd , "@ClientId" , DbType . Int32 , Model . ClientId ) ;
db . AddInParameter ( cmd , "@IsCustomerUpdate" , DbType . Boolean , Model . IsCustomerUpdate ) ;
resultId = Convert . ToInt32 ( db . ExecuteScalar ( cmd ) ) ;
}
@ -27918,6 +27919,25 @@ select @Id";
return model ;
}
//不传时间
public static appShowMsg GetMsg_ClientToday_Nodate ( int ClientId , string QuoteNo )
{
string sql = $"SELECT SUM(Valor) as AllValor,SUM(AllCbm) as AllCbm FROM [dbo].[DT_Quote_New] where ClientId = {ClientId} and DTQuoteNo = '{QuoteNo}';SELECT Id as ClientId,ClientName from JC_Client where Id = {ClientId};" ;
Database db = DatabaseFactory . CreateDatabase ( ) ;
DbCommand cmd = db . GetSqlStringCommand ( sql ) ;
DataSet ds = db . ExecuteDataSet ( cmd ) ;
var model1 = ds . Tables [ 0 ] . Rows [ 0 ] . ToModel < appShowMsg > ( ) ;
var model2 = ds . Tables [ 1 ] . Rows [ 0 ] . ToModel < appShowMsg > ( ) ;
appShowMsg model = new appShowMsg ( ) ;
model . ClientName = model2 . ClientName ;
model . ClientId = model2 . ClientId ;
model . AllValor = model1 . AllValor ;
model . AllCbm = model1 . AllCbm ;
return model ;
}
public static DT_Quote_NewTable GetModel_DT_QuoteNewTable ( int Id )
{
string tsql = $"SELECT * FROM [dbo].[DT_Quote_New] where Id = {Id} " ;