Example #1
0
            public void CalculateBalance_having_both_Incoming_and_Outgoing_Invoices()
            {
                var generator = new Mock <IJobOrderNumberGenerator>();

                generator
                .Setup(o => o.Generate())
                .Returns("101/1989");

                var eventStore = new Mock <IEventStore>();

                var jobOrderId        = Guid.NewGuid();
                var outgoingInvoiceId = Guid.NewGuid();

                eventStore
                .Setup(o => o.Find(It.IsAny <Func <OutgoingInvoiceLinkedToJobOrderEvent, bool> >()))
                .Returns(new OutgoingInvoiceLinkedToJobOrderEvent[] { new OutgoingInvoiceLinkedToJobOrderEvent(outgoingInvoiceId, jobOrderId, DateTime.Now, 200) });
                eventStore
                .Setup(o => o.Find(It.IsAny <Func <OutgoingInvoiceIssuedEvent, bool> >()))
                .Returns(new OutgoingInvoiceIssuedEvent[] { new OutgoingInvoiceIssuedEvent(outgoingInvoiceId, "42", DateTime.Now, 200, 44, 244, "fake", "fake", "", Guid.NewGuid(), "", "", "", "", "", "", "") });

                var incomingInvoiceId = Guid.NewGuid();

                eventStore
                .Setup(o => o.Find(It.IsAny <Func <IncomingInvoiceLinkedToJobOrderEvent, bool> >()))
                .Returns(new IncomingInvoiceLinkedToJobOrderEvent[] { new IncomingInvoiceLinkedToJobOrderEvent(incomingInvoiceId, jobOrderId, DateTime.Now, 100) });
                eventStore
                .Setup(o => o.Find(It.IsAny <Func <IncomingInvoiceRegisteredEvent, bool> >()))
                .Returns(new IncomingInvoiceRegisteredEvent[] { new IncomingInvoiceRegisteredEvent(incomingInvoiceId, "42", DateTime.Now, 100, 22, 122, "fake", "fake", "", Guid.NewGuid(), "", "", "", "", "", "", "") });


                decimal balance  = JobOrder.CalculateBalance(eventStore.Object, jobOrderId);
                decimal expected = 100;

                Assert.AreEqual(expected, balance);
            }
Example #2
0
        public static JobOrder RetrieveOne(int id)
        {
            SqlConnection conn = DB.DbReadOnlyConnect();

            conn.Open();

            string     queryString = "SELECT * FROM CRM_JobOrders WHERE id = @id";
            SqlCommand getJob      = new SqlCommand(queryString, conn);

            getJob.Parameters.AddWithValue("id", id);
            SqlDataReader jobsReader = getJob.ExecuteReader();

            JobOrder m_Job = new JobOrder();

            if (jobsReader.Read())
            {
                m_Job.Id             = jobsReader.GetInt32(0);
                m_Job.DateAquired    = jobsReader.GetDateTime(1);
                m_Job.CompanyId      = jobsReader.GetInt32(2);
                m_Job.PositionTitle  = jobsReader.GetString(3);
                m_Job.Salary         = jobsReader.GetInt32(4);
                m_Job.Education      = jobsReader.GetString(5);
                m_Job.RecruitmentFee = jobsReader.GetInt32(6);
                //m_Job.DatePlaced = jobsReader.GetDateTime(7);
                m_Job.KeyWords     = jobsReader.GetString(9);
                m_Job.Requirements = jobsReader.GetString(10);
                m_Job.Duties       = jobsReader.GetString(11);
                m_Job.ContactId    = jobsReader.GetInt32(12);
                m_Job.ContactType  = jobsReader.GetString(13);
            }

            conn.Close();

            return(m_Job);
        }
 public int saveJobOrder(MODEL.JobOrderModel model)
 {
     try
     {
         using (_context = new HSSNInventoryEntities())
         {
             var data = new JobOrder()
             {
                 JobOrderNumber = model.JobOrderNumber,
                 JobOrderId     = model.JobOrderId,
                 JobOrderDate   = model.JobOrderDate,
                 DealerId       = model.DealerId,
                 Description    = model.Description,
                 PreparedBy     = model.PreparedBy,
                 IsApproved     = model.IsApproved,
                 ApprovedBy     = model.ApprovedBy,
                 ModifiedBy     = model.ModifiedBy,
                 ModifiedDate   = model.ModifiedDate,
             };
             _context.Entry(data).State = EntityState.Added;
             _context.SaveChanges();
             return(data.JobOrderId);
         }
     }
     catch (Exception exception)
     {
         Console.WriteLine(exception);
         throw;
     }
 }
