예제 #1
0
        /// <summary>
        /// 新增承运单位结算明细数据
        /// </summary>
        /// <param name="data"></param>
        /// <param name="nOpStaffId"></param>
        /// <param name="strOpStaffName"></param>
        /// <param name="strErrText"></param>
        /// <returns></returns>
        public bool InsertCarrierTransportChargesSettlementDetail(CarrierTransportChargesSettlementDetail data, long nOpStaffId, string strOpStaffName, out string strErrText)
        {
            //创建存储过程参数
            SqlParameter[] Params =
                {
                    MakeParam(CARRIERTRANSPORTCHARGESSETTLEMENTID_PARAM, SqlDbType.BigInt, 8, ParameterDirection.Input, (object)data.CarrierTransportChargesSettlementId),
                    MakeParam(DELIVERBILLID_PARAM, SqlDbType.BigInt, 8, ParameterDirection.Input, (object)data.DeliverBillId),
                    MakeParam(TRANSPORTCHARGES_PARAM, SqlDbType.Decimal, 13, ParameterDirection.Input, (object)data.TransportCharges),
                    MakeParam(OPSTAFFID_PARAM, SqlDbType.BigInt, 8, ParameterDirection.Input, (object)nOpStaffId),
                    MakeParam(OPSTAFFNAME_PARAM, SqlDbType.NVarChar, 50, ParameterDirection.Input, (object)strOpStaffName),
                };

            if (Execute("InsertCarrierTransportChargesSettlementDetail", Params, out strErrText) >= 0)
                return true;
            else
                return false;
        }
예제 #2
0
        public ActionResult NewCarrierTransportChargesSettlement(CarrierTransportChargesSettlementViewModel model)
        {
            if (ModelState.IsValid)
            {
                //创建数据
                CarrierTransportChargesSettlement data = new CarrierTransportChargesSettlement();
                data.CarrierId = model.CarrierId;
                data.CarrierName = model.CarrierName;
                data.SettlementAmount = model.SettlementAmount;
                data.WithholdAmount = model.WithholdAmount;
                data.FactpaymentAmount = model.FactpaymentAmount;
                data.Remark = model.Remark;

                List<CarrierTransportChargesSettlementDetail> listDetail = new List<CarrierTransportChargesSettlementDetail>();
                foreach (CarrierTransportChargesSettlementDetailViewModel m in model.Details)
                {
                    CarrierTransportChargesSettlementDetail d = new CarrierTransportChargesSettlementDetail();
                    d.CarrierTransportChargesSettlementId = m.CarrierTransportChargesSettlementId;
                    d.DeliverBillId = m.DeliverBillId;
                    d.TransportCharges = m.TransportCharges;
                    listDetail.Add(d);
                }

                //保存数据
                string strErrText;
                SettlementSystem settlement = new SettlementSystem();
                if (settlement.InsertCarrierTransportChargesSettlement(data, listDetail, LoginAccountId, LoginStaffName, out strErrText) > 0)
                {
                    return Json(string.Empty);
                }
                else
                {
                    return Json(strErrText);
                }
            }
            return View(model);
        }