/// <summary> /// 新增退库信息 /// </summary> /// <param name="model">实体</param> /// <returns></returns> public bool AddNew(Models.ys_RefundOrder model) { AddDicByOrder(model); foreach (Models.ys_RefundOrderDetail d in model.Detail) { KeyValuePair <SqlParameter[], string> item = StatusChangeSerivce.AddNew("退库", model.RefundNo, d.AssetsId, model.OperatorId.ToString(), model.OperatorName, model.RefundUserId.ToString(), model.RefundUserName); sqlDic.Add(item.Key, item.Value); AddDicByOrderDetail(d); AddDicByUpdateAssets(d.AssetsId); } return(Models.SqlHelper.ExecuteTransaction1(sqlDic, false) > 0 ? true :false); }
/// <summary> /// 订单信息 /// </summary> /// <param name="model">明细实体</param> private void AddDicByOrder(Models.ys_RefundOrder model) { string sqlText = @"INSERT INTO [AssetsSys].[dbo].[ys_RefundOrder] ([Id] ,[RefundNo] ,[Refundday] ,[RefundUserId] ,[OperatorId] ,[Description] ,[IsAudit] ,[IsRemoved] ,[CreateTime]) VALUES (@Id ,@RefundNo ,@Refundday ,@RefundUserId ,@OperatorId ,@Description ,@IsAudit ,@IsRemoved ,@CreateTime)"; SqlParameter s1 = new SqlParameter("@Id", model.Id); SqlParameter s2 = new SqlParameter("@RefundNo", model.RefundNo); SqlParameter s3 = new SqlParameter("@Refundday", model.Refundday); SqlParameter s4 = new SqlParameter("@OperatorId", model.OperatorId); SqlParameter s6 = new SqlParameter("@RefundUserId", model.RefundUserId); SqlParameter s8 = new SqlParameter("@Description", model.Description); SqlParameter s9 = new SqlParameter("@IsAudit", model.IsAudit); SqlParameter s10 = new SqlParameter("@CreateTime", model.CreateTime); SqlParameter s11 = new SqlParameter("@IsRemoved", model.IsRemoved); SqlParameter[] cmdPara = new SqlParameter[] { s1, s2, s3, s4, s6, s8, s9, s10, s11 }; sqlDic.Add(cmdPara, sqlText); }
/// <summary> /// 新增领用信息 /// </summary> /// <param name="model">实体</param> /// <returns></returns> public bool AddNew(Models.ys_RefundOrder model) { return(sev.AddNew(model)); }