Example #4
0
        public static void UpdateJobOrder(JobOrder m_JobOrder)
        {
            SqlConnection conn = DB.DbWriteOnlyConnect();

            conn.Open();

            string     queryString = "UPDATE CRM_JobOrders SET dateAquired = @dateAquired, companyId = @companyId, positionTitle = @positionTitle, salary = @salary, education = @education, recruitmentFee = @recruitmentFee, keywords = @keywords, requirements = @requirements, duties = @duties, contactId = @contactId, contactType = @contactType WHERE id = @id";
            SqlCommand updJob      = new SqlCommand(queryString, conn);

            updJob.Parameters.AddWithValue("dateAquired", m_JobOrder.DateAquired);
            updJob.Parameters.AddWithValue("companyId", m_JobOrder.CompanyId);
            updJob.Parameters.AddWithValue("positionTitle", m_JobOrder.PositionTitle);
            updJob.Parameters.AddWithValue("salary", m_JobOrder.Salary);
            updJob.Parameters.AddWithValue("education", m_JobOrder.Education);
            updJob.Parameters.AddWithValue("recruitmentFee", m_JobOrder.RecruitmentFee);
            updJob.Parameters.AddWithValue("keywords", m_JobOrder.KeyWords);
            updJob.Parameters.AddWithValue("requirements", m_JobOrder.Requirements);
            updJob.Parameters.AddWithValue("duties", m_JobOrder.Duties);
            updJob.Parameters.AddWithValue("contactId", m_JobOrder.ContactId);
            updJob.Parameters.AddWithValue("contactType", m_JobOrder.ContactType);
            updJob.Parameters.AddWithValue("id", m_JobOrder.Id);

            updJob.ExecuteNonQuery();

            conn.Close();
        }
