Esempio n. 1
0
        protected override void Execute(CodeActivityContext context)
        {
            usecarapplyform Applyinfo = new usecarapplyform();
            Applyinfo.ApplyUserName = request.Get(context).ApplyUserName;
            Applyinfo.usecartype = new YunShanOA.BusinessLogic.UseCar.UseTypeManager().GetUsecarType(request.Get(context).usecartypeID);
            Applyinfo.WFID = context.WorkflowInstanceId;

            List<YunShanOA.Model.UseCarModel.usecaranduser> results = new List<usecaranduser>();
            foreach (usecaranduser user in request.Get(context).Usecaranduser)
            {
                usecaranduser usecaranduser = new usecaranduser();
                usecaranduser.Name = user.Name;
                usecaranduser.Email = user.Email;
                results.Add(usecaranduser);
            }
            Applyinfo.Usecaranduser = results;
            Applyinfo.BeginTime = request.Get(context).BeginTime;
            Applyinfo.EndTime = request.Get(context).EndTime;
            Applyinfo.StartDestination = request.Get(context).StartDestination;
            Applyinfo.EndDestination = request.Get(context).EndDestination;
            Applyinfo.ApplyStatus = 2;
            Applyinfo.ApplyReason = request.Get(context).ApplyReason;
            Applyinfo.Comment = request.Get(context).Comment;
            BusinessLogic.UseCar.UsecarApplyformManager ApplyformManager = new UsecarApplyformManager();
            int i = ApplyformManager.Sava(Applyinfo);
            List<usecaranduser> s = new List<usecaranduser>();
            s = new YunShanOA.BusinessLogic.UseCar.UsecarAndUserManager().GetCarAndUserlistByFormID(Applyinfo.UseCarApplyFormID);
            Applyinfo.Usecaranduser = s;
            Applyinfo.UseCarApplyFormID = i;
            Apply.Set(context, Applyinfo);
            // 获取 Text 输入参数的运行时值
        }
 public List<Model.UseCarModel.usecarapplyform> GetGetusecarapplyfromList()
 {
     var result = from UseCarApplyForms in db.UseCarApplyForm select UseCarApplyForms;
     List<usecarapplyform> mylist = new List<usecarapplyform>();
     foreach (var t in result)
     {
         usecarapplyform usecarapplyform = new usecarapplyform();
         usecarapplyform = FillRecord(t);
         mylist.Add(usecarapplyform);
     }
     return mylist;
 }
Esempio n. 3
0
 // 如果活动返回值,则从 CodeActivity<TResult>
 // 派生并从 Execute 方法返回该值。
 protected override void Execute(CodeActivityContext context)
 {
     ArrangeDrawOutFrom From = UpdateApplyInfo.Get(context);
     YunShanOA.BusinessLogic.UseCar.CarManager Manager = new BusinessLogic.UseCar.CarManager();
     foreach (string id in From.CarIDList)
     {
         car car = Manager.GetCarByid(int.Parse(id));
         car.Status = 1;
         Manager.Save(car);
     }
     YunShanOA.Model.UseCarModel.usecarapplyform f = new usecarapplyform();
     YunShanOA.BusinessLogic.UseCar.UsecarApplyformManager m = new BusinessLogic.UseCar.UsecarApplyformManager();
     f = m.GetusecarapplyformById(int.Parse(From.UseCarInfromID));
     f.ApplyStatus = 4;
     m.Sava(f);
 }
 private Model.UseCarModel.usecarapplyform FillRecord(UseCarApplyForm i)
 {
     usecarapplyform result = null;
     if (i != null)
     {
         result = new usecarapplyform();
         result.UseCarApplyFormID = i.UseCarApplyFormID;
         result.ApplyUserName = i.ApplyUserName;
         result.usecartype = new YunShanOA.DataAccess.UseCar.UsecarTypeHelp().GetUsecarType(i.UseCarTypeID);
         result.WFID = i.WFID;
         result.BeginTime = i.BeginTime;
         result.EndTime = i.EndTime;
         result.StartDestination = i.StartDestination;
         result.EndDestination = i.EndDestination;
         result.ApplyReason = i.ApplyReason;
         result.ApplyStatus = i.ApplyStatus;
         result.Comment = i.Comment;
         result.Usecaranduser = new YunShanOA.DataAccess.UseCar.UsecarAndUserHelp().GetCarAndUserlistByFormID(i.UseCarApplyFormID);
     }
     return result;
 }