コード例 #1
0
        public override void Update()
        {
            try
            {
                if (!CheckIfJobTypeIsNewSetupAndQATaskIsEntered())
                {
                    throw new Exception("You haven't entered a QA tasks for this job, sorry you cannot change job status to Proof");
                }

                SQLDBCommand dbc        = new SQLDBCommand(SQLDBCommand.TransactionType.WithoutTransaction);
                string       jobSQL     = string.Empty;
                string       jobCommand = string.Empty;

                jobCommand = string.Format(SQLCommands.UpdateJob, CurrentJob.CustomerId, CurrentJob.JobDescription.Replace("'", "''"), CurrentJob.DocketNo, CurrentJob.LotNo, CurrentJob.LodgementDate, CurrentJob.CampaignManagerId,
                                           CurrentJob.ProgrammerId, CurrentJob.DocketReceivedDate, CurrentJob.NoOfRecords, CurrentJob.NoOfFiles, CurrentJob.IsSOARequired, CurrentJob.IsPresortRequired, CurrentJob.IsAddressCleansingRequired,
                                           CurrentJob.IsTitleCasingRequired, 5, CurrentJob.JobTypeId, CurrentJob.IsEDM, CurrentJob.IsLabel, CurrentJob.JobNotes.Replace("'", "''"), CurrentJob.JobId);

                dbc.ExecuteCommand(jobCommand);

                // Add Job Log
                string activity = "Job Updated to PROOF  - " + DateTime.Now.ToString();
                dbc.ExecuteCommand(string.Format(SQLCommands.InsertJobLog, CurrentJob.JobId, activity));
                dbc.CloseConnection();
                dbc.CloseConnection();

                JobTaskData jobTaskdata = new JobTaskData();
                jobTaskdata.UpdateJobTasks(CurrentJob.JobTasks);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
コード例 #2
0
        public override void Update()
        {
            try
            {
                if (!CheckIfAnyUndeletedTasksExists())
                {
                    throw new Exception("You haven't entered any tasks, sorry you cannot close this job");
                }
                if (!CheckIfJobTypeIsNewSetupAndQATaskIsEntered())
                {
                    throw new Exception("For 'DM-New setup' jobs You need to enter a QA entry, sorry you cannot close this job");
                }

                SQLDBCommand dbc = new SQLDBCommand(SQLDBCommand.TransactionType.WithoutTransaction);
                // string jobSQL = string.Empty;
                string jobCommand = string.Empty;

                //jobSQL = "UPDATE Job SET CustomerId={0},JobDescription='{1}',DocketNo='{2}',LotNo='{3}',LodgementDate='{4}',CampaignManagerId={5},ProgrammerId={6}," +
                //"DocketReceivedDate='{7}',NoOfRecords={8},NoOfFiles={9},IsSOARequired={10},IsPresortRequired={11},IsAddressCleansingRequired={12},IsTitleCasingRequired={13}," +
                //"JobStatusId={14}, JobTypeId={15}, JobCompletedDate='{16}',IsEDM={17},IsLabel={18},JobNotes='{19}' WHERE JobId = {20}";

                jobCommand = string.Format(SQLCommands.CompleteJob, CurrentJob.CustomerId, CurrentJob.JobDescription.Replace("'", "''"), CurrentJob.DocketNo, CurrentJob.LotNo, CurrentJob.LodgementDate, CurrentJob.CampaignManagerId,
                                           CurrentJob.ProgrammerId, CurrentJob.DocketReceivedDate, CurrentJob.NoOfRecords, CurrentJob.NoOfFiles, CurrentJob.IsSOARequired, CurrentJob.IsPresortRequired, CurrentJob.IsAddressCleansingRequired,
                                           CurrentJob.IsTitleCasingRequired, CurrentJob.JobStatusId, CurrentJob.JobTypeId, DateTime.Now, CurrentJob.IsEDM, CurrentJob.IsLabel, CurrentJob.JobNotes.Replace("'", "''"), CurrentJob.JobId);

                dbc.ExecuteCommand(jobCommand);

                // Add Job Log
                string activity = "Job Completed - " + DateTime.Now.ToString();
                dbc.ExecuteCommand(string.Format(SQLCommands.InsertJobLog, CurrentJob.JobId, activity));
                dbc.CloseConnection();

                dbc.CloseConnection();

                JobTaskData jobTaskdata = new JobTaskData();
                jobTaskdata.UpdateJobTasks(CurrentJob.JobTasks);
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
コード例 #3
0
        public Job GetOneJob(int JobId)
        {
            string       strSQL = string.Format(SQLCommands.SingleJob, JobId);
            DataTable    dt;
            SQLDBCommand dbc = new SQLDBCommand(SQLDBCommand.TransactionType.WithoutTransaction);

            dt = dbc.GetDataTable(strSQL);
            dbc.CloseConnection();
            DataRow dr = dt.Rows[0];

            Job job = new Job();

            job.JobId                      = (int)dr["JobId"];
            job.JobTypeId                  = (int)dr["JobTypeId"];
            job.DocketNo                   = dr["DocketNo"].ToString();
            job.LotNo                      = dr["LotNo"].ToString();
            job.JobDescription             = dr["JobDescription"].ToString();
            job.JobNotes                   = dr["JobNotes"].ToString();
            job.LodgementDate              = (DateTime)dr["LodgementDate"];
            job.DocketReceivedDate         = (DateTime)dr["DocketReceivedDate"];
            job.CustomerId                 = (int)dr["CustomerId"];
            job.JobCreatedDate             = (DateTime)dr["JobCreatedDate"];
            job.NoOfRecords                = (int)dr["NoOfrecords"];
            job.NoOfFiles                  = (int)dr["NoOfFiles"];
            job.CampaignManagerId          = (int)dr["CampaignManagerId"];
            job.ProgrammerId               = (int)dr["ProgrammerId"];
            job.JobStatusId                = (int)dr["JobStatusId"];
            job.IsAddressCleansingRequired = (bool)dr["IsAddressCleansingRequired"];
            job.IsPresortRequired          = (bool)dr["IsPresortRequired"];
            job.IsSOARequired              = (bool)dr["IsSOARequired"];
            job.IsTitleCasingRequired      = (bool)dr["IsTitleCasingRequired"];
            job.IsEDM                      = (bool)dr["IsEDM"];
            job.IsLabel                    = (bool)dr["IsLabel"];

            dbc.CloseConnection();
            JobTaskData jtd = new JobTaskData();

            job.JobTasks = jtd.GetJobTaskDT(JobId);
            return(job);
        }
コード例 #4
0
        //    CurrentJob = job;
        //}

        public override void Update()
        {
            SQLDBCommand dbc        = new SQLDBCommand(SQLDBCommand.TransactionType.WithoutTransaction);
            string       jobSQL     = string.Empty;
            string       jobCommand = string.Empty;

            jobCommand = string.Format(SQLCommands.UpdateJob, CurrentJob.CustomerId, CurrentJob.JobDescription.Replace("'", "''"), CurrentJob.DocketNo, CurrentJob.LotNo, CurrentJob.LodgementDate, CurrentJob.CampaignManagerId,
                                       CurrentJob.ProgrammerId, CurrentJob.DocketReceivedDate, CurrentJob.NoOfRecords, CurrentJob.NoOfFiles, CurrentJob.IsSOARequired, CurrentJob.IsPresortRequired, CurrentJob.IsAddressCleansingRequired,
                                       CurrentJob.IsTitleCasingRequired, 1, CurrentJob.JobTypeId, CurrentJob.IsEDM, CurrentJob.IsLabel, CurrentJob.JobNotes.Replace("'", "''"), CurrentJob.JobId);

            dbc.ExecuteCommand(jobCommand);

            // Add Job Log
            string activity = "Job Updated to IN PROGRESS  - " + DateTime.Now.ToString();

            dbc.ExecuteCommand(string.Format(SQLCommands.InsertJobLog, CurrentJob.JobId, activity));
            dbc.CloseConnection();

            JobTaskData jobTaskdata = new JobTaskData();

            jobTaskdata.UpdateJobTasks(CurrentJob.JobTasks);
        }