Example #1
0
        private void CreateExtra()
        {
            Entities.Extra extra = new Orchestrator.Entities.Extra();


            if (m_orderId > 0)
            {
                extra.OrderID = m_orderId;
            }

            extra.ExtraType     = (eExtraType)Enum.Parse(typeof(eExtraType), cboExtraType.SelectedValue.Replace(" ", ""));
            extra.ExtraState    = (eExtraState)Enum.Parse(typeof(eExtraState), cboExtraState.SelectedValue.Replace(" ", ""));
            extra.ClientContact = txtClientContact.Text;
            extra.ExtraAmount   = decimal.Parse(txtAmount.Text, System.Globalization.NumberStyles.Currency);
            extra.OrderID       = int.Parse(cboClient.SelectedValue);

            //if (extra.ExtraType == eExtraType.Demurrage)
            //{
            //    extra.DemurrageComments = txtDemurrageComments.Text;
            //    extra.InstructionId = m_instructionId;
            //}

            //if (extra.ExtraType == eExtraType.Custom)
            extra.CustomDescription = txtCustomDescription.Text;

            string userId = ((Entities.CustomPrincipal)Page.User).UserName;

            Facade.IJobExtra facExtra = new Facade.Job();
            int extraId = facExtra.AddExtra(extra, userId);

            if (extraId > 0)
            {
                this.ReturnValue = bool.TrueString;
                this.Close("AddExtra");
            }
            else
            {
                lblError.Text    = "There was a problem trying to Add this extra.";
                pnlError.Visible = true;
            }
        }