コード例 #1
0
        private bool UIValidation()
        {
            bizMessage bizM = new bizMessage();

            if (this.lblActivityStatus.Text == "")
            {
                this.ucMessanger1.ProcessMessage("Stage of Sales / Aspire Cycle: " + bizM.GetMessageText("ValueNotSelected"), Enums.enMsgType.Err, "OpportunityStatus", typeof(DropDownList), true);
                return(false);
            }
            bizActivity biz = new bizActivity();

            if (biz.GetStatusByID(int.Parse(this.hidStatusID.Value)).OutcomeType != "C")
            {
                if (this.txtFollowUpDate.Text == "")
                {
                    this.ucMessanger1.ProcessMessage("Follow Up Date: " + bizM.GetMessageText("EmptyField"), Enums.enMsgType.Err, "FollowUpDate", typeof(TextBox), true);
                    return(false);
                }
            }
            if (this.txtFollowUpDate.Text != "")
            {
                DateTime result;
                if (DateTime.TryParse(this.txtFollowUpDate.Text, out result) == false)
                {
                    this.ucMessanger1.ProcessMessage("Follow Up Date: " + bizM.GetMessageText("FieldNotDate"), Enums.enMsgType.Err, "FollowUpDate", typeof(TextBox), true);
                    return(false);
                }
            }

            switch (this.lblActivityStatus.Text)
            {
            case "Identified":
                break;

            case "Qualified-in":
                break;

            case "Qualified-out":
                if (this.txtDateCompleted.Text == "")
                {
                    this.ucMessanger1.ProcessMessage("Date Completed: " + bizM.GetMessageText("EmptyField"), Enums.enMsgType.Err, "DateCompleted", typeof(TextBox), true);
                    return(false);
                }
                else
                {
                    DateTime res;
                    if (DateTime.TryParse(this.txtDateCompleted.Text, out res) == false)
                    {
                        this.ucMessanger1.ProcessMessage("Date Completed: " + bizM.GetMessageText("FieldNotDate"), Enums.enMsgType.Err, "DateCompleted", typeof(TextBox), true);
                        return(false);
                    }
                }
                break;

            case "Interested":
                DateTime result;
                if (this.txtOpportunityDue.Text == "")
                {
                    this.ucMessanger1.ProcessMessage("Renewal Date: " + bizM.GetMessageText("EmptyField"), Enums.enMsgType.Err, "OpportunityDue", typeof(TextBox), true);
                    return(false);
                }
                else
                {
                    if (DateTime.TryParse(this.txtOpportunityDue.Text, out result) == false)
                    {
                        this.ucMessanger1.ProcessMessage("Renewal Date: " + bizM.GetMessageText("FieldNotDate"), Enums.enMsgType.Err, "OpportunityDue", typeof(TextBox), true);
                        return(false);
                    }
                }
                if (this.ddlClassification.SelectedValue == "")
                {
                    this.ucMessanger1.ProcessMessage("CSS Segment: " + bizM.GetMessageText("ValueNotSelected"), Enums.enMsgType.Err, "Classification", typeof(DropDownList), true);
                    return(false);
                }
                break;

            case "Not Interested":
                if (this.txtDateCompleted.Text == "")
                {
                    this.ucMessanger1.ProcessMessage("Date Completed: " + bizM.GetMessageText("EmptyField"), Enums.enMsgType.Err, "DateCompleted", typeof(TextBox), true);
                    return(false);
                }
                else
                {
                    DateTime res;
                    if (DateTime.TryParse(this.txtDateCompleted.Text, out res) == false)
                    {
                        this.ucMessanger1.ProcessMessage("Date Completed: " + bizM.GetMessageText("FieldNotDate"), Enums.enMsgType.Err, "DateCompleted", typeof(TextBox), true);
                        return(false);
                    }
                }
                break;

            case "Go-to-Market":
                break;

            case "Revisit next year":
                if (this.txtDateCompleted.Text == "")
                {
                    this.ucMessanger1.ProcessMessage("Date Completed: " + bizM.GetMessageText("EmptyField"), Enums.enMsgType.Err, "DateCompleted", typeof(TextBox), true);
                    return(false);
                }
                else
                {
                    DateTime res;
                    if (DateTime.TryParse(this.txtDateCompleted.Text, out res) == false)
                    {
                        this.ucMessanger1.ProcessMessage("Date Completed: " + bizM.GetMessageText("FieldNotDate"), Enums.enMsgType.Err, "DateCompleted", typeof(TextBox), true);
                        return(false);
                    }
                }
                break;

            case "Quoted":
                if (this.txtNetBrokerageQuoted.Text == "")
                {
                    this.ucMessanger1.ProcessMessage("Expected OAMPS income Quoted: " + bizM.GetMessageText("EmptyField"), Enums.enMsgType.Err, "NetBrokerageQuoted", typeof(TextBox), true);
                    return(false);
                }
                else
                {
                    decimal res;
                    if (Decimal.TryParse(this.txtNetBrokerageQuoted.Text, out res) == false)
                    {
                        this.ucMessanger1.ProcessMessage("Expected OAMPS income Quoted: " + bizM.GetMessageText("FieldNotDecimal"), Enums.enMsgType.Err, "NetBrokerageQuoted", typeof(TextBox), true);
                        return(false);
                    }
                }
                break;

            case "Can't Place":
                if (this.txtDateCompleted.Text == "")
                {
                    this.ucMessanger1.ProcessMessage("Date Completed: " + bizM.GetMessageText("EmptyField"), Enums.enMsgType.Err, "DateCompleted", typeof(TextBox), true);
                    return(false);
                }
                else
                {
                    DateTime res;
                    if (DateTime.TryParse(this.txtDateCompleted.Text, out res) == false)
                    {
                        this.ucMessanger1.ProcessMessage("Date Completed: " + bizM.GetMessageText("FieldNotDate"), Enums.enMsgType.Err, "DateCompleted", typeof(TextBox), true);
                        return(false);
                    }
                }
                break;

            case "Accepted":
                if (this.txtNetBrokerageActual.Text == "")
                {
                    this.ucMessanger1.ProcessMessage("Expected OAMPS income Actual: " + bizM.GetMessageText("EmptyField"), Enums.enMsgType.Err, "NetBrokerageActual", typeof(TextBox), true);
                    return(false);
                }
                else
                {
                    decimal res;
                    if (Decimal.TryParse(this.txtNetBrokerageActual.Text, out res) == false)
                    {
                        this.ucMessanger1.ProcessMessage("Expected OAMPS income Actual: " + bizM.GetMessageText("FieldNotDecimal"), Enums.enMsgType.Err, "NetBrokerageActual", typeof(TextBox), true);
                        return(false);
                    }
                }
                break;

            case "Lost":
                if (this.txtDateCompleted.Text == "")
                {
                    this.ucMessanger1.ProcessMessage("Date Completed: " + bizM.GetMessageText("EmptyField"), Enums.enMsgType.Err, "DateCompleted", typeof(TextBox), true);
                    return(false);
                }
                else
                {
                    DateTime res;
                    if (DateTime.TryParse(this.txtDateCompleted.Text, out res) == false)
                    {
                        this.ucMessanger1.ProcessMessage("Date Completed: " + bizM.GetMessageText("FieldNotDate"), Enums.enMsgType.Err, "DateCompleted", typeof(TextBox), true);
                        return(false);
                    }
                }
                break;

            case "Processed":
                if (this.txtDateCompleted.Text == "")
                {
                    this.ucMessanger1.ProcessMessage("Date Completed: " + bizM.GetMessageText("EmptyField"), Enums.enMsgType.Err, "DateCompleted", typeof(TextBox), true);
                    return(false);
                }
                else
                {
                    DateTime res;
                    if (DateTime.TryParse(this.txtDateCompleted.Text, out res) == false)
                    {
                        this.ucMessanger1.ProcessMessage("Date Completed: " + bizM.GetMessageText("FieldNotDate"), Enums.enMsgType.Err, "DateCompleted", typeof(TextBox), true);
                        return(false);
                    }
                }
                if (this.txtMemoNumber.Text == "")
                {
                    this.ucMessanger1.ProcessMessage("Memo Number: " + bizM.GetMessageText("EmptyField"), Enums.enMsgType.Err, "MemoNumber", typeof(TextBox), true);
                    return(false);
                }
                if (this.txtClientCode.Text == "")
                {
                    this.ucMessanger1.ProcessMessage("Client Code: " + bizM.GetMessageText("EmptyField"), Enums.enMsgType.Err, "ClientCode", typeof(TextBox), true);
                    return(false);
                }
                break;

            default:     // all pending statuses
                break;
            }
            return(true);
        }