slxmgz.cpp

来自「售后服务系统优质的售后服务是企业生存和市场竞争的保障」· C++ 代码 · 共 87 行

CPP
87
字号
//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop
#include "ShFwMain.h"
#include "FwJscl.h"
#include "SlXmGz.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TSlXmGzForm *SlXmGzForm;
//---------------------------------------------------------------------------
__fastcall TSlXmGzForm::TSlXmGzForm(TComponent* Owner)
        : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TSlXmGzForm::FormCreate(TObject *Sender)
{
        ADOQueryppxx->Close();
        ADOQueryggxx->Close();
        ADOQueryppxx->Open();
        ADOQueryggxx->Open();
        FwJsForm->ADOQueryfwsl->Edit();
}
//---------------------------------------------------------------------------
void __fastcall TSlXmGzForm::BitBtn1Click(TObject *Sender)
{
        if(Application->MessageBox("是否确认?","确认",MB_OKCANCEL+MB_ICONERROR)!=IDOK)
                Abort();
        if( DBLookupComboBox1->Text.Trim()=="") {
                Application->MessageBox("请确定品牌","错误",MB_OK+MB_ICONERROR);
                Abort();
        }
        if(DBLookupComboBox2->Text.Trim()=="") {
                Application->MessageBox("请确定规格","错误",MB_OK+MB_ICONERROR);
                Abort();
        }
        FwJsForm->ADOQueryfwsl->FieldByName("ppbh")->AsString = DBLookupComboBox1->KeyValue;
        FwJsForm->ADOQueryfwsl->FieldByName("ggbh")->AsString = DBLookupComboBox2->KeyValue;
        FwJsForm->ADOQueryfwsl->FieldByName("ppmc")->AsString = DBLookupComboBox1->Text;
        FwJsForm->ADOQueryfwsl->FieldByName("ggmc")->AsString = DBLookupComboBox2->Text;
        FwJsForm->ADOQueryfwsl->FieldByName("isgysjs")->AsString = ADOQueryggxx->FieldByName("fwfyflag")->AsString;
        if( DBRadioGroup1->Items->Strings[DBRadioGroup1->ItemIndex] == "维修" ) {
                ADOQuerytmp->Close();
                ADOQuerytmp->SQL->Clear();
                ADOQuerytmp->SQL->Add("select * from ggxx where flbh='"+ FwJsForm->ADOQueryfwsl->FieldByName("flbh")->AsString+"' and ppbh='"+DBLookupComboBox1->KeyValue+"' and ggbh='"+DBLookupComboBox2->KeyValue+"'");
                ADOQuerytmp->Open();
                if(ADOQuerytmp->RecordCount != 1 ) {
                        Application->MessageBox("获取规格信息出现错误","错误",MB_OK+MB_ICONERROR);
                        ADOQuerytmp->Close();
                        Abort();
                }
                FwJsForm->ADOQueryfwsl->FieldByName("jsfs")->Value = ADOQuerytmp->FieldByName("wxsflx")->AsString;
                ADOQuerytmp->Close();
        } else
                FwJsForm->ADOQueryfwsl->FieldByName("jsfs")->Value = "计件";

        FwJsForm->ADOQueryfwsl->Post();
        Close();
}
//---------------------------------------------------------------------------
void __fastcall TSlXmGzForm::BitBtn2Click(TObject *Sender)
{
        FwJsForm->ADOQueryfwsl->Cancel();
        Close();
}
//---------------------------------------------------------------------------
void __fastcall TSlXmGzForm::DBLookupComboBox1Click(TObject *Sender)
{
        ADOQueryggxx->Close();
        if( DBLookupComboBox1->Text.Trim()=="")
                Abort();
        ADOQueryggxx->Open();
        if(ADOQueryggxx->RecordCount > 0 )
                DBLookupComboBox2->KeyValue = ADOQueryggxx->FieldByName("ggbh")->AsString;

}
//---------------------------------------------------------------------------
void __fastcall TSlXmGzForm::FormClose(TObject *Sender,
      TCloseAction &Action)
{
        ADOQueryppxx->Close();
        ADOQueryggxx->Close();
}
//---------------------------------------------------------------------------

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?