Example #5
0
        public static void AddJobOrder(JobOrder m_JobOrder)
        {
            SqlConnection conn = DB.DbWriteOnlyConnect();

            conn.Open();

            string     queryString = "INSERT INTO CRM_JobOrders(dateAquired, companyId, positionTitle, salary, education, recruitmentFee, displayOnWebsite, keywords, requirements, duties, contactId, contactType) VALUES(@dateAquired, @companyId, @positionTitle, @salary, @education, @recruitmentFee, @displayOnWebsite, @keywords, @requirements, @duties, @contactId, @contactType)";
            SqlCommand insJob      = new SqlCommand(queryString, conn);

            insJob.Parameters.AddWithValue("dateAquired", m_JobOrder.DateAquired.ToString("yyyy-MM-dd"));
            insJob.Parameters.AddWithValue("companyId", m_JobOrder.CompanyId);
            insJob.Parameters.AddWithValue("positionTitle", m_JobOrder.PositionTitle);
            insJob.Parameters.AddWithValue("salary", m_JobOrder.Salary);
            insJob.Parameters.AddWithValue("education", m_JobOrder.Education);
            insJob.Parameters.AddWithValue("recruitmentFee", m_JobOrder.RecruitmentFee);
            insJob.Parameters.AddWithValue("displayOnWebSite", m_JobOrder.DisplayOnWebsite);
            insJob.Parameters.AddWithValue("keywords", m_JobOrder.KeyWords);
            insJob.Parameters.AddWithValue("requirements", m_JobOrder.Requirements);
            insJob.Parameters.AddWithValue("duties", m_JobOrder.Duties);
            insJob.Parameters.AddWithValue("contactId", m_JobOrder.ContactId);
            insJob.Parameters.AddWithValue("contactType", m_JobOrder.ContactType);

            insJob.ExecuteNonQuery();

            conn.Close();
        }
        public void MultipleJobsShouldReturnThoseJobs()
        {
            var sequence = "abc";
            var jobList  = "a => \nb => \nc => ";

            Assert.That(JobOrder.OrderJobs(jobList), Is.EqualTo(sequence));
        }
        public void MultipleJobsTwoDependancies()
        {
            var sequence = "afcb";
            var jobList  = "a => \nb => c \nc => f \nf => ";

            Assert.That(JobOrder.OrderJobs(jobList), Is.EqualTo(sequence));
        }
        public async Task Handle(JobOrderRegisteredEvent message)
        {
            var jobOrder = new JobOrder();

            jobOrder.OriginalId         = message.JobOrderId;
            jobOrder.CustomerId         = message.CustomerId;
            jobOrder.CustomerName       = message.CustomerName;
            jobOrder.Description        = message.Description;
            jobOrder.ManagerId          = message.ManagerId;
            jobOrder.DateOfRegistration = message.DateOfRegistration;
            jobOrder.DateOfStart        = message.DateOfStart;
            jobOrder.DueDate            = message.DueDate;
            jobOrder.Name                = message.JobOrderName;
            jobOrder.Number              = message.JobOrderNumber;
            jobOrder.Price               = message.Price;
            jobOrder.Currency            = message.Currency;
            jobOrder.PurchaseOrderNumber = message.PurchaseOrderNumber;
            jobOrder.IsCompleted         = false;
            jobOrder.IsTimeAndMaterial   = false;

            using (var db = new AccountancyContext())
            {
                db.JobOrders.Add(jobOrder);
                try
                {
                    await db.SaveChangesAsync();
                }
                catch (Exception ex)
                {
                    System.Threading.Thread.Sleep(1);
                }
            }
        }
Example #9
0
        public void FormDaftarJobOrder_Load(object sender, EventArgs e)
        {
            this.Location = new Point(0, 0);
            comboBoxCari.DropDownStyle = ComboBoxStyle.DropDownList;

            FormatDataGrid();

            string hasilBaca = JobOrder.BacaData("", "", listHasilData);

            if (hasilBaca == "1")
            {
                dataGridViewJobOrder.Rows.Clear();

                for (int i = 0; i < listHasilData.Count; i++)
                {
                    string directLabor = listHasilData[i].DirectLabor.ToString("RP 0,###");
                    string directMat   = listHasilData[i].DirectMaterial.ToString("RP 0,###");
                    string over        = listHasilData[i].OverheadProduksi.ToString("RP 0,###");
                    dataGridViewJobOrder.Rows.Add(listHasilData[i].KodeJobOrder, listHasilData[i].NotaPenjualan.NoNotaPenjualan,
                                                  listHasilData[i].Barang.Nama, listHasilData[i].Quantity, listHasilData[i].Barang.Satuan,
                                                  directLabor, directMat, over, listHasilData[i].TglMulai.ToString("dddd, dd MMMM yyyy"),
                                                  listHasilData[i].TglSelesai.ToString("dddd, dd MMMM yyyy"), listHasilData[i].Status);
                }
            }
        }
Example #10
0
        private async Task RunMarked(JobOrder jo, Func <JobOrder, Task <JobResult> > jobToRun)
        {
            if (jo.Started.HasValue)
            {
                return;
            }

            jo.Started = DateTime.Now;
            jo.Result  = null;
            var path = $"{ROOTKEY}/{_conn.AgentID}/{SUBKEY}/{OBSERVABLE}";
            var desc = $"Executing “{jo.Command}”";
            await _conn.UpdateNode(jo, path);

            //await _stateUpdatr.SetRunningTask(_agentId, desc);

            try
            {
                jo.Result = await jobToRun(jo);
            }
            catch (Exception ex)
            {
                jo.Result = JobResult.Fail(desc, ex);
            }

            await _conn.UpdateNode(jo, path);
        }
