Change is constant - 变化时唯一的永恒

添加判断

JS

function MerchantConfigWindow_Config_Order_TaxAdd() {
GridPanelSave.setDisabled(false);
var TaxMerchantIDName = Ext.getCmp('MerchantIDName').getValue();
var TaxTaxCountry = Ext.getCmp('TaxCountry').getValue();
var TaxTaxState = Ext.getCmp('TaxState').getValue();
var TaxEffectiveDate = Ext.getCmp('TaxEffectiveDate').getValue();
var TaxTaxTaxCode = Ext.getCmp('TaxTaxCode').getValue();
Ecom.JudgeConfig_Order_TaxAdd(TaxMerchantIDName, TaxTaxCountry, TaxTaxState,TaxEffectiveDate,TaxTaxTaxCode);
}

------------------------------------------------------------------------------------------------------------------------------------------

var _id = 0
function Config_Order_TaxJS() {
MerchantConfigWindow_Config_Order_Tax.hide();
var MerchantIDName = Ext.getCmp('MerchantIDName').getValue();
var TaxCountry = Ext.getCmp('TaxCountry').getValue();
var TaxState = Ext.getCmp('TaxState').getValue();
var TaxZipCode = Ext.getCmp('TaxZipCode').getValue();
var TaxEffectiveDate = Ext.getCmp('TaxEffectiveDate').getValue();
var TaxTaxName = Ext.getCmp('TaxTaxName').getValue();
var TaxTaxCode = Ext.getCmp('TaxTaxCode').getValue();
var TaxTaxRate = Ext.getCmp('TaxTaxRate').getValue();
Config_Order_TaxDetail.insertRecord(0, { ID: _id--, MerchantID: MerchantIDName, Country: TaxCountry, State: TaxState, ZipCode: TaxZipCode, EffectiveDate: TaxEffectiveDate, TaxName: TaxTaxName, TaxCode: TaxTaxCode, TaxRate: TaxTaxRate });
}

 

后台

/// <summary>
/// Config_Order_Tax添加字段判断
/// </summary>
/// <param name="id"></param>
[DirectMethod(Namespace = "Ecom")]
public void JudgeConfig_Order_TaxAdd(string TaxMerchantIDName, string TaxTaxCountry, string TaxTaxState,DateTime TaxEffectiveDate, string TaxTaxTaxCode)
{
List<IDataParameter> pList = new List<IDataParameter>();
pList.Add(DataProvider.Instance().NewParameter("@Table", DbType.String, 400, "Tax"));
pList.Add(DataProvider.Instance().NewParameter("@FieldOne", DbType.String, 400, TaxMerchantIDName));
pList.Add(DataProvider.Instance().NewParameter("@FieldTwo", DbType.String, 400, TaxTaxCountry));
pList.Add(DataProvider.Instance().NewParameter("@FieldThree", DbType.String, 400, TaxTaxState));
pList.Add(DataProvider.Instance().NewParameter("@FieldFour", DbType.String, 400, TaxEffectiveDate));
pList.Add(DataProvider.Instance().NewParameter("@FieldFive", DbType.String, 400, TaxTaxTaxCode));
DataSet ds = DataProvider.Instance().ExecProcedure("R_Merchant_InsertWithJudge", pList);
string ReturnMes = ds.Tables[0].Rows[0][0].ToString();
if (ReturnMes == "0")
{
X.Msg.Show(new MessageBoxConfig
{
Title = "",
Message = "Data already exists!",
Icon = Ext.Net.MessageBox.Icon.INFO,
Buttons = Ext.Net.MessageBox.Button.OK
});
return;
}
else if (ReturnMes == "1")
{
X.Js.AddScript("Config_Order_TaxJS();");
}
}

 

posted @ 2016-03-21 13:47  人海灬  阅读(169)  评论(0编辑  收藏  举报