DS7_JinGang
hanxuntao 2 years ago
parent 4ad8780a3a
commit 20064bb0b7

@ -132,6 +132,15 @@ namespace DSWeb.MvcShipping.Controllers
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
public ContentResult DeleteDetail(string GID)
{
DBResult result = MsCodeFeeTempldateAgentDAL.DeleteTemplateDetail(GID);
var jsonRespose = new JsonResponse { Success = result.Success, Message = result.Message };
return new ContentResult() { Content = JsonConvert.Serialize(jsonRespose) };
}
public ContentResult GetFeeUnit(string condition)
{
var dataList = MsCodeFeeTempldateAgentDAL.GetFeeUnit(condition);

@ -2911,6 +2911,26 @@ namespace DSWeb.MvcShipping.DAL.MsChFeeDAL
feejztondata.QUANTITY = jzton;
bodyList.Add(feejztondata);
decimal JFton = Math.Round(KGS * Convert.ToDecimal(0.0025), 3, MidpointRounding.AwayFromZero);
if (ton > CBM)
{
var feetondata = new MsFeeUnit();
feetondata.SUNIT = "PXJF-拼箱JF";
feetondata.UNIT = "拼箱JF";
feetondata.QUANTITY = JFton;
bodyList.Add(feetondata);
}
else
{
var feetondata = new MsFeeUnit();
feetondata.SUNIT = "PXJF-拼箱JF";
feetondata.UNIT = "拼箱JF";
feetondata.QUANTITY = CBM;
bodyList.Add(feetondata);
}
}
if (Convert.ToString(reader["CTNALL"]) != "")
{

@ -290,7 +290,41 @@ namespace DSWeb.MvcShipping.DAL.MsCodeFeeTemplateAgent
return result;
}
public static DBResult DeleteTemplateDetail(string GID)
{
var result = new DBResult();
Database db = DatabaseFactory.CreateDatabase();
using (var conn = db.CreateConnection())
{
conn.Open();
var tran = conn.BeginTransaction();
try
{
var cmdDelete = db.GetSqlStringCommand("delete from code_fee_template_agentdetail where GID='" + GID + "'");
db.ExecuteNonQuery(cmdDelete, tran);
tran.Commit();
}
catch (Exception)
{
tran.Rollback();
result.Success = false;
result.Message = "保存出现错误,请重试或联系系统管理员";
return result;
}
}
result.Success = true;
result.Message = "保存成功";
return result;
}
public static DBResult DeleteDetail(CodeFeeTemplateAgent headData)
{

@ -837,13 +837,45 @@ Ext.extend(Shipping.MsCodeFeeTemplateAgentEdit, Ext.Panel, {
deleteDetail: function (type) {
var selectedRecords = this.gridList.selModel.getSelection();
for (var i = 0; i < selectedRecords.length; i++) {
var rec = selectedRecords[i];
var selections = this.gridList.getSelectionModel().getSelection();
if (selections.length == 0) {
Ext.Msg.show({ title: '提示', msg: '请先选择单据!', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
return;
}
this.storeBodyList.remove(rec);
var record = selections[0];
var GID = record.data.GID;
Ext.MessageBox.confirm('提示', '确定删除该记录吗?', function (btn) {
if (btn == 'yes') {
Ext.Msg.wait('正在删除数据...');
Ext.Ajax.request({
waitMsg: '正在删除数据...',
url: '/MvcShipping/MsCodeFeeTemplateAgent/DeleteDetail',
params: {
GID: GID
},
callback: function (options, success, response) {
if (success) {
var jsonresult = Ext.JSON.decode(response.responseText);
if (jsonresult.Success) {
this.storeBodyList.remove(record);
Ext.Msg.show({ title: '提示', msg: jsonresult.Message, icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
}
else {
Ext.Msg.show({ title: '错误', msg: jsonresult.Message, icon: Ext.Msg.ERROR, buttons: Ext.Msg.OK });
}
}
},
failure: function (response, options) {
Ext.Msg.show({ title: '警告', msg: '服务器响应出错,请重试', icon: Ext.Msg.INFO, buttons: Ext.Msg.OK });
},
success: function (response, options) {
},
scope: this
}); //end Ext.Ajax.request
}
}, this);
}

Loading…
Cancel
Save