Beispiel #1
0
        public int NewProcessOrderFlow(ProcessOrderFlow processOrderFlow, IEnumerable <int> orderColorDetailNo)
        {
            var sqlCmd = @"INSERT INTO ProcessOrderFlow
                           OUTPUT  inserted.OrderDetailNo
                           VALUES 
                           (@OrderNo,@FactoryID);";

            SqlParameter[] parameter = new SqlParameter[]
            {
                new SqlParameter("@OrderNo", SqlDbType.Int)
                {
                    Value = processOrderFlow.OrderNo
                },
                new SqlParameter("@FactoryID", SqlDbType.Int)
                {
                    Value = processOrderFlow.FactoryID
                }
            };
            var orderDetailNo = DapperHelper.Query <int>(AppSettingConfig.ConnectionString(), CommandType.Text, sqlCmd, parameter);


            var cmd        = @"INSERT INTO ProcessOrderFlowDate
                        VALUES(@OrderColorDetailNo,@OrderDetailNo,null,null,GETDATE());";
            var parameters =
                orderColorDetailNo.Select(s => new { OrderColorDetailNo = s, OrderDetailNo = orderDetailNo, });
            var count = DapperHelper.Execute(AppSettingConfig.ConnectionString(), CommandType.Text, cmd, parameters);

            return(count);
        }
Beispiel #2
0
        /// <summary>
        /// 新增加工訂單流程
        /// </summary>
        /// <param name="list"></param>
        /// <param name="orderColorDetailNo"></param>
        /// <returns></returns>
        public int NewProcessOrderFlow(ProcessOrderFlow processOrderFlow, IEnumerable <int> orderColorDetailNo)
        {
            int rsult = ProcessOrderAdapter.NewProcessOrderFlow(processOrderFlow, orderColorDetailNo);

            return(rsult);
        }