public static void RunArrangeDrawOutFrom(ArrangeDrawOutFrom form)
        {
            SqlWorkflowInstanceStore instanceStore = new SqlWorkflowInstanceStore(@"server=.\SQLEXPRESS;database=aspnetdb;uid=sa;pwd=123456");
            WorkflowApplication      application1  = new WorkflowApplication(new UseCarApply());

            application1.InstanceStore = instanceStore;
            application1.Completed     = (workflowApplicationCompletedEventArgs) =>
            {
                Console.WriteLine("\nWorkflowApplication has Completed in the {0} state.", workflowApplicationCompletedEventArgs.CompletionState);
            };
            application1.PersistableIdle = (e) =>
            {
                instanceUnloaded.Set();
                return(PersistableIdleAction.Unload);
            };
            application1.Unloaded = (workflowApplicationEventArgs) =>
            {
                Console.WriteLine("WorkflowApplication has Unloaded\n");
                instanceUnloaded.Set();
            };
            application1.Load(form.WFID);
            application1.ResumeBookmark("WaitArrangeDrawOut", form);
            instanceUnloaded.WaitOne();
            Console.ReadLine();
        }
Beispiel #2
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 = 2;
                Manager.Save(car);
            }
        }
Beispiel #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);
        }
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     ArrangeDrawOutFrom From = new ArrangeDrawOutFrom();
     From.Msg = this.txtMessage.Text.ToString();
     From.UseCarInfromID = this.lblApplyUseCarFromID.Text.ToString();
     From.WFID = Guid.Parse(this.txtWFID.Text.ToString());
     CollectSelected();
     List<string> carsID = new List<string>();
     foreach (object tmp in this.SelectedItems)
     {
         carsID.Add(tmp.ToString());
     }
     From.CarIDList = carsID;
     UseCarWorkFlowProcess.RunArrangeDrawOutFrom(From);
     this.lbMsg.Text = "安排成功,将以邮件的形式通知各位司机和用车人员";
     this.btnSubmit.Visible = false;
     BindGridView(int.Parse(Session["UseCarTypeID"].ToString ()), 2);
     gvDateBind();
     Session["UseCarTypeID"] = null;
 }
 public static void RunArrangeDrawOutFrom(ArrangeDrawOutFrom form)
 {
     SqlWorkflowInstanceStore instanceStore = new SqlWorkflowInstanceStore(@"server=.\SQLEXPRESS;database=aspnetdb;uid=sa;pwd=123456");
     WorkflowApplication application1 = new WorkflowApplication(new UseCarApply());
     application1.InstanceStore = instanceStore;
     application1.Completed = (workflowApplicationCompletedEventArgs) =>
     {
         Console.WriteLine("\nWorkflowApplication has Completed in the {0} state.", workflowApplicationCompletedEventArgs.CompletionState);
     };
     application1.PersistableIdle = (e) =>
     {
         instanceUnloaded.Set();
         return PersistableIdleAction.Unload;
     };
     application1.Unloaded = (workflowApplicationEventArgs) =>
     {
         Console.WriteLine("WorkflowApplication has Unloaded\n");
         instanceUnloaded.Set();
     };
     application1.Load(form.WFID);
     application1.ResumeBookmark("WaitArrangeDrawOut", form);
     instanceUnloaded.WaitOne();
     Console.ReadLine();
 }