Пример #1
0
        public static void RunArrangeReturnCar(Guid id, RenewForm 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(id);
            application1.ResumeBookmark("WaitForRenewCarExamine", form);
            instanceUnloaded.WaitOne();
            Console.ReadLine();
        }
Пример #2
0
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     RenewForm form = new RenewForm();
     form.IsRenew = false;
     UseCarWorkFlowProcess.RunArrangeReturnCar(Guid.Parse(this.txtWFID.Text.ToString()), form);
     gvDateBind();
     this.lbMsg.Text = "提交成功";
     this.btnSubmit.Visible = false;
 }
Пример #3
0
        protected override void Execute(CodeActivityContext context)
        {
            YunShanOA.BusinessLogic.UseCar.UsecarApplyformManager ApplyformManager = new BusinessLogic.UseCar.UsecarApplyformManager();
            usecarapplyform myform = UpdateApplyInfo.Get(context);

            myform.EndTime     = RenewForm.Get(context).RenewCarTime;
            myform.ApplyStatus = 6;
            ApplyformManager.Sava(myform);
            OUTApplyForm.Set(context, myform);
        }
Пример #4
0
 protected void btnSubmit_Click(object sender, EventArgs e)
 {
     RenewForm renewform = new RenewForm();
     renewform.ApplyFormID = int.Parse(txtID.Text.ToString());
     renewform.IsRenew = true;
     renewform.RenewCarTime = DateTime.Parse(this.txtEndTime.Text.ToString());
     gvDateBind();
     this.lbMsg.Text = "提交成功";
     this.btnSubmit.Visible = false;
     UseCarWorkFlowProcess.RunArrangeReturnCar(Guid.Parse(this.txtWFID.Text.ToString()),renewform);
 }
Пример #5
0
 public static void RunArrangeReturnCar(Guid id, RenewForm 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(id);
     application1.ResumeBookmark("WaitForRenewCarExamine", form);
     instanceUnloaded.WaitOne();
     Console.ReadLine();
 }