Exemple #1
0
    public string GetMonthCalender(int p_intMonth, int p_intYear)
    {
        string id = string.Format("Id: {0} Uri: {1}", Guid.NewGuid(), HttpContext.Current.Request.Url);

        using (Utils utility = new Utils())
        {
            utility.MethodStart(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
        Session["CaseID"] = Session["SZ_CASE_ID"];
        String szHtmlString = "<table width='98%' bgcolor='gray' border=1><tr>";
        Bill_Sys_BillingCompanyDetails_BO _obj = new Bill_Sys_BillingCompanyDetails_BO();

        try
        {
            int iDaysInMonths = 0;

            for (int k = 1; k <= 7; k++)
            {
                szHtmlString = szHtmlString + "<td width='14%' height='60px' bgcolor='blue' align='center' style='color:White'><b>" + getDay(k) + "</b></td>";
            }
            szHtmlString = szHtmlString + "</tr><tr>";

            DateTime objDate = new DateTime(p_intYear, p_intMonth, 1);
            iDaysInMonths = System.DateTime.DaysInMonth(p_intYear, p_intMonth);
            int iStartNumber = getDayNumber(objDate.DayOfWeek.ToString());
            int j            = 1;
            while (j < iStartNumber)
            {
                szHtmlString = szHtmlString + "<td width='14%' height='60px'>&nbsp</td>";
                j++;
            }
            for (int i = 1; i <= iDaysInMonths; i++)
            {
                szHtmlString = szHtmlString + "<td width='14%' height='60px' style='color:WhiteSmoke;'><table width='100%'><tr><td style='text-align:left;vertical-align:top;height:100%' width='100%'> " + i + "</td></tr><tr><td width='100%'>" + _obj.GetPerDayEvent(Session["CaseID"].ToString(), ((Bill_Sys_BillingCompanyObject)Session["BILLING_COMPANY_OBJECT"]).SZ_COMPANY_ID, ddlMonth.SelectedValue + "/" + i + "/" + ddlYear.SelectedValue) + "</td></tr></table></td>";

                if ((i + iStartNumber) % 7 == 1)
                {
                    szHtmlString = szHtmlString + "</tr><tr>";
                }
            }
        }
        catch (Exception ex)
        {
            Elmah.ErrorSignal.FromCurrentContext().Raise(ex);
            using (Utils utility = new Utils())
            {
                utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
            }
            string str2 = "Error Request=" + id + ".Please share with Technical support.";
            base.Response.Redirect("../Bill_Sys_ErrorPage.aspx?ErrMsg=" + str2);
        }

        tdMonthCalender.InnerHtml = szHtmlString;
        return(null);

        //Method End
        using (Utils utility = new Utils())
        {
            utility.MethodEnd(id, System.Reflection.MethodBase.GetCurrentMethod());
        }
    }