Esempio n. 1
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                var         status = cmbStatus.Text;
                OrderStatus orderStatus;
                //if ((status.ToUpper().Contains("OK") || status.ToUpper().Contains("REJECT")) )
                //{
                if (status.ToUpper().Contains("OK"))
                {
                    orderStatus = OrderStatus.Approved;
                }
                else if (status.ToUpper().Contains("REJECT"))
                {
                    orderStatus = OrderStatus.Rejected;
                }
                else if (status.ToUpper().Contains("SKIP"))
                {
                    orderStatus = OrderStatus.Skip;
                }
                else
                {
                    MessageBox.Show("Please select valid status");
                    return;
                }


                var saveStatus = new CustomerOrderRepository().ApproveRejectOrder(_orderID, orderStatus, txtReason.Text);
                if (saveStatus)
                {
                    MessageBox.Show("Status updated successfully.");
                    if (inspDashboard != null)
                    {
                        inspDashboard.LoadGridData();
                        new ScreensRepository().UpdateScreenReload(3, true);
                    }
                    if (dashboard != null)
                    {
                        dashboard.LoadGridData();
                    }
                    this.Close();
                }
                else
                {
                    MessageBox.Show("Error while updating status, please contact administrator.");
                }

                //}
                //else {
                //    MessageBox.Show("Please select valid status");
                //}
            }
            catch (Exception ex) {
                LogException(ex);
            }
        }
        public void SetPrintStatus()
        {
            //new CustomerOrderRepository
            if (_orderId > 0)
            {
                new CustomerOrderRepository().ChangePrintStatus(_orderId);

                if (parentForm != null)
                {
                    parentForm.LoadGridData();
                }
                new ScreensRepository().UpdateScreenReload(4, true);
            }
            //var barcode = "select * from tbl"

            //frmBarcodePrinting barcodePrint = new frmBarcodePrinting(Barcode);
            //barcodePrint.ShowDialog();
            this.Close();
        }
 private void frmOrderUpload_FormClosed(object sender, FormClosedEventArgs e)
 {
     masterForm.LoadGridData();
 }