Compare commits

...

2 Commits

@ -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} ";

@ -9739,6 +9739,11 @@ namespace TradeManageNew
/// 报价单号
/// </summary>
public string DTQuoteNo { get; set; }
/// <summary>
/// 是否为客户修改
/// </summary>
public bool? IsCustomerUpdate { get; set; }
}
public class appShowMsg

@ -15932,13 +15932,13 @@ where a.storeid in (6,9,11) and a.OrderGoodsId=0 and a.KCNum>0 " + tj + " gr
#endregion
#region 返回单个客户今天的报价总金额和总体积 ok
[WebMethod(EnableSession = true)]
public AppResultModel<appShowMsg> GetMsg_ClientToday(int ClientId,string newDate)
public AppResultModel<appShowMsg> GetMsg_ClientToday(int ClientId,string QuoteNo)
{
var resultModel = new AppResultModel<appShowMsg>();
try
{
//var newDate = DateTime.Now.ToShortDateString();
var newappShowMsg = DataNew.GetMsg_ClientToday(ClientId, newDate);
var newappShowMsg = DataNew.GetMsg_ClientToday_Nodate(ClientId, QuoteNo);
if (newappShowMsg == null)
{

Loading…
Cancel
Save