Example #11
0
        public static Offer RetrieveOne(int id)
        {
            SqlConnection conn = DB.DbReadOnlyConnect();

            conn.Open();

            string     queryString = "SELECT * FROM CRM_Offers WHERE id = @id";
            SqlCommand getOffer    = new SqlCommand(queryString, conn);

            getOffer.Parameters.AddWithValue("id", id);
            SqlDataReader offerReader = getOffer.ExecuteReader();

            Offer m_Offer = new Offer();

            if (offerReader.Read())
            {
                m_Offer.Id          = offerReader.GetInt32(0);
                m_Offer.OfferDate   = offerReader.GetDateTime(1);
                m_Offer.JobId       = offerReader.GetInt32(2);
                m_Offer.OfferText   = offerReader.GetString(3);
                m_Offer.Accepted    = offerReader.GetByte(4);
                m_Offer.StartDate   = offerReader.GetDateTime(5);
                m_Offer.CandidateId = offerReader.GetInt32(6);

                Candidate m_Cand = DBCandidate.RetrieveOne(m_Offer.CandidateId);
                m_Offer.CandidateName = m_Cand.LastName + ", " + m_Cand.FirstName;

                JobOrder m_Job = DBJobOrder.RetrieveOne(m_Offer.JobId);
                m_Offer.JobName = m_Job.PositionTitle;
            }

            conn.Close();

            return(m_Offer);
        }
        public ActionResult AddJobOrder()
        {
            ViewBag.CompanyId = new SelectList(CompanyRepository.RetrieveAll(), "Id", "Name");
            JobOrder m_JobOrder = new JobOrder();

            return(View("AddJobOrder", m_JobOrder));
        }
Example #13
0
        public static List <Resume> GetResumesSent(int id)
        {
            SqlConnection conn = DB.DbReadOnlyConnect();

            conn.Open();

            string     queryString    = "SELECT * FROM CRM_ResumesSent WHERE candidateId = @id ORDER BY sentDate DESC";
            SqlCommand getResumesSent = new SqlCommand(queryString, conn);

            getResumesSent.Parameters.AddWithValue("id", id);
            SqlDataReader resumeReader = getResumesSent.ExecuteReader();

            List <Resume> m_Resumes = new List <Resume>();

            while (resumeReader.Read())
            {
                Resume m_Resume = new Resume();

                m_Resume.Id          = resumeReader.GetInt32(0);
                m_Resume.CandidateId = resumeReader.GetInt32(1);
                m_Resume.JobId       = resumeReader.GetInt32(2);
                m_Resume.DateSent    = resumeReader.GetDateTime(3);

                JobOrder m_Job = DBJobOrder.RetrieveOne(m_Resume.JobId);
                m_Resume.JobName = m_Job.PositionTitle;

                m_Resumes.Add(m_Resume);
            }

            conn.Close();

            return(m_Resumes);
        }
