コード例 #1
0
ファイル: JobFormFactory.cs プロジェクト: huamanhtuyen/VNACCS
        public static CommonJobForm CreateNewForm(string jobCode, string kind, bool flgNew, bool flgJobTitle)
        {
            try
            {
                AbstractJobConfig config;
                CommonJobForm form = null;
                errCode = 0;
                if (kind != "")
                {
                    errCode = JobConfigFactory.createJobConfig(jobCode, kind, DateTime.Now, out config);
                }
                else
                {
                    errCode = JobConfigFactory.createJobConfig(jobCode, DateTime.Now, out config);
                }
                if (errCode >= 0)
                {
                    switch (config.jobStyle)
                    {
                        case JobStyle.normal:
                            form = new JobForm();
                            break;

                        case JobStyle.combi:
                            form = new CombiJobForm();
                            break;

                        case JobStyle.divide:
                            form = new DivideJobForm();
                            break;
                    }
                    errCode = form.CreateNewForm(jobCode, kind, flgNew, flgJobTitle);
                    if (errCode < 0)
                    {
                        return null;
                    }
                }
                return form;
            }
            catch
            {
                errCode = -99;
                return null;
            }
        }
コード例 #2
0
ファイル: JobFormFactory.cs プロジェクト: huamanhtuyen/VNACCS
        public static CommonJobForm CreateRecvForm(IData Data, bool flgJobTitle)
        {
            try
            {
                AbstractJobConfig config;
                string outCode = Data.OutCode;
                CommonJobForm form = null;
                errCode = 0;
                errCode = JobConfigFactory.createJobConfig(outCode, out config);
                if (errCode >= 0)
                {
                    switch (config.jobStyle)
                    {
                        case JobStyle.normal:
                            form = new JobForm();
                            break;

                        case JobStyle.combi:
                            form = new CombiJobForm();
                            break;

                        case JobStyle.divide:
                            form = new DivideJobForm();
                            break;
                    }
                    errCode = form.CreateRecvForm(Data, flgJobTitle);
                    if (errCode < 0)
                    {
                        return null;
                    }
                }
                return form;
            }
            catch
            {
                errCode = -99;
                return null;
            }
        }