⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 slxmgz.cpp

📁 售后服务系统优质的售后服务是企业生存和市场竞争的保障
💻 CPP
字号:
//---------------------------------------------------------------------------

#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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -