Esempio n. 1
0
        private string GenNewPlots(string workId, string plots)
        {
            List <WorkControlEntity> workControls = new List <WorkControlEntity>();

            using (var db = new RepositoryBase())
            {
                workControls = db.IQueryable <WorkControlEntity>(m => m.WorkId == workId).ToList();
            }
            int    i   = plots.IndexOf(MARKCHAR);
            int    j   = 0;
            string str = plots.Substring(i + MARKCHAR.Length, plots.Length - (i + MARKCHAR.Length));

            j = str.IndexOf(MARKCHAR);
            while (i >= 0 && j > 0)
            {
                string            templetst   = plots.Substring(i, j + (MARKCHAR.Length * 2));
                string            newtemps    = templetst.Substring(1, templetst.Length - (MARKCHAR.Length * 2));
                WorkControlEntity workControl = workControls.Find(m => m.FullName == newtemps);
                if (workControl != null)
                {
                    plots = plots.Replace(templetst, workControl.Value);
                }
                i = plots.IndexOf(MARKCHAR);
                if (i < 0)
                {
                    break;
                }
                str = plots.Substring(i + MARKCHAR.Length, plots.Length - (i + MARKCHAR.Length));
                j   = str.IndexOf(MARKCHAR);
            }
            return(plots);
        }
Esempio n. 2
0
        public bool Start(SystemForm systemForm, string key, Dictionary <string, string> prarms)
        {
            bool bResult = false;

            try
            {
                List <WorkControlEntity> controls = new List <WorkControlEntity>();
                if (prarms != null && prarms.Count > 0)
                {
                    WorkControlEntity workControlEntity = new WorkControlEntity();
                    foreach (var item in prarms)
                    {
                        workControlEntity          = new WorkControlEntity();
                        workControlEntity.FullName = item.Key;
                        workControlEntity.Value    = item.Value;
                        controls.Add(workControlEntity);
                    }
                }
                FlowEntity flowEntity = flowApp.GetForm(systemForm);
                workApp.StartApply(flowEntity?.Id, key, controls);
                bResult = true;
            }
            catch
            {
                bResult = false;
            }
            return(bResult);
        }