예제 #1
0
        public void Add(Cl_CourseOrder model)
        {
            var tmp = _courseOrderDB.GetList(string.Format("Cl_CourseOrder.UserId = {0} and Cl_CourseOrder.CourseId = {1}", model.UserId, model.CourseId)).FirstOrDefault();

            if (tmp == null)
            {
                _courseOrderDB.Add(model);
            }
            else
            {
                tmp.PassStatus      = 2;
                tmp.OrderStatus     = model.OrderStatus;
                tmp.LeaveTime       = model.LeaveTime;
                tmp.OrderTime       = model.OrderTime;
                tmp.OrderEndTime    = model.OrderEndTime;
                tmp.IsAppoint       = model.IsAppoint;
                tmp.IsLeave         = 0;
                tmp.Reson           = "";
                tmp.ApprovalFlag    = 0;
                tmp.ApprovalMemo    = "";
                tmp.ApprovalUser    = "";
                tmp.CourseName      = model.CourseName;
                tmp.CourseStartTime = model.CourseStartTime;
                tmp.CourseEndTime   = model.CourseEndTime;
                tmp.FtriggerFlag    = model.FtriggerFlag;
                tmp.DropType        = 0;
                tmp.DropReason      = "";
                _courseOrderDB.Update(tmp);
            }
        }