コード例 #1
0
    protected void validateInputs(out bool result)
    {
        result = true;
        RadComboBox RadBusinessUnit = (RadComboBox)BUFilter1.FindControl("RadBusinessUnit");

        if (!string.IsNullOrEmpty(RadBusinessUnit.SelectedItem.Text) && string.Compare(RadBusinessUnit.SelectedItem.Text, "Select", true) != 0)
        {
            RadComboBox RadEmployee = (RadComboBox)BUFilter1.FindControl("RadEmployee");
            if (!string.IsNullOrEmpty(RadEmployee.SelectedItem.Text) && string.Compare(RadEmployee.SelectedItem.Text, "Select", true) == 0)
            {
                result = false;
                BLL.ShowMessage(this, "Please select Employee");
                return;
            }
        }
        else
        {
            result = false;
            BLL.ShowMessage(this, "Please select Business Unit");
            return;
        }

        if (string.IsNullOrEmpty(txtbx_CourseName.Text))
        {
            result = false;
            BLL.ShowMessage(this, "Please enter Course Name");
            return;
        }
        if (rdtp_fromdate.SelectedDate == null)
        {
            result = false;
            BLL.ShowMessage(this, "Please select From date");
            return;
        }
        if (rdtp_todate.SelectedDate == null)
        {
            result = false;
            BLL.ShowMessage(this, "Please select To date");
            return;
        }
        if (rdtp_todate.SelectedDate <= rdtp_fromdate.SelectedDate)
        {
            result = false;
            BLL.ShowMessage(this, "To date should be greater than or equal to From date");
            return;
        }
        if (string.IsNullOrEmpty(txtbx_Outcome.Text))
        {
            result = false;
            BLL.ShowMessage(this, "Please enter Outcome");
            return;
        }
    }
コード例 #2
0
    protected void validateInputs(out bool result)
    {
        try
        {
            result = true;
            RadComboBox RadBusinessUnit = (RadComboBox)BUFilter1.FindControl("RadBusinessUnit");
            if (!string.IsNullOrEmpty(RadBusinessUnit.SelectedItem.Text) && string.Compare(RadBusinessUnit.SelectedItem.Text, "Select", true) != 0)
            {
                RadComboBox RadEmployee = (RadComboBox)BUFilter1.FindControl("RadEmployee");
                if (!string.IsNullOrEmpty(RadEmployee.SelectedItem.Text) && string.Compare(RadEmployee.SelectedItem.Text, "Select", true) == 0)
                {
                    result = false;
                    BLL.ShowMessage(this, "Please select Employee");
                    return;
                }
            }
            else
            {
                result = false;
                BLL.ShowMessage(this, "Please select Business Unit");
                return;
            }

            if (string.IsNullOrEmpty(txtbx_WrkshpName.Text))
            {
                result = false;
                BLL.ShowMessage(this, "Please enter Workshop Name");
                return;
            }
            if (string.IsNullOrEmpty(txtbx_Orgby.Text))
            {
                result = false;
                BLL.ShowMessage(this, "Please enter Organised By");
                return;
            }
            if (string.IsNullOrEmpty(txtbx_SpnsBy.Text))
            {
                result = false;
                BLL.ShowMessage(this, "Please enter Sponsored By");
                return;
            }
            if (rdtp_fromdate.SelectedDate == null)
            {
                result = false;
                BLL.ShowMessage(this, "Please select From date");
                return;
            }
            if (rdtp_todate.SelectedDate == null)
            {
                result = false;
                BLL.ShowMessage(this, "Please select To date");
                return;
            }
            if (rdtp_todate.SelectedDate <= rdtp_fromdate.SelectedDate)
            {
                result = false;
                BLL.ShowMessage(this, "To date should be greater than or equal to From date");
                return;
            }
            if (string.IsNullOrEmpty(txtbx_Outcome.Text))
            {
                result = false;
                BLL.ShowMessage(this, "Please enter Outcome");
                return;
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_EmpWorkshops", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
            result = false;
        }
    }