#include <wobject/xstring.hpp>
|
#include <xcontrol/xtreeview.hpp>
|
#include <xcontrol/xdwgrid.hpp>
|
#include <xcontrol/xlayersheet.hpp>
|
|
#include "vbusiness/vframe/maint.vframe.vbusiness.hpp"
|
#include "viewobject/view.base.hpp"
|
|
using xml = KXMLDOMDocument;
|
class __declspec(dllexport) maintCustomerv3 : public maint
|
{
|
public:
|
xlayersheet xsheet;
|
xlayersheet m_layer;
|
xdwtable dw_detail;
|
xdwtable dw_power;
|
xdwtable dw_require;
|
xdwtable dw_jzfx;
|
xdwtable dw_visit;
|
|
xdwtable dw_Meetings;
|
xdwtable dw_MeetingsEx;
|
|
xdwgrid dw_account;
|
|
|
int iLayer;//Ò³ÃæIndex
|
int APP=1;
|
HWND CustomerGoodsHWND;
|
|
xstring userno;
|
xstring ApplyStatus;
|
/*struct PUser
|
{
|
xstring id;
|
xstring no;
|
xstring name;
|
};*/
|
|
public:
|
maintCustomerv3(void* implPtr, HWND hWnd) :maint(implPtr, hWnd) {}
|
public:
|
static maintCustomerv3* CreateInstance(void* implPtr, void* hWnd)
|
{
|
maintCustomerv3* pWin = new maintCustomerv3(implPtr, (HWND)hWnd);
|
return pWin;
|
}
|
|
xstring GetGuid()
|
{
|
return publiccode::GetGuid();
|
}
|
|
int ViewUpdate(int pr,xstring updateItem,xaserverarg arg)
|
{
|
if(updateItem==L"update")
|
{
|
|
dw_detail.ResetUpdateStatus();
|
}
|
return 1;
|
}
|
|
xstring GetEntityData(LPARAM pr)
|
{
|
xml x;
|
|
dw_detail.DwUpdateAllTo(x);
|
|
KXMLDOMElement e=x.documentElement();
|
|
xml x1 ;
|
|
dw_visit.DwUpdateAllTo(x1);
|
KXMLDOMElement e1=x1.documentElement();
|
KXMLDOMNodeList oNodeList = e1.selectNodes(L"//Customer/*");
|
int i=0;
|
for (i=0; i<oNodeList.length(); i++)
|
{
|
KXMLDOMElement Item = oNodeList.item(i);
|
e.appendChild(Item);
|
}
|
|
xml x2= new xml;
|
|
dw_Meetings.DwUpdateAllTo(x2);
|
KXMLDOMElement e2=x2.documentElement();
|
KXMLDOMNodeList oNodeList2 = e2.selectNodes(L"//Customer/*");
|
int i2=0;
|
for (i2=0; i2<oNodeList2.length(); i2++)
|
{
|
KXMLDOMElement Item2 = oNodeList2.item(i2);
|
e.appendChild(Item2);
|
}
|
|
xml x3= new xml;
|
|
dw_MeetingsEx.DwUpdateAllTo(x3);
|
KXMLDOMElement e3=x3.documentElement();
|
KXMLDOMNodeList oNodeList3 = e3.selectNodes(L"//Customer/*");
|
int i3=0;
|
for (i3=0; i3<oNodeList3.length(); i3++)
|
{
|
KXMLDOMElement Item3 = oNodeList3.item(i3);
|
e.appendChild(Item3);
|
}
|
|
trace(e.xml());
|
return e.xml();
|
}
|
|
int OnInit()
|
{
|
userno = xaserver::GetUserNo();
|
//PUser User = publiccode::GetUserInfo();
|
dw_detail.SetItemString(1,L"SalesPersonID",xaserver::GetUserId());
|
dw_detail.SetItemDisplayString(1,L"SalesPersonID",publiccode::GetUser().name);
|
dw_detail.SetItemString(1,L"CreatorID",xaserver::GetUserId());
|
dw_detail.SetItemDisplayString(1,L"CreatorID",publiccode::GetUser().name);
|
dw_detail.SetItemString(1,L"CreateDate",publiccode::GetCurrentDate());
|
dw_detail.SetItemString(1,L"ModifyDate",publiccode::GetCurrentDate());
|
dw_detail.SetItemString(1,L"Status",L"1");
|
dw_detail.SetItemString(1,L"PAStatus",L"1"); //µØÖ·×´Ì¬
|
dw_detail.SetItemString(1,L"PrimaryFlag",L"Y"); //Ö÷µØÖ·
|
dw_detail.SetItemString(1,L"Type",L"1"); //¿Í»§Îª 1
|
dw_detail.SetItemString(1,L"IdentifyAddressFlag",L"Y"); //û±ØÒª£¬ÔÝʱÁô×Å
|
|
xstring sdate = publiccode::GetCurrentDate();
|
dw_detail.SetItemString(1,L"ApplyDate",sdate);
|
dw_detail.SetItemString(1,L"ApplyStatus",L"н¨");
|
dw_detail.SetItemString(1,L"Level",L"");
|
|
//dw_detail.SetItemDisplayString(1,L"¿Í»§×ÊÁÏ",L"¿Í»§×ÊÁϸ½¼þ");
|
dw_detail.SetItemString(1,L"¿Í»§×ÊÁÏ",L"¿Í»§×ÊÁϸ½¼þ");
|
xstring guid = publiccode::GetGuid();
|
dw_detail.SetGuid(1,guid);
|
dw_detail.Redraw();
|
return 1;
|
}
|
|
xstring GetPartyID(xstring sName,xstring sType)
|
{
|
xml x1=new xml;
|
|
xaserverarg arg;
|
arg.setNativePointer(arg.CreateInstance());
|
arg.AddArg(L"sname", sName);
|
arg.AddArg(L"type",sType);
|
if(xurl::get(L"/sale/data/"+GetEntityName(1)+L"/pref/searchname",arg.GetString(),x1)!=1)
|
{
|
xstring error = x1.text();
|
//alert(L"/sale/data/"+GetEntityName(1)+L"/pref/searchname");
|
return L"";
|
}
|
xstring sID=L"";
|
if(x1.selectSingleNode(L"root/PartyID"))
|
sID = x1.selectSingleNode(L"root/PartyID").text();
|
return sID+xstring(L"");
|
}
|
|
int OnItemChanged(TEvent* evt, int p)
|
{
|
DWNMHDR* hdr = (DWNMHDR*)evt->notify.pnmh;
|
xstring colname = hdr->colname;
|
xstring coldata = hdr->data;
|
int row = hdr->row;
|
|
|
//¸ù¾Ý¹ú±ðÏÔʾµØÇø´úÂë
|
if (colname == L"CountryCode")
|
{
|
xaserverarg arg ;
|
arg.setNativePointer(arg.CreateInstance());
|
arg.AddArg(L"countryCode",coldata);
|
xml x;
|
|
if (getUrl(L"/sale/data/"+GetEntityName(1)+L"/pref/areacode",arg.GetString(),x)==1)
|
{
|
xstring sareacode = L"";
|
xstring sareaname = L"";
|
if(x.selectSingleNode(L"//AreaCode"))
|
{
|
sareacode = x.selectSingleNode(L"//AreaCode").text();
|
sareaname = x.selectSingleNode(L"//AreaName").text();
|
}
|
dw_detail.SetItemString(1,L"AreaCode",sareacode);
|
dw_detail.SetItemDisplayString(1,L"AreaCode",sareaname);
|
dw_detail.Redraw();
|
}
|
}
|
|
//Ö»ÄÜѡһ¸öÖ÷ÁªÏµÈË
|
if (colname == L"PrimaryFlag" && coldata == L"Y")
|
{
|
xdwtable dw_pc;
|
dw_pc = dw_detail.FindDwTable(L"item1");
|
if (dw_pc)
|
{
|
int i;
|
for (i=1;i <= dw_pc.GetRowCount();i++)
|
{
|
if (i != row)
|
{
|
dw_pc.SetItemString(i,L"PrimaryFlag",L"N");
|
dw_pc.SetItemDisplayString(i,L"PrimaryFlag",L"");
|
|
}
|
}
|
}
|
}
|
|
//¿Í»§ÃûÏàͬ¡£
|
if (colname == L"Name")
|
{
|
//alert(coldata);
|
/* xstring sguid = GetPartyID(coldata,colname);
|
if (sguid != L"")
|
{
|
alert(L"¿Í»§Ãû³ÆÓëϵͳÒÑÓпͻ§Öظ´£¬ÇëÓÚ¹ÜÀíÔ±ÁªÏµ½â¾ö£¡");
|
}*/
|
//alert(L"ccc");
|
}
|
|
//¿Í»§¼ò³Æ
|
if (colname == L"ShortName")
|
{
|
xstring sguid1 = GetPartyID(coldata,colname);
|
//trace(sguid1);
|
if (sguid1 != L"")
|
{
|
alert(L"¿Í»§¼ò³ÆÖظ´£¬Çë¸ÄÓÃÆäËû¼ò³Æ£¡");
|
}
|
}
|
//¸ù¾Ý¿Í»§À´Ô´Ìîд¿Í»§±¸×¢
|
/*if (colname == L"Source")
|
{
|
if(coldata==L"025")
|
alert(L"À´Ô´±¸×¢¶ÔÓ¦Ìîд¿Í»§ÈçºÎÖªµÀÎÒÃǹ«Ë¾");
|
if(coldata==L"017" || coldata==L"018")
|
alert(L"À´Ô´±¸×¢¶ÔÓ¦ÌîдÄĸö¿Í»§½éÉܵÄ");
|
if(coldata==L"019")
|
alert(L"À´Ô´±¸×¢¶ÔÓ¦ÌîдÄĸöº£Íâ°ìÊ´¦»òÕßÁªÂçµã½éÉÜ");
|
if(coldata==L"020")
|
alert(L"À´Ô´±¸×¢¶ÔÓ¦ÌîдÄĸöÃŵê½éÉÜ");
|
if(coldata==L"021")
|
alert(L"À´Ô´±¸×¢¶ÔÓ¦Ìîд˽éÉÜ");
|
if(coldata==L"026")
|
alert(L"À´Ô´±¸×¢¶ÔÓ¦Ìîд˿¼²ìÊг¡ÕùÈ¡µ½µÄ¿Í»§");
|
if(coldata==L"028")
|
alert(L"À´Ô´±¸×¢¶ÔÓ¦Ìîд¹úÍâÕ¹»áÃû³Æ");
|
if(coldata==L"034")
|
alert(L"À´Ô´±¸×¢¶ÔÓ¦Ìîд˵ĴúÀíÒµÎñ");
|
if(coldata==L"001" || coldata==L"002" )
|
alert(L"À´Ô´±¸×¢¶ÔÓ¦Ìîд¿Í»§ÈçºÎÖªµÀÎÒÃǹ«Ë¾");
|
if(coldata==L"0052" || coldata==L"0053" || coldata==L"0054" || coldata==L"0055" || coldata==L"0051")
|
dw_detail.SetItemString(1,L"SourceRemark",L"°¢Àï°Í°Í");
|
if(coldata==L"0161" || coldata==L"0162" )
|
dw_detail.SetItemString(1,L"SourceRemark",L"»·Çò×ÊÔ´");
|
if(coldata==L"0061" || coldata==L"0062" )
|
dw_detail.SetItemString(1,L"SourceRemark",L"ÖйúÖÆÔìÍø");
|
if(coldata==L"022" || coldata==L"023" || coldata==L"037" || coldata==L"038" || coldata==L"039" || coldata==L"040" || coldata==L"007" || coldata==L"024" )
|
dw_detail.SetItemString(1,L"SourceRemark",L"MHÍøÕ¾");
|
}*/
|
//ÁªÏµÈËTitleÑ¡Ôñ¡£
|
if (colname == L"Title")
|
{
|
xdwtable dw_PartyContact;
|
dw_PartyContact = dw_detail.FindDwTable(L"PartyContact");
|
if(coldata==L"MR")
|
dw_PartyContact.SetItemString(dw_PartyContact.GetRow(),L"Gender",L"ÄÐ");
|
else if(coldata==L"MS" || coldata==L"MADAM" || coldata==L"MRS" )
|
dw_PartyContact.SetItemString(dw_PartyContact.GetRow(),L"Gender",L"Å®");
|
else
|
dw_PartyContact.SetItemString(dw_PartyContact.GetRow(),L"Gender",L"");
|
|
}
|
if (colname==L"SalesPersonID" && coldata != L"")//ÉèÖÃÈËÔ±¹éÊô
|
{
|
trace(L"asdasd");
|
xstring ls_deptname,ls_teamname,ls_groupname,ls_unitname;
|
ls_deptname = publiccode::GetUser(coldata).deptname;
|
ls_teamname = publiccode::GetUser(coldata).teamname;
|
ls_groupname = publiccode::GetUser(coldata).groupname;
|
ls_unitname = publiccode::GetUser(coldata).unitname;
|
trace(ls_unitname);
|
dw_detail.SetItemString(1,L"OrgName",ls_deptname+xstring(ls_teamname)+ xstring(ls_groupname)+ xstring(ls_unitname) );
|
}
|
//¸ù¾ÝÉúÈÕ×Ô¶¯ÉèÖÃÄêÁä¡£
|
/*if (colname == L"Birthday")
|
{
|
xdwtable dw_PartyContact1;
|
dw_PartyContact1 =dw_detail.FindDwTable(L"PC_OtherInfo");
|
xml xx = new xml;
|
xx.setNativePointer(xml ::CreateInstance());
|
xaserverarg argnew = new xaserverarg;
|
argnew.setNativePointer(argnew.CreateInstance());
|
xstring agesql;
|
agesql = L"select Dbo.GetAge( '{$Birthday}',getdate()) for xml PATH('root'),ELEMENTS XSINIL";
|
argnew.AddArg(L"sql",agesql);
|
argnew.AddArg(L"Birthday",coldata);
|
if (getSql(argnew.GetString(),xx) == 1)
|
{
|
KXMLDOMElement AgeEle=xx.documentElement;
|
dw_PartyContact1.SetItemString(1,L"Age",AgeEle.text());
|
}
|
}*/
|
return 1;
|
}
|
|
int OnAddRow()
|
{
|
xdwtable dw_obj;
|
xdwtable dw_contact;
|
dw_contact = dw_detail.GetCurTable();
|
xstring sDwname = dw_contact.GetDwName();
|
if(sDwname.find(L"item") >=0 ) sDwname = dw_contact.GetParent().GetDwName();
|
if(sDwname==L"PartyContact")
|
{
|
int iRowPc = dw_contact.InsertRow(0);
|
}
|
else if(sDwname==L"PartyAddress")
|
{
|
int iRowPad = dw_contact.InsertRow(0);
|
}
|
else if(sDwname==L"PartyBankAccount")
|
{
|
int iRowPba = dw_contact.InsertRow(0);
|
}
|
int h=m_layer.GetSheetIndex();
|
int nindex = h+1;
|
//alert(nindex.toString());
|
if(nindex==5)
|
{
|
dw_obj=GetControl(L"dw_jzfx");
|
xdwtable dw = dw_obj.GetCurTable();
|
int row = dw.InsertRow(1, 0);
|
dw.SetItemString(row,L"SeqNo",xstring(row));
|
}
|
if(nindex==4)
|
{
|
dw_obj=GetControl(L"dw_visit");
|
xdwtable dw1 = dw_obj.GetCurTable();
|
int row1 = dw1.InsertRow(0);
|
}
|
if(nindex==3)
|
{
|
dw_obj=GetControl(L"dw_MeetingsEx");
|
xdwtable dw3 = dw_obj.GetCurTable();
|
int row3 = dw3.InsertRow(0);
|
}
|
|
if(nindex==2)
|
{
|
dw_obj=GetControl(L"dw_Meetings");
|
xdwtable dw2 = dw_obj.GetCurTable();
|
int row2 = dw2.InsertRow(0);
|
}
|
return 0;
|
}
|
|
int OnInsertRow()
|
{
|
xdwtable dw_obj;
|
xdwtable dw_contact;
|
dw_contact = dw_detail.GetCurTable();
|
xstring sDwname = dw_contact.GetDwName();
|
if(sDwname.find(L"item") >=0 ) sDwname = dw_contact.GetParent().GetDwName();
|
if(sDwname==L"PartyContact")
|
{
|
int iRowPc = dw_contact.InsertRow(dw_contact.GetRow());
|
}
|
else if(sDwname==L"PartyAddress")
|
{
|
int iRowPad = dw_contact.InsertRow(dw_contact.GetRow());
|
}
|
else if(sDwname==L"PartyBankAccount")
|
{
|
int iRowPba = dw_contact.InsertRow(dw_contact.GetRow());
|
}
|
int h=m_layer.GetSheetIndex();
|
int nindex = h+1;
|
if(nindex==5)
|
{
|
dw_obj=GetControl(L"dw_jzfx");
|
xdwtable dw = dw_obj.FindDwTable(L"CustomerJzfx");
|
int row = dw.InsertRow(1,dw.GetRow());
|
//dw.SetGuid(row,publiccode::GetGuid());
|
}
|
if(nindex==4)
|
{
|
dw_obj=GetControl(L"dw_visit");
|
xdwtable dw1 =dw_obj.GetCurTable();
|
int row1 = dw1.InsertRow(dw1.GetRow());
|
}
|
if(nindex==3)
|
{
|
dw_obj=GetControl(L"dw_MeetingsEx");
|
xdwtable dw3 =dw_obj.GetCurTable();
|
int row3 = dw3.InsertRow(dw3.GetRow());
|
}
|
if(nindex==2)
|
{
|
dw_obj=GetControl(L"dw_Meetings");
|
xdwtable dw2 =dw_obj.GetCurTable();
|
int row2 = dw2.InsertRow(dw2.GetRow());
|
}
|
return 0;
|
}
|
|
int OnDeleteRow()
|
{
|
xdwtable dw_obj;
|
xdwtable dw_contact;
|
dw_contact = dw_detail.GetCurTable();
|
xstring sDwname = dw_contact.GetDwName();
|
if(sDwname.find(L"item") >=0 ) sDwname = dw_contact.GetParent().GetDwName();
|
if(sDwname==L"PartyContact" ||sDwname==L"PartyAddress" ||sDwname==L"PartyBankAccount" )
|
{
|
int row = dw_contact.GetRow();
|
dw_contact.DeleteRow(row);
|
}
|
int h=m_layer.GetSheetIndex();
|
int nindex = h+1;
|
if(nindex==5)
|
{
|
dw_obj=GetControl(L"dw_jzfx");
|
xdwtable dw = dw_obj.GetCurTable();
|
int row1 = dw.GetRow();
|
if(dw.GetRowCount() >1)
|
dw.DeleteRow(row1);
|
}
|
if(nindex==4)
|
{
|
dw_obj=GetControl(L"dw_visit");
|
xdwtable dw1 = dw_obj.GetCurTable();
|
int row2 = dw1.GetRow();
|
dw1.DeleteRow(row2);
|
}
|
if(nindex==3)
|
{
|
dw_obj=GetControl(L"dw_MeetingsEx");
|
xdwtable dw4 = dw_obj.GetCurTable();
|
int row4 = dw4.GetRow();
|
dw4.DeleteRow(row4);
|
}
|
if(nindex==2)
|
{
|
dw_obj=GetControl(L"dw_Meetings");
|
xdwtable dw3 = dw_obj.GetCurTable();
|
int row3 = dw3.GetRow();
|
dw3.DeleteRow(row3);
|
}
|
return 0;
|
}
|
|
int OnDetailRow()
|
{
|
trace(L"detail");
|
return 0;
|
}
|
|
int OnPreSave()
|
{
|
xml xxx ;
|
|
dw_detail.DwUpdateAllTo(xxx);
|
trace(xxx.xml());
|
//return 0;
|
|
//¿Í»§Ãû³Æ
|
xstring sName;
|
sName = dw_detail.GetItemString(1,L"Name");
|
if (sName == L"")
|
{
|
alert(L"¿Í»§Ãû³Æ²»ÄÜΪ¿Õ£¡");
|
return 0;
|
}
|
|
xstring sShortName = dw_detail.GetItemString(1,L"ShortName");
|
if (sShortName == L"")
|
{
|
alert(L"¿Í»§¼ò³Æ²»ÄÜΪ¿Õ£¡");
|
return 0;
|
}
|
xstring Level = dw_detail.GetItemString(1,L"Level");
|
/*if (Level == L"")
|
{
|
alert(L"¿Í»§µÈ¼¶²»ÄÜΪ¿Õ£¡");
|
return 0;
|
}*/
|
|
/*
|
if(dw_detail.GetItemString(1,L"Address")==L"")
|
{
|
alert(L"¿Í»§µØÖ·²»ÄÜΪ¿Õ£¡");
|
return 0;
|
}
|
|
if(dw_detail.GetItemString(1,L"Source")==L"")
|
{
|
alert(L"¿Í»§À´Ô´²»ÄÜΪ¿Õ£¡");
|
return 0;
|
}
|
if(dw_detail.GetItemString(1,L"CountryCode")==L"")
|
{
|
alert(L"¿Í»§¹ú±ð²»ÄÜΪ¿Õ£¡");
|
return 0;
|
}
|
if(dw_detail.GetItemString(1,L"TEL")==L"")
|
{
|
alert(L"¹«Ë¾µç»°²»ÄÜΪ¿Õ£¡");
|
return 0;
|
}*/
|
//¿Í»§¼ò³Æ²»ÄÜÖØ¸´
|
/*
|
xstring sPartyID = GetPartyID(sShortName,L"ShortName");
|
if (sPartyID != L"")
|
{
|
alert(L"´Ë¿Í»§¼ò³ÆÒѾ´æÔÚ£¡");
|
}
|
*/
|
|
//¿Í»§´úÂë
|
xstring sPartyNo;
|
sPartyNo = dw_detail.GetItemString(1,L"PartyNo");
|
if (sPartyNo == L"" )
|
{
|
//alert(L"¿Í»§´úÂë²»ÄÜΪ¿Õ£¡");
|
//return 0;
|
|
xstring sNo = publiccode::GetIdentityNo(L"Party1");
|
if (sNo == L"")
|
sNo == L"1000";
|
dw_detail.SetItemString(1,L"PartyNo",sNo);
|
|
}
|
|
//³ÉÁ¢Ê±¼äYearEstablished
|
//¹ÍÔ±ÊýÁ¿Employees
|
//xstring sYearEstablished = dw_detail.GetItemString(1,L"YearEstablished");
|
//xstring sEmployees = dw_detail.GetItemString(1,L"Employees");
|
//sYearEstablished.toInt();
|
|
|
//ÁªÏµÈËÐÕÃûName-PCName£¬ÉèÖÃ״̬
|
xdwtable dw_PartyContact;
|
dw_PartyContact = dw_detail.FindDwTable(L"PartyContact");
|
xdwtable PC_OtherInfo;
|
PC_OtherInfo = dw_detail.FindDwTable(L"PC_OtherInfo");
|
int countflag=0;
|
if (dw_PartyContact)
|
{
|
int i;
|
for (i=1;i <= dw_PartyContact.GetRowCount();i++)
|
{
|
xstring sPCName = dw_PartyContact.GetItemString(i,L"Name");
|
if (sPCName == L"" )
|
{
|
xstring sPCTitle = dw_PartyContact.GetItemString(i,L"Title");
|
if (sPCTitle == L"") sPCTitle = L"";
|
xstring sPCJobTitle = dw_PartyContact.GetItemString(i,L"JobTitle");
|
if (sPCJobTitle == L"") sPCJobTitle = L"";
|
xstring sPCGender = dw_PartyContact.GetItemString(i,L"Gender");
|
if (sPCGender == L"") sPCGender = L"";
|
xstring sPCMobile = dw_PartyContact.GetItemString(i,L"Mobile");
|
if (sPCMobile == L"") sPCMobile = L"";
|
xstring sPCTEL = dw_PartyContact.GetItemString(i,L"TEL");
|
if (sPCTEL == L"") sPCTEL = L"";
|
xstring sPCEmail = dw_PartyContact.GetItemString(i,L"Email");
|
if (sPCEmail == L"") sPCEmail = L"";
|
xstring sAll = sPCTitle + sPCJobTitle + sPCGender + sPCMobile + sPCTEL + sPCEmail;
|
/*if (sAll != L"")
|
{
|
alert(L"ÁªÏµÈËÐÕÃû²»ÄÜΪ¿Õ");
|
return 0;
|
}*/
|
}
|
else
|
{
|
xstring aStatus;
|
aStatus = dw_PartyContact.GetItemString(i,L"Status");
|
if (aStatus==L"")
|
{
|
dw_PartyContact.SetItemString(i,L"Status",L"1");
|
}
|
}
|
if(dw_PartyContact.GetItemString(i,L"ContactID")==L"")
|
{
|
dw_PartyContact.SetItemString(i,L"ContactID",GetGuid());
|
}
|
xstring sFlag = dw_PartyContact.GetItemString(i,L"PrimaryFlag");
|
if(sFlag==L"Y")
|
{
|
countflag ++;
|
|
dw_PartyContact.SetItemString(i,L"PrimaryFlag",L"Y");
|
PC_OtherInfo.SetItemString(1,L"ContactID",dw_PartyContact.GetItemString(i,L"ContactID"));
|
|
}
|
|
}
|
if(countflag==0 && dw_PartyContact.GetItemString(1,L"Name") !=L"")
|
{
|
dw_PartyContact.SetItemString(1,L"PrimaryFlag",L"Y");
|
PC_OtherInfo.SetItemString(1,L"ContactID",dw_PartyContact.GetItemString(1,L"ContactID"));
|
}
|
}
|
|
//ÒøÐÐÕʺÅBankName-BankName£»BankAccountNo-PBABankAccountNo £» ÉèÖÃ״̬
|
xdwtable dw_PartyBankAccount;
|
dw_PartyBankAccount =dw_detail.FindDwTable(L"PartyBankAccount");
|
if (dw_PartyBankAccount)
|
{
|
int j;
|
for (j=1;j <= dw_PartyBankAccount.GetRowCount();j++)
|
{
|
xstring sPBABankName = dw_PartyBankAccount.GetItemString(j,L"BankName");
|
xstring sPBABankAccountNo = dw_PartyBankAccount.GetItemString(j,L"BankAccountNo");
|
if (sPBABankName == L"") sPBABankName = L"";
|
if (sPBABankAccountNo == L"") sPBABankAccountNo = L"";
|
xstring sPBAAll = sPBABankName + sPBABankAccountNo;
|
if (sPBAAll != L"")
|
{
|
/*if (sPBABankName == L"")
|
{
|
alert(L"ÒøÐÐÃû³Æ²»ÄÜΪ¿Õ");
|
return 0;
|
}
|
if (sPBABankAccountNo == L"")
|
{
|
alert(L"ÒøÐÐÕË»§²»ÄÜΪ¿Õ");
|
return 0;
|
}*/
|
dw_PartyBankAccount.SetItemString(j,L"Status",L"1");
|
}
|
}
|
}
|
|
//µØÖ·£¬ÉèÖÃ״̬
|
xdwtable dw_PartyAddress;
|
dw_PartyAddress =dw_detail.FindDwTable(L"PartyAddress");
|
if (dw_PartyAddress)
|
{
|
int k;
|
for (k=1;k <= dw_PartyAddress.GetRowCount();k++)
|
{
|
xstring sPADAddressName = dw_PartyAddress.GetItemString(k,L"AddressName");
|
xstring sPADAddress = dw_PartyAddress.GetItemString(k,L"Address");
|
if (sPADAddressName == L"") sPADAddressName = L"";
|
if (sPADAddress == L"") sPADAddress = L"";
|
xstring sPADAll = sPADAddressName + sPADAddress;
|
if (sPADAll != L"")
|
{
|
dw_PartyAddress.SetItemString(k,L"Status",L"1");
|
dw_PartyAddress.SetItemString(k,L"IdentifyAddressFlag",L"N");
|
}
|
}
|
}
|
return 1;
|
}
|
|
int DoUpdate(bool showSuccess = true)
|
{
|
int rec =OnPreSave();
|
if (rec != 1) return 0;
|
ProcessFlowAction(L"action:bill.update",1);
|
return 1;
|
}
|
|
int CustomerModify()//Ìøµ½¿Í»§Ð޸ĽçÃæ
|
{
|
//trace(L"asdsad");
|
xaserverarg& arg = *new xaserverarg;
|
arg.setNativePointer(arg.CreateInstance());
|
arg.AddArg(L"EntityID", maint::m_EntityID);
|
openUrl(L"/sale/view/"+GetEntityName(1)+L"/worknode/customermodify/open", &arg);
|
//CloseWindow();
|
return 1;
|
}
|
int OnComdidSplit(xstring str){
|
if(str.find(L"|", 0)<0)
|
return -1;
|
CustomerGoodsHWND = (HWND)str.mid(str.find(L"|",0) + 1, str.length()).toInt64();
|
}
|
|
|
int OnShare()
|
{
|
xaserverarg& arg = *new xaserverarg;
|
arg.setNativePointer(arg.CreateInstance());
|
int row = dw_detail.GetRow();
|
if(row < 1) return 0;
|
xstring PartyID = dw_detail.GetItemString(row,L"PartyID");
|
arg.AddArg(L"EntityID",PartyID);
|
arg.AddArg(L"EntityName", L"¿Í»§¹²Ïí");
|
OpenWindow(L"dev:xpage[UserGroupShare.vx]", (LPARAM) & arg);
|
return 1;
|
}
|
|
int OnShareMessage()
|
{
|
xaserverarg& arg = *new xaserverarg;
|
arg.setNativePointer(arg.CreateInstance());
|
int row = dw_detail.GetRow();
|
if(row < 1) return 0;
|
xstring PartyID = dw_detail.GetItemString(row,L"PartyID");
|
arg.AddArg(L"PartyID",PartyID);
|
OpenWindow(L"dev:xpage[XmShare.Custumer.v3.vx]", (LPARAM)&arg);
|
|
return 1;
|
}
|
|
int PreOnCmdDispatch(xstring comdid)
|
{
|
if (comdid == L"cb_save")
|
{
|
SendMessageW(CustomerGoodsHWND,0x401, (WPARAM)L"cb_save", 0);
|
}
|
else if (comdid == L"cb_copy")
|
{
|
SendMessageW(CustomerGoodsHWND,0x401, (WPARAM)L"cb_copy", 0);
|
}
|
else if (comdid == L"cb_delete")
|
{
|
SendMessageW(CustomerGoodsHWND,0x401, (WPARAM)L"cb_delete", 0);
|
}
|
else if (comdid == L"cb_reflash")
|
{
|
SendMessageW(CustomerGoodsHWND,0x401, (WPARAM)L"cb_reflash", 0);
|
}
|
else if(comdid == L"cb_add")
|
{
|
SendMessageW(CustomerGoodsHWND,0x401, (WPARAM)L"cb_add", 0);
|
}
|
else if(comdid == L"cb_import")
|
{
|
SendMessageW(CustomerGoodsHWND,0x401, (WPARAM)L"cb_import",0);
|
}
|
else if (comdid == L"action:bill.row.add") return OnAddRow();
|
else if (comdid == L"action:bill.row.insert") return OnInsertRow();
|
else if (comdid == L"action:bill.row.delete") return OnDeleteRow();
|
else if (comdid == L"action:bill.row.detail") return OnDetailRow();
|
else if (comdid == L"action:bill.SourceRemark") return OnSourceRemark();
|
|
else if (comdid == L"action:bill.update")
|
{
|
return OnPreSave();
|
}
|
else if (comdid == L"action:customermodify") return CustomerModify();
|
else if(comdid.find(L"|",0)){
|
OnComdidSplit(comdid);
|
}
|
if(comdid==L"action:XmShare")
|
{
|
OnShare();
|
return 0;
|
}
|
if(comdid==L"action:XmShareMessage")
|
{
|
OnShareMessage();
|
return 0;
|
}
|
// else if (comdid.find(L"action:",0) >= 0) return OnAction(comdid);
|
return -1;
|
}
|
|
int PostOnCmdDispatch(xstring comdid)
|
{
|
if (comdid == L"action:bill.update")
|
{
|
dw_detail.ResetUpdateStatus();
|
dw_visit.ResetUpdateStatus();
|
dw_Meetings.ResetUpdateStatus();
|
dw_MeetingsEx.ResetUpdateStatus();
|
}
|
|
return 1;
|
}
|
//Ñ¡ÔñtabÒ³Ãæ
|
int OnSelectedSheet(TEvent* evt,int p)
|
{
|
iLayer = m_layer.GetSheetIndex();
|
if (iLayer == 0)
|
SetAgent(L"maint",maint::m_EntityID);
|
else if (iLayer == 1)
|
{
|
int cc=APP;
|
cc=cc +1;
|
APP=cc;
|
if(cc==2)
|
{
|
xsheet.DeleteSheet(1);
|
xstring xp = L"<xframe src='dev:xpage[CustomerGoodsVd.vx]' />";
|
xaserverarg& arg = * new xaserverarg;
|
arg.setNativePointer(arg.CreateInstance());
|
arg.AddArg(L"CustomerID",m_EntityID);
|
arg.AddArg(L"FROM", L"Customer");
|
arg.AddArg(L"CustomerName", dw_detail.GetItemString(1,L"Name"));
|
arg.AddArg(L"config", L"¿Í»§²úÆ·.vface/config/CustomerGoodsVdVd/view");
|
//arg.AddArg(L"CustomerHWND",GetHWND().toString());
|
arg.SetParam(L"CustomerHWND", (LPARAM)GetHWND());
|
|
int nIndex = xsheet.InsertSheet(-1, L"¿Í»§ID»õºÅ¿â", xp, (void *) &arg);
|
xsheet.SelectSheet(nIndex);
|
}
|
//win32::SendMessage(CustomerGoodsHWND.toInt(),0x401, L"SetFocus", nil);
|
|
}
|
return 1;
|
}
|
|
int OnSourceRemark()
|
{
|
xstring name = L"¿Í»§¹ÜÀí";
|
xml x = ViewObject::RetrieveData(L"/sale/data/TradeFinance3/GetSetUpRemarks",L"Type",name);
|
KXMLDOMNodeList items = x.selectNodes(L"data/Item");
|
KXMLDOMNode t = items.item(0);
|
xstring Content=L"";
|
if(t.selectSingleNode(L"Content"))
|
{
|
Content=t.selectSingleNode(L"Content").text();
|
}
|
xaserverarg& arg1 = * new xaserverarg;
|
arg1.setNativePointer(arg1.CreateInstance());
|
arg1.AddArg(L"value",Content);
|
OpenWindow(L"dev:xpage[memo.edit.new.vx]",(LPARAM) & arg1);
|
|
return 1;
|
}
|
|
|
int OnItemClick(TEvent* evt,int p)
|
{
|
xdwtable dw = dw_detail.FindDwTable(L"item1",0);
|
xdwtable dw1 = dw_detail.FindDwTable(L"item2",0);
|
xdwtable dw2 = dw_detail.FindDwTable(L"item3",0);
|
int start=dw_detail.GetCellRowFromRowColumn(1,dw_detail.GetColumnIndex(L"Website"));
|
int m,n,k;
|
m=dw.GetRowCount();
|
n=dw1.GetRowCount();
|
k=dw2.GetRowCount();
|
if(dw.GetRowCount()==0)
|
{
|
m=dw.GetRowCount() +1;
|
}
|
if(dw1.GetRowCount()==0)
|
{
|
n=dw1.GetRowCount() +1;
|
}
|
if(dw2.GetRowCount()==0)
|
{
|
k=dw2.GetRowCount() +1;
|
}
|
DWNMHDR* hdr = (DWNMHDR*)evt->notify.pnmh;
|
xstring value = hdr->data;
|
|
|
//alert(value);
|
xaserverarg& arg=* new xaserverarg;
|
|
if(value == L"Ö÷ÒªÁªÏµÈËÆäËüÐÅÏ¢")
|
{
|
dw_detail.ExpandCellRow(start +m +5,start +m+7);
|
}
|
else if(value == L"ÆäËüµØÖ·")
|
{
|
dw_detail.ExpandCellRow(start +m+9,start +m+9+n);
|
//dw_base.ExpandMarginRow(-22,-20);
|
}
|
else if(value == L"ÒøÐÐÐÅÏ¢")
|
{
|
dw_detail.ExpandCellRow(start +m+11+n,start +m+11+n+k);
|
//dw_base.ExpandMarginRow(-22,-20);
|
}
|
else if(value == L"ÒµÎñ¸ÅÊö")
|
{
|
dw_detail.ExpandCellRow(start +m+13+n+k,start +m+13+n+k+2);
|
//dw_base.ExpandMarginRow(-22,-20);
|
}
|
else if(value == L"¿Í»§ÊÚÐÅ")
|
{
|
dw_detail.ExpandCellRow(start +m+15+n+k +2,start +m+15+n+k +2+1);
|
//dw_base.ExpandMarginRow(-22,-20);
|
}
|
if(value == L"¿Í»§×ÊÁϸ½¼þ")
|
{
|
|
if(userno == L"admin" || userno == L"00601" || userno == L"00701")
|
{
|
//alert(dw_detail.GetGuid(1));
|
arg.AddArg(L"entityid",dw_detail.GetGuid(1));
|
|
OpenWindow(L"dev:xpage[maint.Document.Customer.v3.vx]", (LPARAM) & arg);
|
return 1;
|
}
|
}
|
if(value == L"¿Í»§»ù±¾ÐÅÏ¢")
|
{
|
xaserverarg& arg1 = *new xaserverarg;
|
xstring str = dw_detail.GetItemString(1,L"BasicInformation");
|
arg1.AddArg(L"value",str);
|
OpenWindow(L"dev:xpage[memo.edit.new.vx]", (LPARAM)&arg1);
|
if(arg1.GetArgString(L"comdid")==L"xmOK")
|
{
|
str = arg1.GetArgString(L"value");
|
dw_detail.AcceptText();
|
dw_detail.SetItemString(1,L"BasicInformation",str);
|
}
|
return 1;
|
|
}
|
return 1;
|
}
|
|
int OnItemClickEx(TEvent* evt, int pr)
|
{
|
xdwtable dw = dw_visit.FindDwTable(L"item",0);
|
|
|
DWNMHDR* hdr = (DWNMHDR*)evt->notify.pnmh;
|
xstring colname = hdr->colname;
|
xstring value = hdr->data;
|
int row = hdr->row;
|
//alert(value);
|
xaserverarg& arg=*new xaserverarg;
|
arg.setNativePointer(arg.CreateInstance());
|
|
if(value == L"ÉÏ´«")
|
{
|
if(dw.GetGuid(dw.GetRow())==L"")
|
{
|
alert(L"±£´æºóÔÚÉÏ´«£¡");
|
return 1;
|
}
|
|
arg.AddArg(L"entityid",dw.GetGuid(dw.GetRow()));
|
|
OpenWindow(L"dev:xpage[maint.Document.Customer.v3.vx]", (LPARAM)&arg);
|
return 1;
|
}
|
return 1;
|
}
|
|
int OnItemClickExS(TEvent* evt,int p)
|
{
|
xdwtable dw = dw_Meetings.FindDwTable(L"item",0);
|
|
|
DWNMHDR* hdr = (DWNMHDR*)evt->notify.pnmh;
|
xstring colname = hdr->colname;
|
xstring value = hdr->data;
|
int row = hdr->row;
|
//alert(value);
|
xaserverarg& arg=*new xaserverarg;
|
|
|
if(value == L"¸½¼þÉÏ´«")
|
{
|
if(dw.GetGuid(dw.GetRow())==L"")
|
{
|
alert(L"±£´æºóÔÚÉÏ´«£¡");
|
return 1;
|
}
|
|
arg.AddArg(L"entityid",dw.GetGuid(dw.GetRow()));
|
|
OpenWindow(L"dev:xpage[maint.Document.Customer.v3.vx]", (LPARAM)&arg);
|
return 1;
|
}
|
|
if(value == L"ÈËÔ±")
|
{
|
xaserverarg& arg2 =* new xaserverarg;
|
|
|
xaserverarg& parg2 = *(xaserverarg*)GetParam();
|
|
OpenWindow(L"dev:xpage[UserGroupPersonSelect.vx]", (LPARAM)&arg2);
|
|
if(arg2.GetArgString(L"comdid")==L"xmOk")
|
{
|
xstring data = arg2.GetArgString(L"data");
|
xml x2;
|
|
x2.loadXML(data);
|
KXMLDOMNodeList nodes = x2.selectNodes(L"/root/item");
|
trace(x2.xml());
|
|
int len = nodes.length();
|
|
xstring Names = L"";
|
for(int i=0;i<len; i++)
|
{
|
KXMLDOMElement t= nodes.item(i);
|
|
if(t.getAttribute(L"Name"))
|
{
|
xstring Name = t.getAttribute(L"Name");
|
if(Names==L"")
|
Names = Name;
|
else if(Names.find(Name) < 0) Names+=L",L"+Name;
|
}
|
}
|
dw.SetItemString(dw.GetRow(),L"CMPersonnel",Names);
|
|
}
|
return 1;
|
}
|
|
return 1;
|
}
|
|
int OnItemClickExSS(TEvent* evt,int p)
|
{
|
xdwtable dw = dw_MeetingsEx.FindDwTable(L"item",0);
|
|
|
DWNMHDR* hdr = (DWNMHDR*)evt->notify.pnmh;
|
xstring colname = hdr->colname;
|
xstring value = hdr->data;
|
int row = hdr->row;
|
//alert(value);
|
xaserverarg& arg=*new xaserverarg;
|
|
|
if(value == L"¸½¼þÉÏ´«")
|
{
|
if(dw.GetGuid(dw.GetRow())==L"")
|
{
|
alert(L"±£´æºóÔÚÉÏ´«£¡");
|
return 1;
|
}
|
|
arg.AddArg(L"entityid",dw.GetGuid(dw.GetRow()));
|
|
OpenWindow(L"dev:xpage[maint.Document.Customer.v3.vx]",(LPARAM)&arg);
|
return 1;
|
}
|
|
if(value == L"ÈËÔ±")
|
{
|
xaserverarg& arg2 = *new xaserverarg;
|
|
xaserverarg parg2 = *(xaserverarg*)GetParam();
|
OpenWindow(L"dev:xpage[UserGroupPersonSelectEx.vx]", (LPARAM)&arg2);
|
|
if(arg2.GetArgString(L"comdid")==L"xmOk")
|
{
|
xstring data = arg2.GetArgString(L"data");
|
xml x2;
|
|
x2.loadXML(data);
|
KXMLDOMNodeList nodes = x2.selectNodes(L"/root/item");
|
trace(x2.xml());
|
|
int len = nodes.length();
|
|
xstring Names = L"";
|
for(int i=0;i<len; i++)
|
{
|
KXMLDOMElement t= nodes.item(i);
|
|
if(t.getAttribute(L"Name"))
|
{
|
xstring Name = t.getAttribute(L"Name");
|
if(Names==L"")
|
Names = Name;
|
else if(Names.find(Name) < 0) Names+=L",L"+Name;
|
}
|
}
|
dw.SetItemString(dw.GetRow(),L"CMPersonnel",Names);
|
}
|
return 1;
|
}
|
|
return 1;
|
}
|
|
int PostOnAttachEvent()
|
{
|
AttachEvent(L"dw_detail",L"DWV_ITEMCHANGED", (FEvent)&maintCustomerv3::OnItemChanged);
|
//AttachEvent(L"tab_1",L"LYSN_SELECTEDSHEET",(FEvent)&maintCustomerv3::OnSelectedSheet);
|
AttachEvent(L"dw_detail",L"DWV_CLICKED", (FEvent)&maintCustomerv3::OnItemClick);
|
AttachEvent(L"dw_visit",L"DWV_CLICKED", (FEvent)&maintCustomerv3::OnItemClickEx);
|
AttachEvent(L"dw_Meetings",L"DWV_CLICKED", (FEvent)&maintCustomerv3::OnItemClickExS);
|
AttachEvent(L"dw_MeetingsEx",L"DWV_CLICKED", (FEvent)&maintCustomerv3::OnItemClickExSS);
|
return 1;
|
}
|
|
int onload()
|
{
|
maint::onload();
|
}
|
|
int onloaded()
|
{
|
APP=1;
|
maint::onloaded();
|
|
|
m_layer = GetControl(L"tab_1");
|
dw_detail = GetControl(L"dw_detail");
|
dw_detail.SetColHeaderHeight(16);
|
dw_power = GetControl(L"dw_power");
|
dw_require =GetControl(L"dw_require");
|
dw_jzfx = GetControl(L"dw_jzfx");
|
dw_visit = GetControl(L"dw_visit");
|
dw_Meetings = GetControl(L"dw_Meetings");
|
dw_MeetingsEx = GetControl(L"dw_MeetingsEx");
|
//Ìí¼Ó¿Í»§²úÆ·¸½Ò³
|
xsheet = GetControl(L"tab_1");
|
//xstring xp = L"<xframe src='dev:xpage[CustomerGoodsVd.vx]' />";
|
/*xaserverarg arg = new xaserverarg;
|
arg.setNativePointer(arg.CreateInstance());
|
arg.AddArg(L"CustomerID", this.m_EntityID);
|
arg.AddArg(L"CustomerName", dw_detail.GetItemString(1,L"Name"));
|
arg.AddArg(L"config", L"¿Í»§²úÆ·.vface/config/CustomerGoodsNewVd/view");
|
arg.AddArg(L"CustomerHWND",this.GetHWND().toString());
|
//trace(this.m_EntityID);
|
int p =arg.__nativept;*/
|
//int nIndex = xsheet.InsertSheet(-1, L"¿Í»§ID»õºÅ¿â", xp, 0);
|
//xsheet.SelectSheet(nIndex);
|
//xsheet.SelectSheet(0);
|
//ĬÈÏÊÕËõ
|
/*xdwtable dw = new xdwtable;
|
dw.setNativePointer(dw_detail.FindDwTable(L"PartyAddress",0));
|
xdwtable dw1 = new xdwtable;
|
dw1.setNativePointer(dw_detail.FindDwTable(L"PartyBankAccount",0));
|
xdwtable dw2 = new xdwtable;
|
dw2.setNativePointer(dw_detail.FindDwTable(L"PartyContact",0));
|
int start=dw_detail.GetCellRowFromRowColumn(1,dw_detail.GetColumnIndex(L"Website"));
|
dw_detail.ExpandCellRow(start + dw2.GetRowCount() +3,start +dw2.GetRowCount()+5);
|
int start1=dw_detail.GetCellRowFromRowColumn(1,dw_detail.GetColumnIndex(L"Website"));
|
dw_detail.ExpandCellRow(start1 + dw2.GetRowCount() +7,start1 + dw2.GetRowCount() +7 +dw.GetRowCount());
|
int start2=dw_detail.GetCellRowFromRowColumn(1,dw_detail.GetColumnIndex(L"Website"));
|
dw_detail.ExpandCellRow(start2 + dw2.GetRowCount() +9 +dw.GetRowCount(),start2 + dw2.GetRowCount() +9 +dw.GetRowCount() +dw1.GetRowCount());
|
int start3=dw_detail.GetCellRowFromRowColumn(1,dw_detail.GetColumnIndex(L"YearEstablished"));
|
dw_detail.ExpandCellRow(start3,start3 +2);
|
int start4=dw_detail.GetCellRowFromRowColumn(1,dw_detail.GetColumnIndex(L"CompanyCredit"));
|
dw_detail.ExpandCellRow(start4,start4 +1); */
|
|
//ĬÈÏÊÕËõ
|
xdwtable dw = dw_detail.FindDwTable(L"item1",0);
|
xdwtable dw1 = dw_detail.FindDwTable(L"item2",0);
|
xdwtable dw2 = dw_detail.FindDwTable(L"item3",0);
|
int m,n,k;
|
m=dw.GetRowCount();
|
n=dw1.GetRowCount();
|
k=dw2.GetRowCount();
|
if(dw.GetRowCount()==0)
|
{
|
m=dw.GetRowCount() +1;
|
}
|
if(dw1.GetRowCount()==0)
|
{
|
n=dw1.GetRowCount() +1;
|
}
|
if(dw2.GetRowCount()==0)
|
{
|
k=dw2.GetRowCount() +1;
|
}
|
//trace(dw2.GetRowCount());
|
|
int start=dw_detail.GetCellRowFromRowColumn(1,dw_detail.GetColumnIndex(L"Website"));
|
dw_detail.ExpandCellRow(start +m +5,start +m+7);
|
//trace(start +k +3);
|
dw_detail.ExpandCellRow(start +m+9,start +m+9+n);
|
//trace(start +k+7);
|
dw_detail.ExpandCellRow(start +m+11+n,start +m+11+n+k);
|
//trace(start +k+10+m);
|
dw_detail.ExpandCellRow(start +m+13+n+k,start +m+13+n+k+2);
|
//trace(start +k+14+m+n);
|
dw_detail.ExpandCellRow(start +m+15+n+k +2,start +m+15+n+k +2+1);
|
//trace(start +k+16+m+n +2);
|
|
if (!maint::m_EntityID)
|
{
|
OnInit();
|
}else
|
{
|
//xstring userno = publiccode::getUserNo();
|
userno = xaserver::GetUserNo();
|
if(userno !=L"00601" && userno !=L"admin" && userno !=L"00701")
|
{
|
dw_detail.SetColumnProp(L"SalesPersonID",L"cellprotect",L"1");
|
|
}
|
}
|
|
|
if (GetParam())
|
{
|
int iArgs = GetParam();
|
xaserverarg& args = *new xaserverarg;
|
|
//alert(args.GetString());
|
xstring CustomerGood = args.GetArgString(L"CustomerGood");
|
ApplyStatus= args.GetArgString(L"CustomerGood");
|
if(CustomerGood==L"Y")
|
{
|
xsheet.DeleteSheet(0);
|
xstring xp = L"<xframe src='dev:xpage[CustomerGoodsVd.vx]' />";
|
xaserverarg& arg = *new xaserverarg;
|
arg.setNativePointer(arg.CreateInstance());
|
arg.AddArg(L"CustomerID", m_EntityID);
|
arg.AddArg(L"FROM", L"Customer");
|
arg.AddArg(L"CustomerName", dw_detail.GetItemString(1,L"Name"));
|
arg.AddArg(L"config", L"¿Í»§²úÆ·.vface/config/CustomerGoodsVdVd/view");
|
//arg.AddArg(L"CustomerHWND",GetHWND().toString());
|
arg.SetParam(L"CustomerHWND", (LPARAM)GetHWND());
|
|
int nIndex = xsheet.InsertSheet(-1, L"¿Í»§ID»õºÅ¿â", xp, (void*)&arg);
|
xsheet.SelectSheet(nIndex);
|
//xsheet.SetSheetState(0, 0);
|
}
|
|
|
ApplyStatus=dw_detail.GetItemString(1,L"ApplyStatus");
|
|
if(userno !=L"00601" && userno !=L"admin" && userno !=L"00701")
|
{
|
if(ApplyStatus ==L"²ÆÎñÒÑÉóºË")
|
{
|
dw_detail.SetReadOnly(true);
|
}
|
}
|
|
|
dw_detail.SetEditUpperMode(true);
|
dw_visit.SetEditUpperMode(true);
|
dw_Meetings.SetEditUpperMode(true);
|
dw_MeetingsEx.SetEditUpperMode(true);
|
}
|
return 1;
|
}
|
};
|