Example #14
0
        public static List <Interview> GetInterviews(int id)
        {
            SqlConnection conn = DB.DbReadOnlyConnect();

            conn.Open();

            string     queryString   = "SELECT * FROM CRM_CandidateInterviews WHERE candidateId = @id ORDER BY interviewDate DESC";
            SqlCommand getInterviews = new SqlCommand(queryString, conn);

            getInterviews.Parameters.AddWithValue("id", id);
            SqlDataReader interviewReader = getInterviews.ExecuteReader();

            List <Interview> m_Interviews = new List <Interview>();

            while (interviewReader.Read())
            {
                Interview m_Interview = new Interview();
                m_Interview.Id            = interviewReader.GetInt32(0);
                m_Interview.InterviewDate = interviewReader.GetDateTime(1);
                m_Interview.JobId         = interviewReader.GetInt32(2);
                m_Interview.CandidateId   = interviewReader.GetInt32(3);
                m_Interview.InterviewType = interviewReader.GetString(4);

                JobOrder m_Job = DBJobOrder.RetrieveOne(m_Interview.JobId);
                m_Interview.JobName = m_Job.PositionTitle;

                m_Interviews.Add(m_Interview);
            }

            conn.Close();

            return(m_Interviews);
        }
        public void MultipleJobs()
        {
            var sequence = "adfcbe";
            var jobList  = "a => \nb => c \nc => f \nd => a \ne => b \nf => ";

            Assert.That(JobOrder.OrderJobs(jobList), Is.EqualTo(sequence));
        }
        public async Task <ActionResult <JobOrder> > PutJobOrder(int id, JobOrder jobOrders)
        {
            if (id != jobOrders.Id)
            {
                return(BadRequest());
            }
            _context.Entry(jobOrders).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!JobOrderExists(id))
                {
                    return(Ok(new { StatusCode = StatusCodes.Status200OK, Message = "No Records Found." }));
                }
                else
                {
                    throw;
                }
            }

            return(Ok(new { StatusCode = StatusCodes.Status200OK, result = jobOrders }));
        }
Example #17
0
        public static Interview RetrieveOne(int id)
        {
            SqlConnection conn = DB.DbReadOnlyConnect();

            conn.Open();

            string     queryString = "SELECT * FROM CRM_CandidateInterviews WHERE id = @id";
            SqlCommand getInt      = new SqlCommand(queryString, conn);

            getInt.Parameters.AddWithValue("id", id);
            SqlDataReader intReader = getInt.ExecuteReader();

            Interview m_Interview = new Interview();

            if (intReader.Read())
            {
                m_Interview.Id            = intReader.GetInt32(0);
                m_Interview.InterviewDate = intReader.GetDateTime(1);
                m_Interview.JobId         = intReader.GetInt32(2);
                m_Interview.CandidateId   = intReader.GetInt32(3);
                m_Interview.InterviewType = intReader.GetString(4);

                JobOrder m_JobOrder = DBJobOrder.RetrieveOne(m_Interview.JobId);
                m_Interview.JobName = m_JobOrder.PositionTitle;

                Candidate m_Candidate = DBCandidate.RetrieveOne(m_Interview.CandidateId);
                m_Interview.CandidateName = m_Candidate.LastName + ", " + m_Candidate.FirstName;
            }

            conn.Close();

            return(m_Interview);
        }
        public async Task <ActionResult <JobOrder> > PostJobOrder(JobOrder jobOrder)
        {
            _context.JobOrder.Add(jobOrder);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetJobOrder", new { id = jobOrder.Id }, jobOrder));
        }
        public void MultipleJobsSingleDependancy()
        {
            var sequence = "acb";
            var jobList  = "a => \nb => c \nc => ";

            Assert.That(JobOrder.OrderJobs(jobList), Is.EqualTo(sequence));
        }
        public void StringAShouldReturnSingleJobB()
        {
            var sequence = "b";
            var jobList  = "b => ";

            Assert.That(JobOrder.OrderJobs(jobList), Is.EqualTo(sequence));
        }
