|
|
|
@ -888,7 +888,7 @@ namespace DSWeb.Areas.Account.DAL.Chfee_bankdata
|
|
|
|
|
public static DBResult DelBankDataDetail(List<ChBankdata> body)
|
|
|
|
|
{
|
|
|
|
|
var result = new DBResult();
|
|
|
|
|
|
|
|
|
|
result.Success = true;
|
|
|
|
|
|
|
|
|
|
Database db = DatabaseFactory.CreateDatabase();
|
|
|
|
|
using (var conn = db.CreateConnection())
|
|
|
|
@ -904,18 +904,83 @@ namespace DSWeb.Areas.Account.DAL.Chfee_bankdata
|
|
|
|
|
|
|
|
|
|
foreach (var bill in body)
|
|
|
|
|
{
|
|
|
|
|
cmdDelete.Parameters.Clear();
|
|
|
|
|
db.AddInParameter(cmdDelete, "@GID", DbType.String, bill.GID);
|
|
|
|
|
db.ExecuteNonQuery(cmdDelete, tran);
|
|
|
|
|
if (bill.TRANSTYPE == "往账")
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrEmpty(bill.STLBILLNO)) {
|
|
|
|
|
var dataList = ChsettlementDAL.GetDataListAll("cm.BILLNO='"+bill.STLBILLNO+"'");
|
|
|
|
|
if (dataList != null && dataList != null) {
|
|
|
|
|
foreach (var stl in dataList) {
|
|
|
|
|
if (!string.IsNullOrEmpty(stl.VOUCHERNO))
|
|
|
|
|
{
|
|
|
|
|
result.Success = false;
|
|
|
|
|
result.Message = "已生成凭证无法取消";
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
var PaydataList = ChsettlementDAL.GetPayDetailList(stl.BILLNO);
|
|
|
|
|
result = ChsettlementDAL.DelAppStl(PaydataList, stl.BILLNO);
|
|
|
|
|
if (result.Success)
|
|
|
|
|
{
|
|
|
|
|
var modb = new ModelObjectDB();
|
|
|
|
|
result = modb.Delete(stl);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
cmdupdate.Parameters.Clear();
|
|
|
|
|
db.AddInParameter(cmdupdate, "@GID", DbType.String, bill.GID);
|
|
|
|
|
db.ExecuteNonQuery(cmdupdate, tran);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(bill.STLBILLNO))
|
|
|
|
|
{
|
|
|
|
|
var dataList = ChsettlementDAL.GetDataListAll("cm.BILLNO='" + bill.STLBILLNO + "'");
|
|
|
|
|
if (dataList != null && dataList != null)
|
|
|
|
|
{
|
|
|
|
|
foreach (var stl in dataList)
|
|
|
|
|
{
|
|
|
|
|
if (!string.IsNullOrEmpty(stl.VOUCHERNO))
|
|
|
|
|
{
|
|
|
|
|
result.Success = false;
|
|
|
|
|
result.Message = "已生成凭证无法取消";
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
var PaydataList = ChsettlementDAL.GetRecvInvDetailList(stl.BILLNO);
|
|
|
|
|
result = ChsettlementDAL.DelRecvInvAppStl(PaydataList, stl.BILLNO);
|
|
|
|
|
if (result.Success)
|
|
|
|
|
{
|
|
|
|
|
var modb = new ModelObjectDB();
|
|
|
|
|
result = modb.Delete(stl);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (result.Success)
|
|
|
|
|
{
|
|
|
|
|
cmdDelete.Parameters.Clear();
|
|
|
|
|
db.AddInParameter(cmdDelete, "@GID", DbType.String, bill.GID);
|
|
|
|
|
db.ExecuteNonQuery(cmdDelete, tran);
|
|
|
|
|
|
|
|
|
|
cmdupdate.Parameters.Clear();
|
|
|
|
|
db.AddInParameter(cmdupdate, "@GID", DbType.String, bill.GID);
|
|
|
|
|
db.ExecuteNonQuery(cmdupdate, tran);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
result = new DBResult();
|
|
|
|
|
result.Success = true;
|
|
|
|
|
result.Message = "撤销匹配成功";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tran.Commit();
|
|
|
|
|
}
|
|
|
|
@ -930,8 +995,6 @@ namespace DSWeb.Areas.Account.DAL.Chfee_bankdata
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
result.Success = true;
|
|
|
|
|
result.Message = "撤销匹配成功";
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|