Пример #1
0
    private void GetDaysAndGrant()
    {
        DateTime dtStartDate, dtEndDate;

        dtStartDate = dtEndDate = DateTime.MinValue;
        TimeSpan ts = new TimeSpan();

        lblNewNoOfDays.Text = string.Empty;
        if (ddlCampSession.Items.Count > 1)
        {
            if (lblSysNewStartDate.Text != string.Empty && lblSysNewEndDate.Text != string.Empty)
            {
                dtEndDate   = DateTime.Parse(lblSysNewEndDate.Text);
                dtStartDate = DateTime.Parse(lblSysNewStartDate.Text);
            }
        }
        else
        {
            if (txtNewEndDate.Text != string.Empty && txtNewStartDate.Text != string.Empty)
            {
                dtEndDate   = DateTime.Parse(txtNewEndDate.Text);
                dtStartDate = DateTime.Parse(txtNewStartDate.Text);
            }
        }

        if (dtEndDate != DateTime.MinValue && dtStartDate != DateTime.MinValue)
        {
            if (dtEndDate > dtStartDate)
            {
                ts = dtEndDate.Subtract(dtStartDate);
                lblNewNoOfDays.Text = (ts.Days + 1).ToString();
            }
        }

        if (lblNewNoOfDays.Text != string.Empty)
        {
            objCamperApplication = new CamperApplication();
            lblNewGrant.Text     = "$" + objCamperApplication.GetGrantFromDaysCamp(lblFJCID.Text, lblNewNoOfDays.Text, lblCampID.Text, lblFirstSecondTime.Text).ToString();
        }
    }