|
|
@@ -1,4 +1,4 @@
|
|
|
-#include "../pch/pch.h"
|
|
|
+#include "../pch/pch.h"
|
|
|
#include "CShangpinUpdatePageUI.h"
|
|
|
|
|
|
#include "../control/ControlEx.h"
|
|
|
@@ -18,18 +18,18 @@ CShangpinUpdatePageUI::~CShangpinUpdatePageUI()
|
|
|
{
|
|
|
}
|
|
|
|
|
|
-//初始化当前页面的展示,处理默认展示效果,在页面被加载的时候调用
|
|
|
+//初始化当前页面的展示,处理默认展示效果,在页面被加载的时候调用
|
|
|
void CShangpinUpdatePageUI::InitShow()
|
|
|
{
|
|
|
- //商品名字
|
|
|
+ //鍟嗗搧鍚嶅瓧
|
|
|
CEditUI* pName = static_cast<CEditUI*>(this->FindSubControl(L"shangpin_create_page_name_edit"));
|
|
|
pName->SetText(CLewaimaiString::UTF8ToUnicode(m_foodinfo.name).c_str());
|
|
|
|
|
|
- //商品序号
|
|
|
+ //鍟嗗搧搴忓彿
|
|
|
CEditUI* pXuhao = static_cast<CEditUI*>(this->FindSubControl(L"shangpin_create_page_xuhao_edit"));
|
|
|
pXuhao->SetText(CLewaimaiString::UTF8ToUnicode(m_foodinfo.tag).c_str());
|
|
|
|
|
|
- //初始化商品分类
|
|
|
+ //初始化商品分类
|
|
|
CComboUI* com_fenlei = static_cast<CComboUI*>(this->FindSubControl(_T("shangpin_create_page_foodtype")));
|
|
|
com_fenlei->RemoveAll();
|
|
|
|
|
|
@@ -66,19 +66,19 @@ void CShangpinUpdatePageUI::InitShow()
|
|
|
|
|
|
com_fenlei->SetText(CLewaimaiString::UTF8ToUnicode(select_foodtype_name).c_str());
|
|
|
|
|
|
- //商品条码
|
|
|
+ //鍟嗗搧鏉$爜
|
|
|
CEditUI* pTiaoma = static_cast<CEditUI*>(this->FindSubControl(L"shangpin_create_page_barcode_edit"));
|
|
|
pTiaoma->SetText(CLewaimaiString::UTF8ToUnicode(m_foodinfo.barcode).c_str());
|
|
|
|
|
|
- //商品价格
|
|
|
+ //鍟嗗搧浠锋牸
|
|
|
CEditUI* pPrice = static_cast<CEditUI*>(this->FindSubControl(L"shangpin_create_page_price_edit"));
|
|
|
pPrice->SetText(CLewaimaiString::UTF8ToUnicode(m_foodinfo.price).c_str());
|
|
|
|
|
|
- //商品单位
|
|
|
+ //鍟嗗搧鍗曚綅
|
|
|
CEditUI* pDanwei = static_cast<CEditUI*>(this->FindSubControl(L"shangpin_create_page_unit_edit"));
|
|
|
pDanwei->SetText(CLewaimaiString::UTF8ToUnicode(m_foodinfo.unit).c_str());
|
|
|
|
|
|
- //是否称重
|
|
|
+ //鏄�惁绉伴噸
|
|
|
CCheckBoxUI* pChengzhong = static_cast<CCheckBoxUI*>(this->FindSubControl(L"shangpin_create_page_chengzhong"));
|
|
|
if (m_foodinfo.is_weight == "1")
|
|
|
{
|
|
|
@@ -89,15 +89,15 @@ void CShangpinUpdatePageUI::InitShow()
|
|
|
pChengzhong->Selected(false, false);
|
|
|
}
|
|
|
|
|
|
- //plu编码
|
|
|
+ //plu缂栫爜
|
|
|
CEditUI* pPlu = static_cast<CEditUI*>(this->FindSubControl(L"shangpin_create_page_plu"));
|
|
|
pPlu->SetText(CLewaimaiString::UTF8ToUnicode(m_foodinfo.weight_plu_code).c_str());
|
|
|
|
|
|
- //商品编码
|
|
|
+ //鍟嗗搧缂栫爜
|
|
|
CEditUI* pShangpin = static_cast<CEditUI*>(this->FindSubControl(L"shangpin_create_page_shangpinbianma"));
|
|
|
pShangpin->SetText(CLewaimaiString::UTF8ToUnicode(m_foodinfo.weight_food_code).c_str());
|
|
|
|
|
|
- //库存类型
|
|
|
+ //搴撳瓨绫诲瀷
|
|
|
CCheckBoxUI* pKucuntypeOpen = static_cast<CCheckBoxUI*>(this->FindSubControl(L"shangpin_create_page_kucun_open"));
|
|
|
CCheckBoxUI* pKucuntypeWuxian = static_cast<CCheckBoxUI*>(this->FindSubControl(L"shangpin_create_page_kucun_wuxian"));
|
|
|
if (m_foodinfo.stockvalid == "1")
|
|
|
@@ -111,11 +111,11 @@ void CShangpinUpdatePageUI::InitShow()
|
|
|
pKucuntypeWuxian->Selected(true, false);
|
|
|
}
|
|
|
|
|
|
- //当前库存
|
|
|
+ //褰撳墠搴撳瓨
|
|
|
CEditUI* pDangqiankucun = static_cast<CEditUI*>(this->FindSubControl(L"shangpin_create_page_kucun_now"));
|
|
|
pDangqiankucun->SetText(CLewaimaiString::UTF8ToUnicode(m_foodinfo.stock).c_str());
|
|
|
|
|
|
- //商品状态
|
|
|
+ //商品状态
|
|
|
CCheckBoxUI* pStatusNormal = static_cast<CCheckBoxUI*>(this->FindSubControl(L"shangpin_create_page_status_normal"));
|
|
|
CCheckBoxUI* pStatusXiajia = static_cast<CCheckBoxUI*>(this->FindSubControl(L"shangpin_create_page_status_xiajia"));
|
|
|
if (m_foodinfo.status == "NORMAL")
|
|
|
@@ -129,11 +129,11 @@ void CShangpinUpdatePageUI::InitShow()
|
|
|
pStatusXiajia->Selected(true, false);
|
|
|
}
|
|
|
|
|
|
- //进货价
|
|
|
+ //进货价
|
|
|
CEditUI* pJinhuojia = static_cast<CEditUI*>(this->FindSubControl(L"shangpin_create_page_buyingprice_edit"));
|
|
|
pJinhuojia->SetText(CLewaimaiString::UTF8ToUnicode(m_foodinfo.buying_price).c_str());
|
|
|
|
|
|
- //进货价模式
|
|
|
+ //进货价模式
|
|
|
CCheckBoxUI* pJinhuomoshiNormal = static_cast<CCheckBoxUI*>(this->FindSubControl(L"shangpin_create_page_jinhuojia_normal"));
|
|
|
CCheckBoxUI* pJinhuomoshiJiaquan = static_cast<CCheckBoxUI*>(this->FindSubControl(L"shangpin_create_page_jinhuojia_jiaquan"));
|
|
|
if (m_foodinfo.cost_mode == "0")
|
|
|
@@ -147,7 +147,7 @@ void CShangpinUpdatePageUI::InitShow()
|
|
|
pJinhuomoshiJiaquan->Selected(true, false);
|
|
|
}
|
|
|
|
|
|
- //在哪些地方显示
|
|
|
+ //在哪些地方显示
|
|
|
CCheckBoxUI* pShouyinji = static_cast<CCheckBoxUI*>(this->FindSubControl(L"shangpin_create_page_showplace_shouyinji"));
|
|
|
CCheckBoxUI* pWaimai = static_cast<CCheckBoxUI*>(this->FindSubControl(L"shangpin_create_page_showplace_waimai"));
|
|
|
CCheckBoxUI* pSaomaidancan = static_cast<CCheckBoxUI*>(this->FindSubControl(L"shangpin_create_page_showplace_saomadiancan"));
|
|
|
@@ -179,7 +179,7 @@ void CShangpinUpdatePageUI::InitShow()
|
|
|
pSaomaidancan->Selected(false, false);
|
|
|
}
|
|
|
|
|
|
- //是否开启打包费
|
|
|
+ //鏄�惁寮€鍚�墦鍖呰垂
|
|
|
CCheckBoxUI* pDabao = static_cast<CCheckBoxUI*>(this->FindSubControl(L"shangpin_create_page_is_dabao"));
|
|
|
if (m_foodinfo.is_dabao == "1")
|
|
|
{
|
|
|
@@ -190,11 +190,11 @@ void CShangpinUpdatePageUI::InitShow()
|
|
|
pDabao->Selected(false, false);
|
|
|
}
|
|
|
|
|
|
- //打包费
|
|
|
+ //打包费
|
|
|
CEditUI* pDaobaofei = static_cast<CEditUI*>(this->FindSubControl(L"shangpin_create_page_dabao_money"));
|
|
|
pDaobaofei->SetText(CLewaimaiString::UTF8ToUnicode(m_foodinfo.dabao_money).c_str());
|
|
|
|
|
|
- //商品加工方式
|
|
|
+ //鍟嗗搧鍔犲伐鏂瑰紡
|
|
|
CCheckBoxUI* pJiagongfangshi_1 = static_cast<CCheckBoxUI*>(this->FindSubControl(L"shangpin_create_page_fangan_1"));
|
|
|
CCheckBoxUI* pJiagongfangshi_2 = static_cast<CCheckBoxUI*>(this->FindSubControl(L"shangpin_create_page_fangan_2"));
|
|
|
CCheckBoxUI* pJiagongfangshi_3 = static_cast<CCheckBoxUI*>(this->FindSubControl(L"shangpin_create_page_fangan_3"));
|
|
|
@@ -221,7 +221,7 @@ void CShangpinUpdatePageUI::InitShow()
|
|
|
layout->SetScrollPos(pos);
|
|
|
}
|
|
|
|
|
|
-//处理按钮点击类事件
|
|
|
+//处理按钮点击类事件
|
|
|
void CShangpinUpdatePageUI::HandleClickMsg(TNotifyUI& msg)
|
|
|
{
|
|
|
CDuiString name = msg.pSender->GetName();
|
|
|
@@ -244,7 +244,7 @@ void CShangpinUpdatePageUI::HandleClickMsg(TNotifyUI& msg)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-//处理option切换事件
|
|
|
+//澶勭悊option鍒囨崲浜嬩欢
|
|
|
void CShangpinUpdatePageUI::HandleSelectChangeMsg(TNotifyUI& msg)
|
|
|
{
|
|
|
CDuiString name = msg.pSender->GetName();
|
|
|
@@ -258,20 +258,20 @@ void CShangpinUpdatePageUI::HandleSelectChangeMsg(TNotifyUI& msg)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-//处理下拉框、radio的切换事件
|
|
|
+//处理下拉框、radio的切换事件
|
|
|
void CShangpinUpdatePageUI::HandleItemSelectMsg(TNotifyUI& msg)
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
-//处理编辑框输入内容改变事件
|
|
|
+//处理编辑框输入内容改变事件
|
|
|
void CShangpinUpdatePageUI::HandleTextChangedMsg(TNotifyUI& msg)
|
|
|
{
|
|
|
CDuiString name = msg.pSender->GetName();
|
|
|
|
|
|
if (name == L"shangpin_create_page_xuhao_edit")
|
|
|
{
|
|
|
- //只能输入数字,其他的全部删除
|
|
|
+ //鍙�兘杈撳叆鏁板瓧锛屽叾浠栫殑鍏ㄩ儴鍒犻櫎
|
|
|
CEditUI* m_pEdit = static_cast<CEditUI*>(m_pManager->FindControl(_T("shangpin_create_page_xuhao_edit")));
|
|
|
if (!m_pEdit->GetText().IsEmpty())
|
|
|
{
|
|
|
@@ -283,11 +283,11 @@ void CShangpinUpdatePageUI::HandleTextChangedMsg(TNotifyUI& msg)
|
|
|
unsigned char tmp = strValue.at(nIndex);
|
|
|
if ((tmp > 57 || tmp < 48))
|
|
|
{
|
|
|
- //ASCII码不是数字的都过滤掉
|
|
|
+ //ASCII鐮佷笉鏄�暟瀛楃殑閮借繃婊ゆ帀
|
|
|
strValue = strValue.substr(0, nIndex);
|
|
|
|
|
|
m_pEdit->SetText(CLewaimaiString::UTF8ToUnicode(strValue).c_str());
|
|
|
- m_pEdit->SetSel(strValue.length(), strValue.length());//重设给光标设置位置
|
|
|
+ m_pEdit->SetSel(strValue.length(), strValue.length());//重设给光标设置位置
|
|
|
|
|
|
break;
|
|
|
}
|
|
|
@@ -296,7 +296,7 @@ void CShangpinUpdatePageUI::HandleTextChangedMsg(TNotifyUI& msg)
|
|
|
}
|
|
|
else if (name == L"shangpin_create_page_barcode_edit")
|
|
|
{
|
|
|
- //只能输入数字,其他的全部删除
|
|
|
+ //鍙�兘杈撳叆鏁板瓧锛屽叾浠栫殑鍏ㄩ儴鍒犻櫎
|
|
|
CEditUI* m_pEdit = static_cast<CEditUI*>(m_pManager->FindControl(_T("shangpin_create_page_barcode_edit")));
|
|
|
if (!m_pEdit->GetText().IsEmpty())
|
|
|
{
|
|
|
@@ -308,11 +308,11 @@ void CShangpinUpdatePageUI::HandleTextChangedMsg(TNotifyUI& msg)
|
|
|
unsigned char tmp = strValue.at(nIndex);
|
|
|
if ((tmp > 57 || tmp < 48))
|
|
|
{
|
|
|
- //ASCII码不是数字的都过滤掉
|
|
|
+ //ASCII鐮佷笉鏄�暟瀛楃殑閮借繃婊ゆ帀
|
|
|
strValue = strValue.substr(0, nIndex);
|
|
|
|
|
|
m_pEdit->SetText(CLewaimaiString::UTF8ToUnicode(strValue).c_str());
|
|
|
- m_pEdit->SetSel(strValue.length(), strValue.length());//重设给光标设置位置
|
|
|
+ m_pEdit->SetSel(strValue.length(), strValue.length());//重设给光标设置位置
|
|
|
|
|
|
break;
|
|
|
}
|
|
|
@@ -321,7 +321,7 @@ void CShangpinUpdatePageUI::HandleTextChangedMsg(TNotifyUI& msg)
|
|
|
}
|
|
|
else if (name == L"shangpin_create_page_price_edit")
|
|
|
{
|
|
|
- //只能输入数字,其他的全部删除
|
|
|
+ //鍙�兘杈撳叆鏁板瓧锛屽叾浠栫殑鍏ㄩ儴鍒犻櫎
|
|
|
CEditUI* m_pEdit = static_cast<CEditUI*>(m_pManager->FindControl(_T("shangpin_create_page_price_edit")));
|
|
|
if (!m_pEdit->GetText().IsEmpty())
|
|
|
{
|
|
|
@@ -333,11 +333,11 @@ void CShangpinUpdatePageUI::HandleTextChangedMsg(TNotifyUI& msg)
|
|
|
unsigned char tmp = strValue.at(nIndex);
|
|
|
if ((tmp > 57 || tmp < 48) && tmp != 46)
|
|
|
{
|
|
|
- //ASCII码不是数字的都过滤掉
|
|
|
+ //ASCII鐮佷笉鏄�暟瀛楃殑閮借繃婊ゆ帀
|
|
|
strValue = strValue.substr(0, nIndex);
|
|
|
|
|
|
m_pEdit->SetText(CLewaimaiString::UTF8ToUnicode(strValue).c_str());
|
|
|
- m_pEdit->SetSel(strValue.length(), strValue.length());//重设给光标设置位置
|
|
|
+ m_pEdit->SetSel(strValue.length(), strValue.length());//重设给光标设置位置
|
|
|
|
|
|
break;
|
|
|
}
|
|
|
@@ -346,7 +346,7 @@ void CShangpinUpdatePageUI::HandleTextChangedMsg(TNotifyUI& msg)
|
|
|
}
|
|
|
else if (name == L"shangpin_create_page_buyingprice_edit")
|
|
|
{
|
|
|
- //只能输入数字,其他的全部删除
|
|
|
+ //鍙�兘杈撳叆鏁板瓧锛屽叾浠栫殑鍏ㄩ儴鍒犻櫎
|
|
|
CEditUI* m_pEdit = static_cast<CEditUI*>(m_pManager->FindControl(_T("shangpin_create_page_buyingprice_edit")));
|
|
|
if (!m_pEdit->GetText().IsEmpty())
|
|
|
{
|
|
|
@@ -358,11 +358,11 @@ void CShangpinUpdatePageUI::HandleTextChangedMsg(TNotifyUI& msg)
|
|
|
unsigned char tmp = strValue.at(nIndex);
|
|
|
if ((tmp > 57 || tmp < 48) && tmp != 46)
|
|
|
{
|
|
|
- //ASCII码不是数字的都过滤掉
|
|
|
+ //ASCII鐮佷笉鏄�暟瀛楃殑閮借繃婊ゆ帀
|
|
|
strValue = strValue.substr(0, nIndex);
|
|
|
|
|
|
m_pEdit->SetText(CLewaimaiString::UTF8ToUnicode(strValue).c_str());
|
|
|
- m_pEdit->SetSel(strValue.length(), strValue.length());//重设给光标设置位置
|
|
|
+ m_pEdit->SetSel(strValue.length(), strValue.length());//重设给光标设置位置
|
|
|
|
|
|
break;
|
|
|
}
|
|
|
@@ -371,7 +371,7 @@ void CShangpinUpdatePageUI::HandleTextChangedMsg(TNotifyUI& msg)
|
|
|
}
|
|
|
else if (name == L"shangpin_create_page_plu")
|
|
|
{
|
|
|
- //只能输入数字,其他的全部删除
|
|
|
+ //鍙�兘杈撳叆鏁板瓧锛屽叾浠栫殑鍏ㄩ儴鍒犻櫎
|
|
|
CEditUI* m_pEdit = static_cast<CEditUI*>(m_pManager->FindControl(_T("shangpin_create_page_plu")));
|
|
|
if (!m_pEdit->GetText().IsEmpty())
|
|
|
{
|
|
|
@@ -383,11 +383,11 @@ void CShangpinUpdatePageUI::HandleTextChangedMsg(TNotifyUI& msg)
|
|
|
unsigned char tmp = strValue.at(nIndex);
|
|
|
if ((tmp > 57 || tmp < 48))
|
|
|
{
|
|
|
- //ASCII码不是数字的都过滤掉
|
|
|
+ //ASCII鐮佷笉鏄�暟瀛楃殑閮借繃婊ゆ帀
|
|
|
strValue = strValue.substr(0, nIndex);
|
|
|
|
|
|
m_pEdit->SetText(CLewaimaiString::UTF8ToUnicode(strValue).c_str());
|
|
|
- m_pEdit->SetSel(strValue.length(), strValue.length());//重设给光标设置位置
|
|
|
+ m_pEdit->SetSel(strValue.length(), strValue.length());//重设给光标设置位置
|
|
|
|
|
|
break;
|
|
|
}
|
|
|
@@ -396,7 +396,7 @@ void CShangpinUpdatePageUI::HandleTextChangedMsg(TNotifyUI& msg)
|
|
|
}
|
|
|
else if (name == L"shangpin_create_page_shangpinbianma")
|
|
|
{
|
|
|
- //只能输入数字,其他的全部删除
|
|
|
+ //鍙�兘杈撳叆鏁板瓧锛屽叾浠栫殑鍏ㄩ儴鍒犻櫎
|
|
|
CEditUI* m_pEdit = static_cast<CEditUI*>(m_pManager->FindControl(_T("shangpin_create_page_shangpinbianma")));
|
|
|
if (!m_pEdit->GetText().IsEmpty())
|
|
|
{
|
|
|
@@ -408,11 +408,11 @@ void CShangpinUpdatePageUI::HandleTextChangedMsg(TNotifyUI& msg)
|
|
|
unsigned char tmp = strValue.at(nIndex);
|
|
|
if ((tmp > 57 || tmp < 48))
|
|
|
{
|
|
|
- //ASCII码不是数字的都过滤掉
|
|
|
+ //ASCII鐮佷笉鏄�暟瀛楃殑閮借繃婊ゆ帀
|
|
|
strValue = strValue.substr(0, nIndex);
|
|
|
|
|
|
m_pEdit->SetText(CLewaimaiString::UTF8ToUnicode(strValue).c_str());
|
|
|
- m_pEdit->SetSel(strValue.length(), strValue.length());//重设给光标设置位置
|
|
|
+ m_pEdit->SetSel(strValue.length(), strValue.length());//重设给光标设置位置
|
|
|
|
|
|
break;
|
|
|
}
|
|
|
@@ -421,7 +421,7 @@ void CShangpinUpdatePageUI::HandleTextChangedMsg(TNotifyUI& msg)
|
|
|
}
|
|
|
else if (name == L"shangpin_create_page_dabao_money")
|
|
|
{
|
|
|
- //只能输入数字,其他的全部删除
|
|
|
+ //鍙�兘杈撳叆鏁板瓧锛屽叾浠栫殑鍏ㄩ儴鍒犻櫎
|
|
|
CEditUI* m_pEdit = static_cast<CEditUI*>(m_pManager->FindControl(_T("shangpin_create_page_dabao_money")));
|
|
|
if (!m_pEdit->GetText().IsEmpty())
|
|
|
{
|
|
|
@@ -433,11 +433,11 @@ void CShangpinUpdatePageUI::HandleTextChangedMsg(TNotifyUI& msg)
|
|
|
unsigned char tmp = strValue.at(nIndex);
|
|
|
if ((tmp > 57 || tmp < 48) && tmp != 46)
|
|
|
{
|
|
|
- //ASCII码不是数字的都过滤掉
|
|
|
+ //ASCII鐮佷笉鏄�暟瀛楃殑閮借繃婊ゆ帀
|
|
|
strValue = strValue.substr(0, nIndex);
|
|
|
|
|
|
m_pEdit->SetText(CLewaimaiString::UTF8ToUnicode(strValue).c_str());
|
|
|
- m_pEdit->SetSel(strValue.length(), strValue.length());//重设给光标设置位置
|
|
|
+ m_pEdit->SetSel(strValue.length(), strValue.length());//重设给光标设置位置
|
|
|
|
|
|
break;
|
|
|
}
|
|
|
@@ -446,7 +446,7 @@ void CShangpinUpdatePageUI::HandleTextChangedMsg(TNotifyUI& msg)
|
|
|
}
|
|
|
else if (name == L"shangpin_create_page_kucun_now")
|
|
|
{
|
|
|
- //只能输入数字,其他的全部删除
|
|
|
+ //鍙�兘杈撳叆鏁板瓧锛屽叾浠栫殑鍏ㄩ儴鍒犻櫎
|
|
|
CEditUI* m_pEdit = static_cast<CEditUI*>(m_pManager->FindControl(_T("shangpin_create_page_kucun_now")));
|
|
|
if (!m_pEdit->GetText().IsEmpty())
|
|
|
{
|
|
|
@@ -458,11 +458,11 @@ void CShangpinUpdatePageUI::HandleTextChangedMsg(TNotifyUI& msg)
|
|
|
unsigned char tmp = strValue.at(nIndex);
|
|
|
if ((tmp > 57 || tmp < 48))
|
|
|
{
|
|
|
- //ASCII码不是数字的都过滤掉
|
|
|
+ //ASCII鐮佷笉鏄�暟瀛楃殑閮借繃婊ゆ帀
|
|
|
strValue = strValue.substr(0, nIndex);
|
|
|
|
|
|
m_pEdit->SetText(CLewaimaiString::UTF8ToUnicode(strValue).c_str());
|
|
|
- m_pEdit->SetSel(strValue.length(), strValue.length());//重设给光标设置位置
|
|
|
+ m_pEdit->SetSel(strValue.length(), strValue.length());//重设给光标设置位置
|
|
|
|
|
|
break;
|
|
|
}
|
|
|
@@ -471,7 +471,7 @@ void CShangpinUpdatePageUI::HandleTextChangedMsg(TNotifyUI& msg)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-//处理扫码枪捕捉到的扫码信息
|
|
|
+//处理扫码枪捕捉到的扫码信息
|
|
|
void CShangpinUpdatePageUI::HandleTextCapture(std::string content)
|
|
|
{
|
|
|
|
|
|
@@ -481,7 +481,7 @@ bool CShangpinUpdatePageUI::HandleCustomMessage(UINT uMsg, WPARAM wParam, LPARAM
|
|
|
{
|
|
|
if (uMsg == WM_FOOD_HANDLE_SUCCESS)
|
|
|
{
|
|
|
- //然后返回到商品页面
|
|
|
+ //然后返回到商品页面
|
|
|
m_pMainWnd->SwitchPage(CMainWnd::SHANGPIN);
|
|
|
|
|
|
return true;
|
|
|
@@ -499,53 +499,53 @@ void CShangpinUpdatePageUI::SetPos(RECT rc, bool bNeedInvalidate)
|
|
|
|
|
|
void CShangpinUpdatePageUI::StartSave()
|
|
|
{
|
|
|
- //把参数一个个读出来
|
|
|
+ //把参数一个个读出来
|
|
|
|
|
|
- //商品名字
|
|
|
+ //鍟嗗搧鍚嶅瓧
|
|
|
CEditUI* pName = static_cast<CEditUI*>(this->FindSubControl(L"shangpin_create_page_name_edit"));
|
|
|
std::wstring ws_name = pName->GetText();
|
|
|
m_name = CLewaimaiString::UnicodeToUTF8(ws_name);
|
|
|
|
|
|
- //商品序号
|
|
|
+ //鍟嗗搧搴忓彿
|
|
|
CEditUI* pXuhao = static_cast<CEditUI*>(this->FindSubControl(L"shangpin_create_page_xuhao_edit"));
|
|
|
std::wstring ws_xuhao = pXuhao->GetText();
|
|
|
m_xuhao = CLewaimaiString::UnicodeToUTF8(ws_xuhao);
|
|
|
|
|
|
- //初始化商品分类
|
|
|
+ //初始化商品分类
|
|
|
CComboUI* com_fenlei = static_cast<CComboUI*>(this->FindSubControl(_T("shangpin_create_page_foodtype")));
|
|
|
std::wstring ws_type = com_fenlei->GetText();
|
|
|
m_fenlei = CLewaimaiString::UnicodeToUTF8(ws_type);
|
|
|
|
|
|
- //商品条码
|
|
|
+ //鍟嗗搧鏉$爜
|
|
|
CEditUI* pTiaoma = static_cast<CEditUI*>(this->FindSubControl(L"shangpin_create_page_barcode_edit"));
|
|
|
std::wstring ws_tiaoma = pTiaoma->GetText();
|
|
|
m_tiaoma = CLewaimaiString::UnicodeToUTF8(ws_tiaoma);
|
|
|
|
|
|
- //商品价格
|
|
|
+ //鍟嗗搧浠锋牸
|
|
|
CEditUI* pPrice = static_cast<CEditUI*>(this->FindSubControl(L"shangpin_create_page_price_edit"));
|
|
|
std::wstring ws_price = pPrice->GetText();
|
|
|
m_price = CLewaimaiString::UnicodeToUTF8(ws_price);
|
|
|
|
|
|
- //商品单位
|
|
|
+ //鍟嗗搧鍗曚綅
|
|
|
CEditUI* pDanwei = static_cast<CEditUI*>(this->FindSubControl(L"shangpin_create_page_unit_edit"));
|
|
|
std::wstring ws_danwei = pDanwei->GetText();
|
|
|
m_danwei = CLewaimaiString::UnicodeToUTF8(ws_danwei);
|
|
|
|
|
|
- //是否称重
|
|
|
+ //鏄�惁绉伴噸
|
|
|
CCheckBoxUI* pChengzhong = static_cast<CCheckBoxUI*>(this->FindSubControl(L"shangpin_create_page_chengzhong"));
|
|
|
m_is_chengzhong = pChengzhong->IsSelected();
|
|
|
|
|
|
- //plu编码
|
|
|
+ //plu缂栫爜
|
|
|
CEditUI* pPlu = static_cast<CEditUI*>(this->FindSubControl(L"shangpin_create_page_plu"));
|
|
|
std::wstring ws_plu = pPlu->GetText();
|
|
|
m_plu = CLewaimaiString::UnicodeToUTF8(ws_plu);
|
|
|
|
|
|
- //商品编码
|
|
|
+ //鍟嗗搧缂栫爜
|
|
|
CEditUI* pShangpin = static_cast<CEditUI*>(this->FindSubControl(L"shangpin_create_page_shangpinbianma"));
|
|
|
std::wstring ws_shangpin = pShangpin->GetText();
|
|
|
m_shangpinbianma = CLewaimaiString::UnicodeToUTF8(ws_shangpin);
|
|
|
|
|
|
- //库存类型
|
|
|
+ //搴撳瓨绫诲瀷
|
|
|
CCheckBoxUI* pKucuntype = static_cast<CCheckBoxUI*>(this->FindSubControl(L"shangpin_create_page_kucun_open"));
|
|
|
if (pKucuntype->IsSelected())
|
|
|
{
|
|
|
@@ -556,12 +556,12 @@ void CShangpinUpdatePageUI::StartSave()
|
|
|
m_kucuntype = 1;
|
|
|
}
|
|
|
|
|
|
- //当前库存
|
|
|
+ //褰撳墠搴撳瓨
|
|
|
CEditUI* pDangqiankucun = static_cast<CEditUI*>(this->FindSubControl(L"shangpin_create_page_kucun_now"));
|
|
|
std::wstring ws_dangqiankucun = pDangqiankucun->GetText();
|
|
|
m_dangqiankucun = CLewaimaiString::UnicodeToUTF8(ws_dangqiankucun);
|
|
|
|
|
|
- //商品状态
|
|
|
+ //商品状态
|
|
|
CCheckBoxUI* pStatus = static_cast<CCheckBoxUI*>(this->FindSubControl(L"shangpin_create_page_status_normal"));
|
|
|
if (pStatus->IsSelected())
|
|
|
{
|
|
|
@@ -572,12 +572,12 @@ void CShangpinUpdatePageUI::StartSave()
|
|
|
m_status = 1;
|
|
|
}
|
|
|
|
|
|
- //进货价
|
|
|
+ //进货价
|
|
|
CEditUI* pJinhuojia = static_cast<CEditUI*>(this->FindSubControl(L"shangpin_create_page_buyingprice_edit"));
|
|
|
std::wstring ws_jinhuojia = pJinhuojia->GetText();
|
|
|
m_jinhuojia = CLewaimaiString::UnicodeToUTF8(ws_jinhuojia);
|
|
|
|
|
|
- //进货价模式
|
|
|
+ //进货价模式
|
|
|
CCheckBoxUI* pJinhuomoshi = static_cast<CCheckBoxUI*>(this->FindSubControl(L"shangpin_create_page_jinhuojia_normal"));
|
|
|
if (pJinhuomoshi->IsSelected())
|
|
|
{
|
|
|
@@ -588,7 +588,7 @@ void CShangpinUpdatePageUI::StartSave()
|
|
|
m_jinhuo_type = 1;
|
|
|
}
|
|
|
|
|
|
- //在哪些地方显示
|
|
|
+ //在哪些地方显示
|
|
|
CCheckBoxUI* pShouyinji = static_cast<CCheckBoxUI*>(this->FindSubControl(L"shangpin_create_page_showplace_shouyinji"));
|
|
|
CCheckBoxUI* pWaimai = static_cast<CCheckBoxUI*>(this->FindSubControl(L"shangpin_create_page_showplace_waimai"));
|
|
|
CCheckBoxUI* pSaomaidancan = static_cast<CCheckBoxUI*>(this->FindSubControl(L"shangpin_create_page_showplace_saomadiancan"));
|
|
|
@@ -597,16 +597,16 @@ void CShangpinUpdatePageUI::StartSave()
|
|
|
m_is_waimai_show = pWaimai->IsSelected();
|
|
|
m_is_saomadiancan_show = pSaomaidancan->IsSelected();
|
|
|
|
|
|
- //是否开启打包费
|
|
|
+ //鏄�惁寮€鍚�墦鍖呰垂
|
|
|
CCheckBoxUI* pDabao = static_cast<CCheckBoxUI*>(this->FindSubControl(L"shangpin_create_page_is_dabao"));
|
|
|
m_is_dabao_fei = pDabao->IsSelected();
|
|
|
|
|
|
- //打包费
|
|
|
+ //打包费
|
|
|
CEditUI* pDaobaofei = static_cast<CEditUI*>(this->FindSubControl(L"shangpin_create_page_dabao_money"));
|
|
|
std::wstring ws_dabaofei = pDaobaofei->GetText();
|
|
|
m_dabaofei = CLewaimaiString::UnicodeToUTF8(ws_dabaofei);
|
|
|
|
|
|
- //商品加工方式
|
|
|
+ //鍟嗗搧鍔犲伐鏂瑰紡
|
|
|
CCheckBoxUI* pJiagongfangshi_1 = static_cast<CCheckBoxUI*>(this->FindSubControl(L"shangpin_create_page_fangan_1"));
|
|
|
CCheckBoxUI* pJiagongfangshi_2 = static_cast<CCheckBoxUI*>(this->FindSubControl(L"shangpin_create_page_fangan_2"));
|
|
|
CCheckBoxUI* pJiagongfangshi_3 = static_cast<CCheckBoxUI*>(this->FindSubControl(L"shangpin_create_page_fangan_3"));
|
|
|
@@ -624,7 +624,7 @@ void CShangpinUpdatePageUI::StartSave()
|
|
|
m_jiagong_type = 2;
|
|
|
}
|
|
|
|
|
|
- ShowError(L"正在保存商品...");
|
|
|
+ ShowError(L"姝e湪淇濆瓨鍟嗗搧...");
|
|
|
|
|
|
std::thread(&CShangpinUpdatePageUI::HandleSave, this).detach();
|
|
|
}
|
|
|
@@ -719,7 +719,7 @@ void CShangpinUpdatePageUI::HandleSave()
|
|
|
|
|
|
params["jiagong_type"] = std::to_string(m_jiagong_type);
|
|
|
|
|
|
- //这下面是接口要求必传参数
|
|
|
+ //杩欎笅闈㈡槸鎺ュ彛瑕佹眰蹇呬紶鍙傛暟
|
|
|
params["goods_img"] = m_foodinfo.goods_img;
|
|
|
params["goods_thumb_img"] = m_foodinfo.goods_img;
|
|
|
|
|
|
@@ -733,7 +733,7 @@ void CShangpinUpdatePageUI::HandleSave()
|
|
|
|
|
|
if (ret == false)
|
|
|
{
|
|
|
- ShowError(L"请求服务器失败,请检查网络设置!");
|
|
|
+ ShowError(L"璇锋眰鏈嶅姟鍣ㄥけ璐ワ紝璇锋�鏌ョ綉缁滆�缃�紒");
|
|
|
|
|
|
return;
|
|
|
}
|
|
|
@@ -743,13 +743,13 @@ void CShangpinUpdatePageUI::HandleSave()
|
|
|
|
|
|
if (document.HasParseError())
|
|
|
{
|
|
|
- ShowError(L"服务器错误");
|
|
|
+ ShowError(L"服务器错误");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if (!document.HasMember("errcode") || !document.HasMember("errmsg"))
|
|
|
{
|
|
|
- ShowError(L"服务器错误");
|
|
|
+ ShowError(L"服务器错误");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -767,10 +767,10 @@ void CShangpinUpdatePageUI::HandleSave()
|
|
|
|
|
|
std::string id = data["goods_id"].GetString();
|
|
|
|
|
|
- //走到这里说明商品保存成功了,接着把商品的数据更新到数据库
|
|
|
+ //璧板埌杩欓噷璇存槑鍟嗗搧淇濆瓨鎴愬姛浜嗭紝鎺ョ潃鎶婂晢鍝佺殑鏁版嵁鏇存柊鍒版暟鎹�簱
|
|
|
CFoodHandle::GetInstance()->UpdateOneFood(id);
|
|
|
|
|
|
- ::PostMessage(m_pManager->GetPaintWindow(), WM_FOOD_HANDLE_SUCCESS, 0, 0);
|
|
|
+ PostMessage(m_pManager->GetPaintWindow(), WM_FOOD_HANDLE_SUCCESS, 0, 0);
|
|
|
}
|
|
|
|
|
|
void CShangpinUpdatePageUI::StartDelete()
|
|
|
@@ -790,7 +790,7 @@ void CShangpinUpdatePageUI::HandleDelete()
|
|
|
|
|
|
if (ret == false)
|
|
|
{
|
|
|
- ShowError(L"请求服务器失败,请检查网络设置!");
|
|
|
+ ShowError(L"璇锋眰鏈嶅姟鍣ㄥけ璐ワ紝璇锋�鏌ョ綉缁滆�缃�紒");
|
|
|
|
|
|
return;
|
|
|
}
|
|
|
@@ -800,13 +800,13 @@ void CShangpinUpdatePageUI::HandleDelete()
|
|
|
|
|
|
if (document.HasParseError())
|
|
|
{
|
|
|
- ShowError(L"服务器错误");
|
|
|
+ ShowError(L"服务器错误");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
if (!document.HasMember("errcode") || !document.HasMember("errmsg"))
|
|
|
{
|
|
|
- ShowError(L"服务器错误");
|
|
|
+ ShowError(L"服务器错误");
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
@@ -820,10 +820,10 @@ void CShangpinUpdatePageUI::HandleDelete()
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- //本地数据库删除这个商品
|
|
|
+ //本地数据库删除这个商品
|
|
|
CFoodHandle::GetInstance()->DeleteOndeFood(m_foodinfo.id);
|
|
|
|
|
|
- ::PostMessage(m_pManager->GetPaintWindow(), WM_FOOD_HANDLE_SUCCESS, 0, 0);
|
|
|
+ PostMessage(m_pManager->GetPaintWindow(), WM_FOOD_HANDLE_SUCCESS, 0, 0);
|
|
|
}
|
|
|
|
|
|
void CShangpinUpdatePageUI::ShowError(std::wstring msg)
|