Campos iguais e exibir menssagem..
08/11/2005
0
1) BD_ESTOQUEGS_EST_MINIMO.value ....onde específico uma quantidade mínima para o sistema me avisar.
2) BD_ESTOQUEGS_EST_QNT.Value .....este fica a quantidade atual no estoque
tenho um form onde existe um edit (Edit2) e um botão (Concluir ) onde coloco a quantidade e no botão para concluir...presciso de 2 coisas ...
uma mensagem avisando que a quantidade já está no mínimo, e esta mensagem teria que ter 2 Button ( sim e não ou yes e No ), prescionado o não é cancelado a operação e se prescionado o sim ele subtraisse o valor do BD_ESTOQUEGS_EST_QNT.Value pelo o edit2...
aí galera isto tá parecendo trabalho de escola...más estou quebrando cabeça com outra parte da função e tava prescisando dá uma adiantada nesta...se alguém puder dá uma força aí...valew...
Gigatel
Posts
08/11/2005
Bruno Belchior
if BD_ESTOQUEGS_EST_QNT.AsInteger <= BD_ESTOQUEGS_EST_MINIMO.AsInteger then begin if Application.MessageBox(´Texto´,´Título´, MB_YESNO) = mrYes then begin BD_ESTOQUEGS_EST_QNT.AsInteger := BD_ESTOQUEGS_EST_QNT.AsInteger - StrToInt(Edit2.Text); end else // Foi Pressionado não... end
08/11/2005
Marcio.theis
var continuar: boolean; begin continuar:=False; if (BD_ESTOQUEGS_EST_QNT.Value) <= (BD_ESTOQUEGS_EST_MINIMO.value) then begin if Application.MessageBox(PChar(´A quantidade é inferior ou igual ao mínimo do estoque !´ + #13 + ´Deseja continuar ?´),´Mínimo em Estoque´,MB_YESNO or MB_APPLMODAL or MB_DEFBUTTON2 or MB_ICONQUESTION) = mrYes then continuar:=True; end; if continuar then begin {continuação do seu código para efetuar a baixa no estoque} end;
08/11/2005
Gigatel
if BD_ESTOQUEGS_EST_QNT.AsInteger <= BD_ESTOQUEGS_EST_MINIMO.AsInteger then begin if Application.MessageBox(´Texto´,´Título´, MB_YESNO) = mrYes then begin BD_ESTOQUEGS_EST_QNT.AsInteger := BD_ESTOQUEGS_EST_QNT.AsInteger - StrToInt(Edit2.Text); end else // Foi Pressionado não... end
Valew..más só tem um probleminha...na sua função o processo de subtração está depois do ´SIM´ na verdade seria assim ....se na hora que fosse prescionado o botão ele faria a seguinte análize...Se o valor do edit 2 fosse menor que no espessificado no estoque ele num daria mensagem nenhuma e executaria o processo de subtração normalmente a mensagem só apareceria se tivesse algo de errado com o estoque igual ou menor...aí sim apareceria uma mensagem do tipo ´Estoque no mínimo! deseja continuar ?´ aí prescionando o sim faria a subtração tambem...e prescionado o não cancelaria o processo..vlw...
08/11/2005
Gigatel
08/11/2005
Wilson Brito
if (BD_ESTOQUEGS_EST_QNT.AsInteger - StrToInt(Edit2.Text)) <= BD_ESTOQUEGS_EST_MINIMO.AsInteger then begin if Application.MessageBox(´Texto´,´Título´, MB_YESNO) = mrYes then begin BD_ESTOQUEGS_EST_QNT.AsInteger := BD_ESTOQUEGS_EST_QNT.AsInteger - StrToInt(Edit2.Text); end else // Foi Pressionado não... end
08/11/2005
Gigatel
Fiz Assim
if (BD_ESTOQUEGS_EST_QNT.AsInteger - StrToInt(Edit2.Text)) <= BD_ESTOQUEGS_EST_MINIMO.AsInteger then begin if Application.MessageBox(´A quantidade é inferior ou igual ao mínimo do estoque !´ + #13 + ´Deseja continuar ?´,´Estoque´, MB_YESNO) = mrYes then begin BD_ESTOQUE.Edit; BD_ESTOQUEGS_EST_QNT.AsInteger := BD_ESTOQUEGS_EST_QNT.AsInteger - StrToInt(Edit2.Text); end else BD_ESTOQUE.Edit; BD_ESTOQUEGS_EST_QNT.AsInteger := BD_ESTOQUEGS_EST_QNT.AsInteger - StrToInt(Edit2.Text); end end;
Os seguintres bug´s foram detectados..
A) quando o valor é maior o mínimo e não subtrai no estoque..
B) quando presciona o ´não´ continua a diminuir...
Tá estranho/...
09/11/2005
Marcio.theis
09/11/2005
Martins
if (BD_ESTOQUEGS_EST_QNT.AsInteger - StrToInt(Edit2.Text)) <= BD_ESTOQUEGS_EST_MINIMO.AsInteger then begin if Application.MessageBox(´A quantidade é inferior ou igual ao mínimo do estoque !´ + #13 + ´Deseja continuar ?´,´Estoque´, MB_YESNO) = mrYes then begin BD_ESTOQUE.Edit; BD_ESTOQUEGS_EST_QNT.AsInteger := BD_ESTOQUEGS_EST_QNT.AsInteger - StrToInt(Edit2.Text); end else Abort; end;
09/11/2005
Gigatel
var a,b,c : real; e:integer; begin if Edit2.text = ´0´ then begin showmessage(´A quantidade tem que ser maior que zero.´) end else begin a := strtofloat(Edit2.text); b := strtofloat(BD_ESTOQUEGS_EST_VALOR_VENDA.Value); c := a*b; E:=_FORM_OS_NAV.BD_OFC_ELEGS_OOE_CODIGO.Value; _FORM_OS_OR.BD_ORCA_ITENS.Insert; _FORM_OS_OR.BD_ORCA_ITENSGS_OOEI_QNT.Value := Edit2.text; _FORM_OS_OR.BD_ORCA_ITENSGS_OOEI_DESCRICAO.Value := BD_ESTOQUEGS_EST_DESCRICAO.Value; _FORM_OS_OR.BD_ORCA_ITENSGS_OOEI_UNIT.Value := Edit4.text; _FORM_OS_OR.BD_ORCA_ITENSGS_OOEI_VALOR_UNIT.Value := BD_ESTOQUEGS_EST_VALOR_VENDA.Value; _FORM_OS_OR.BD_ORCA_ITENSGS_OOEI_VALOR_TOTAL.Value := floattostrf(c,ffFixed,10,2); _FORM_OS_OR.BD_ORCA_ITENSGS_OOEI_CODACES.Value := _FORM_OS_NAV.BD_OFC_ELEGS_OOE_CODIGO.value; _FORM_OS_OR.BD_ORCA_ITENS.Post; _FORM_OS_OR.BD_ORCA_ITENS.Close; _FORM_OS_OR.BD_ORCA_ITENS.SQL.Clear; _FORM_OS_OR.BD_ORCA_ITENS.SQL.Add(´select * from ORCAMENTO_OFIC_ELET_ITENS where GS_OOEI_CODACES=´+inttostr(E)); _FORM_OS_OR.BD_ORCA_ITENS.Open; Close; end;
Más está meio estranho...
10/11/2005
Gigatel
private procedure VERESTBAIXO;
Fiz o código referente a procedure..
procedure T_FORM_OS_ESTOQUE.VERESTBAIXO; Begin if Application.MessageBox(´A quantidade é inferior ou igual ao mínimo do estoque !´ + #13 + ´Deseja continuar ?´,´Estoque´, MB_YESNO) = mrYes then begin BD_ESTOQUE.Edit; BD_ESTOQUEGS_EST_QNT.AsInteger := BD_ESTOQUEGS_EST_QNT.AsInteger - StrToInt(Edit2.Text); end else Abort; end;
aki esta onde vai ler a função...fica num boton..
if (BD_ESTOQUEGS_EST_QNT.AsInteger - StrToInt(Edit2.Text)) <= BD_ESTOQUEGS_EST_MINIMO.AsInteger then VERESTBAIXO else BD_ESTOQUE.Edit; BD_ESTOQUEGS_EST_QNT.AsInteger := BD_ESTOQUEGS_EST_QNT.AsInteger - StrToInt(Edit2.Text); end;
Parece estra certo...más num sei o que é...
10/11/2005
Gigatel
Clique aqui para fazer login e interagir na Comunidade :)