Example #21
0
        public static void Initialize(UserContext context, UserManager <User> userManager)
        {
            context.Database.EnsureCreated();

            // Look for any students.
            if (context.Users.Any())
            {
                return;   // DB has been seeded
            }

            var students = new User[]
            {
                new User {
                    Name = "Tapio", UserName = "******", Address = "Osoite", BillingAddress = "Osoite", PhoneNumber = "12345", Email = "*****@*****.**", Password = "******"
                },
                new User {
                    Name = "Tapio2", UserName = "******", Address = "Osoite2", BillingAddress = "Osoite2", PhoneNumber = "12345", Email = "*****@*****.**", Password = "******"
                }
            };

            foreach (User s in students)
            {
                var result = userManager.CreateAsync(s, s.Password).Result;
            }
            var orders = new JobOrder[]
            {
                new JobOrder {
                    Orderer        = "Tapio", AcceptedOrderDate = DateTime.Parse("2018-05-01"), OrderDate = DateTime.Parse("2017-12-22"),
                    JobDescription = "Fix bathroom", JobComment = "Easy job", ReadyDate = DateTime.Parse("2018-05-10"), ToolsComment = "Hammer",
                    HoursOnJob     = 250, StartDate = DateTime.Parse("2018-05-02"), Status = Status.READY
                },
                new JobOrder {
                    Orderer        = "Tapio", AcceptedOrderDate = DateTime.Parse("2018-05-01"), OrderDate = DateTime.Parse("2017-12-22"),
                    JobDescription = "Fix kitchen", JobComment = "Hard job", ReadyDate = DateTime.Parse("2018-05-10"), ToolsComment = "Drill",
                    HoursOnJob     = 250, StartDate = DateTime.Parse("2018-05-02"), Status = Status.READY
                },
                new JobOrder {
                    Orderer        = "Tapio2", StartDate = DateTime.Parse("1999-12-12"), ReadyDate = DateTime.Parse("2000-05-09"), RejectedOrderDate = DateTime.Parse("2018-05-01"), OrderDate = DateTime.Parse("2017-12-22"),
                    JobDescription = "Mow lawn", JobComment = "no lawn",
                    Status         = Status.REJECTED
                },
                new JobOrder {
                    Orderer        = "Tapio2", StartDate = DateTime.Parse("2000-02-02"), ReadyDate = DateTime.Parse("2018-05-01"), OrderDate = DateTime.Parse("2017-12-22"),
                    JobDescription = "Mow lawn", JobComment = "no lawn",
                    Status         = Status.READY
                },
                new JobOrder {
                    Orderer        = "Tapio", StartDate = DateTime.Parse("2000-02-02"), ReadyDate = DateTime.Parse("2018-05-01"), OrderDate = DateTime.Parse("2017-12-22"),
                    JobDescription = "Mow lawn", JobComment = "no lawn",
                    Status         = Status.READY
                }
            };

            foreach (JobOrder j in orders)
            {
                context.JobOrders.Add(j);
            }
            context.SaveChanges();
        }
        public ActionResult SendResume(int id)
        {
            ViewBag.JobId      = id;
            ViewBag.Candidates = CandidateRepository.RetrieveAll();
            JobOrder m_Job = JobOrderRepository.RetrieveOne(id);

            return(View("SendResume", m_Job));
        }
Example #23
0
        public ActionResult JobOrderList(JobOrder model)
        {
            var list = ctx.JobOrders;

            return(View(new GridModel <JobOrder> {
                Data = list
            }));
        }
        public ActionResult EditJobOrder(int id)
        {
            JobOrder m_JobOrder = JobOrderRepository.RetrieveOne(id);

            ViewBag.CompanyId = new SelectList(CompanyRepository.RetrieveAll(), "Id", "Name", m_JobOrder.CompanyId);
            ViewBag.Contacts  = CompanyRepository.GetContacts(m_JobOrder.CompanyId);

            return(View("EditJobOrder", m_JobOrder));
        }
Example #25
0
        public JobOrder GetJobOrder()
        {
            JobOrder order = (JobOrder)Session["JobOrder"];

            if (order == null)
            {
                order = new JobOrder();
                Session["JobOrder"] = order;
            }
            return(order);
        }
        public ActionResult DisplayJobOrder(int id)
        {
            JobOrder m_JobOrder = JobOrderRepository.RetrieveOne(id);

            ViewBag.Company     = CompanyRepository.RetrieveOne(m_JobOrder.CompanyId);
            ViewBag.ResumesSent = JobOrderRepository.ResumesSent(id);
            ViewBag.Notes       = JobOrderRepository.GetNotes(id);
            ViewBag.Interviews  = JobOrderRepository.GetInterviews(id);
            ViewBag.Offers      = OfferRepository.RetrieveAllJob(id);

            return(View("DisplayJobOrder", m_JobOrder));
        }
