LiFan
2025-04-15 9b43e4edb9c5ebc065d6af4810ae66690fdc50df
jrj/project/business/BasicCode/ExpressMaint.cpp
@@ -3,13 +3,14 @@
#include <xcontrol/xdwgrid.hpp>
#include <wobject/xdouble.hpp>
#include <xcontrol/xlayersheet.hpp>
#include <xcontrol/xcell.hpp>
#include "vbusiness/vframe/listwin.vframe.vbusiness.hpp"
#include "vbusiness/vframe/maint.vframe.vbusiness.hpp"
#include "viewobject/view.base.hpp"
#include "xcontrol/xcell.hpp"
using xml = KXMLDOMDocument;
class __declspec(dllexport) ExpressMaint : public xframe
class __declspec(dllexport) ExpressMaint : public maint
{
public:
   KXMLDOMDocument m_configDoc;
@@ -20,25 +21,18 @@
   xcell dw_cell;
   xstring m_EntityID = L"";
public:
   ExpressMaint(void* implPtr, HWND hWnd) :xframe(implPtr, hWnd) {}
   ExpressMaint(void* implPtr, HWND hWnd) :maint(implPtr, hWnd) {}
public:
   static ExpressMaint* CreateInstance(void* implPtr, void* hWnd)
   {
      ExpressMaint* pWin = new ExpressMaint(implPtr, (HWND)hWnd);
      return pWin;
   }
   int alert(xstring str)
   {
      //win::MessageBox(GetHWND(),str,L"提示22:",0);
      TApp::alert(this, str);
      return 0;
   }
   int setCellReadOnly()
   {
      dw_base = new xdwtable;
      dw_base.setNativePointer(GetControl(L"dw_base"));
      dw_cell = new xcell;
      dw_cell.setNativePointer(dw_base.QueryItem(L"ixcell"));
      dw_base = GetControl(L"dw_base");
      dw_cell = dw_base.QueryItem(L"ixcell");
      xstring strnew = L"<cellprop celltype='' cellformatex='' cellformat='' cellprotectex='' cellprotect='保护' cellvisibleex='' cellvisible='' cellvalid='' cellinitial=''/>";
      dw_cell.SetCellProps(2, 2, strnew);
      return 0;
@@ -51,10 +45,9 @@
   int OnClear() {
      if (m_EntityID == L"") {
         //trace(1);
         m_userid = publiccode::GetUser().id;
         m_userid = publiccode::GetUser().personid;
         m_username = publiccode::GetUser().name;
         dw_base = new xdwtable;
         dw_base.setNativePointer(GetControl(L"dw_base"));
         dw_base = GetControl(L"dw_base");
         dw_base.SetItemString(1, L"PartyID", GetGuid());
         dw_base.SetItemString(1, L"PStatus", L"1");
         dw_base.SetItemDisplayString(1, L"PStatus", L"有效");
@@ -68,7 +61,7 @@
         dw_base.SetItemDisplayString(1, L"EnterName", m_username);
         dw_base.SetItemString(1, L"CreateDate", publiccode::GetCurrentDate());
         dw_base.SetItemString(1, L"PBAStatus", L"Y");
         return 0;
      }
      return 0;
@@ -81,10 +74,8 @@
   }
   int OnAddrow()
   {
      dw_base = new xdwtable;
      dw_base.setNativePointer(GetControl(L"dw_base"));
      xdwtable dw = new xdwtable;
      dw.setNativePointer(dw_base.GetCurTable());
      dw_base = GetControl(L"dw_base");
      xdwtable dw =dw_base.GetCurTable();
      xstring dw_n = dw.GetDwName();
      if (dw_n == L"item")
      {
@@ -97,10 +88,8 @@
   }
   int OnInsertRow()
   {
      dw_base = new xdwtable;
      dw_base.setNativePointer(GetControl(L"dw_base"));
      xdwtable dw = new xdwtable;
      dw.setNativePointer(dw_base.GetCurTable());
      dw_base =GetControl(L"dw_base");
      xdwtable dw = dw_base.GetCurTable();
      xstring dw_n = dw.GetDwName();
      if (dw_n == L"item")
      {
@@ -115,10 +104,8 @@
   int OnDeleteRow()
   {
      dw_base = new xdwtable;
      dw_base.setNativePointer(GetControl(L"dw_base"));
      xdwtable dw = new xdwtable;
      dw.setNativePointer(dw_base.GetCurTable());
      dw_base = GetControl(L"dw_base");
      xdwtable dw = dw_base.GetCurTable();
      xstring dw_n = dw.GetDwName();
      if (dw_n == L"item")
      {
@@ -168,15 +155,13 @@
   int OnPreSave()
   {
      dw_base.AcceptText();
      dw_base = new xdwtable;
      dw_base.setNativePointer(GetControl(L"dw_base"));
      dw_base = GetControl(L"dw_base");
      xstring ExpressNo = dw_base.GetItemString(1, L"ExpressNo");
      if (ExpressNo == L"")
      {
         dw_base.SetItemString(1, L"ExpressNo", getGoodsNo());
      }
      xdwtable dwcon = new xdwtable;
      dwcon.setNativePointer(dw_base.FindDwTable(L"item", 0));
      xdwtable dwcon = dw_base.FindDwTable(L"item", 0);
      int i;
      for (i = 1; i <= dwcon.GetRowCount(); i++)
      {
@@ -205,8 +190,7 @@
         }
      }
      xdwtable dwcon1 = new xdwtable;
      dwcon1.setNativePointer(dw_base.FindDwTable(L"PartyBankAccount", 0));
      xdwtable dwcon1 = dw_base.FindDwTable(L"PartyBankAccount", 0);
      int j;
      xstring sPBABankName = L"";
      xstring sPBABankAccountNo = L"";
@@ -234,8 +218,7 @@
   }
   int OnSave()
   {
      dw_base = new xdwtable;
      dw_base.setNativePointer(GetControl(L"dw_base"));
      dw_base = GetControl(L"dw_base");
      xstring SName = dw_base.GetItemString(1, L"Name");
      if (SName == L"") {
         alert(L"请输入快递公司名称!");
@@ -298,8 +281,7 @@
   }
   int OnCellChanged(TEvent* evt, LPARAM p)
   {
      dw_base = new xdwtable;
      dw_base.setNativePointer(GetControl(L"dw_base"));
      dw_base = GetControl(L"dw_base");
      DWNMHDR& hdr = *(DWNMHDR*)evt->notify.pnmh;
      xstring colname = hdr.colname;
      //trace(colname);
@@ -334,15 +316,20 @@
   int onload()
   {
      dw_base = new xdwtable;
      dw_base.setNativePointer(GetControl(L"dw_base"));
      SetArg();
      dw_base = GetControl(L"dw_base");
      OnAttachEvent();
      //if(!m_configDoc) return -1;
      maint::onload();
      OnClear();
      return 1;
   }
   int onloaded()
   {
      return maint::onloaded();
   }
};