Example #27
0
        private void FormTambahSuratPermintaan_Load(object sender, EventArgs e)
        {
            this.Location = new Point(500, 26);
            FormatDataGrid();
            pPeriode = Periode.GetPeriodeTerbaru();
            textBoxKode.MaxLength  = 5;
            textBoxNoSurat.Enabled = false;

            comboBoxKodeJobOrder.DropDownStyle = ComboBoxStyle.DropDownList;

            string noSuratBaru;
            string hasilGenerate = SuratPermintaan.GenerateNoSuratPermintaan(out noSuratBaru);

            textBoxNoSurat.Clear();
            if (hasilGenerate == "1")
            {
                textBoxNoSurat.Text = noSuratBaru;
            }
            else
            {
                MessageBox.Show("Gagal melakukan generate code. Pesan kesalahan: " + hasilGenerate);
            }

            dateTimePickerTgl.Value   = DateTime.Now;
            dateTimePickerTgl.Enabled = false;

            string hasilBaca = JobOrder.BacaData("J.status", "P", listHasilJob);

            if (hasilBaca == "1")
            {
                comboBoxKodeJobOrder.Items.Clear();
                for (int i = 0; i < listHasilJob.Count; i++)
                {
                    comboBoxKodeJobOrder.Items.Add(listHasilJob[i].KodeJobOrder);
                }
            }
            else
            {
                comboBoxKodeJobOrder.Items.Clear();
            }

            if (comboBoxKodeJobOrder.Items.Count != 0)
            {
                comboBoxKodeJobOrder.SelectedIndex = 0;
            }

            FormUtama form = (FormUtama)this.Owner.MdiParent;

            labelKodePgw.Text = form.labelKodePgw.Text;
            labelNamaPgw.Text = form.labelNamaPgw.Text;
        }
        public async Task <IActionResult> Create([Bind("ID,Orderer,JobDescription")] JobOrder jobOrder)
        {
            if (ModelState.IsValid)
            {
                jobOrder.OrderDate = DateTime.Today;
                jobOrder.Orderer   = User.Identity.Name;
                jobOrder.Status    = Status.ORDERED;
                _context.Add(jobOrder);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View("Index", jobOrder));
        }
Example #29
0
        public static ExecuteResponse GetExecuteResponse(IHttpContextAccessor accessor, IMemoryCache cache, IServiceProvider serviceProvider, string uid)
        {
            var job = WpsJob.Load(accessor, cache, serviceProvider, uid, false);

            if (job == null)
            {
                var response = JobOrder.ReadExecuteResponse(uid);
                if (response == null)
                {
                    throw new EntryPointNotFoundException();
                }
                return(response);
            }
            return(job.GetExecuteResponse());
        }
Example #30
0
        private void buttonSimpan_Click(object sender, EventArgs e)
        {
            FormUtama frmUtama             = (FormUtama)this.Owner.MdiParent;
            FormDaftarSuratPermintaan form = (FormDaftarSuratPermintaan)this.Owner;
            //buat objek bertipe job order
            JobOrder job = new JobOrder();

            job.KodeJobOrder = comboBoxKodeJobOrder.Text;


            //buat object bertipe suratpermintaan
            string          no      = textBoxNoSurat.Text;
            string          ket     = textBoxKeterangan.Text;
            DateTime        tanggal = dateTimePickerTgl.Value;
            SuratPermintaan surat   = new SuratPermintaan(no, ket, tanggal, job);

            //data barang diperoleh dari data gridview
            for (int i = 0; i < dataGridViewSurat.Rows.Count; i++)
            {
                //buat object bertipe barang
                Barang barang = new Barang();
                //tambahkan kode, nama, jenis, satuan
                //hati hati dalam menambahkan
                barang.KodeBarang = dataGridViewSurat.Rows[i].Cells["KodeBarang"].Value.ToString();
                barang.Nama       = dataGridViewSurat.Rows[i].Cells["NamaBarang"].Value.ToString();
                barang.Jenis      = dataGridViewSurat.Rows[i].Cells["jenis"].Value.ToString();
                barang.Satuan     = dataGridViewSurat.Rows[i].Cells["satuan"].Value.ToString();
                //simpan  data harga dan jumlah
                int jumlah = int.Parse(dataGridViewSurat.Rows[i].Cells["Jumlah"].Value.ToString());
                //buat object dan tambahkan
                DetilSuratPermintaan detilSurat = new DetilSuratPermintaan(barang, jumlah);
                //simpan detil barang ke nota
                surat.TambahDetilBarang(barang, jumlah);
            }

            string hasilTambahSurat = SuratPermintaan.TambahData(surat);

            if (hasilTambahSurat == "1")
            {
                MessageBox.Show("berhasil tambah surat permintaan, barang akan diterima setelah menambahkan surat jalan");
                this.Close();
                form.FormDaftarSuratPermintaan_Load(sender, e);     //supaya formdaftar surat menampilkan daftar terbaru
            }
            else
            {
                MessageBox.Show("Data nota jual gagal tersimpan. Pesan kesalahan : " + hasilTambahSurat, "Kesalahan");
            }
        }
Example #31
0
 public JobAttribute(JobOrder order)
 {
     _order = order;
 }
Example #32
0
        private void StartUpload(FileStatus a)
        {
            a.UploadStartTime = DateTime.Now;
            Aspera.Transfer.Environment.setFaspScpPath("C:\\AsperaTest\\Aspera\\ascp.exe");
            /*
             * Set the local management port to be used by Fasp manager.
             * If not set, Fasp Manager will pick a random port and use it.
             * It is best to not set this port.
             */
            Aspera.Transfer.Environment.setManagementPort(54002);
            FaspManager manager = FaspManager.getInstance();
            MyListener myListener = new MyListener();

            /* Uncomment the following two lines to receive
             * notifications about transfers not initiated by fasp manager
             */
            manager.listenForServerSessions(true);
            manager.addListener(myListener);
            LocalFileLocation uploadSource = new LocalFileLocation();
            uploadSource.addPath(a.FilePath);
            RemoteFileLocation uploadDestination = new RemoteFileLocation("hack2.aspera.us", "xfer", "aspera");
            uploadDestination.addPath(".");
            XferParams uploadXferParams = getDefaultXferParams();
            JobOrder uploadOrder = new JobOrder(uploadSource, uploadDestination, uploadXferParams);
            String uploadJobId = manager.startTransfer(uploadOrder, myListener);
            a.IsUploaded = true;
        }
 public void AddToJobOrders(JobOrder jobOrder)
 {
     base.AddObject("JobOrders", jobOrder);
 }
 public static JobOrder CreateJobOrder(long jobOrderID, decimal jobQuantity, decimal chargesInINR, global::System.DateTime requiredDate, bool isIssued, bool isWaitingForApproval, bool hasApproved, bool failedQuantityIssued, int supplierID, long gRNReciptID, byte jobOrderTypeID)
 {
     JobOrder jobOrder = new JobOrder();
     jobOrder.JobOrderID = jobOrderID;
     jobOrder.JobQuantity = jobQuantity;
     jobOrder.ChargesInINR = chargesInINR;
     jobOrder.RequiredDate = requiredDate;
     jobOrder.IsIssued = isIssued;
     jobOrder.IsWaitingForApproval = isWaitingForApproval;
     jobOrder.HasApproved = hasApproved;
     jobOrder.FailedQuantityIssued = failedQuantityIssued;
     jobOrder.SupplierID = supplierID;
     jobOrder.GRNReciptID = gRNReciptID;
     jobOrder.JobOrderTypeID = jobOrderTypeID;
     return jobOrder;
 }