예제 #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     _smonth       = DTRequest.GetString("txtsDate");
     _emonth       = DTRequest.GetString("txteDate");
     _type         = DTRequest.GetString("ddltype");
     _cid          = DTRequest.GetString("hCusId");
     _cusName      = DTRequest.GetString("txtCusName");
     _area         = DTRequest.GetString("ddlarea");
     _tag          = DTRequest.GetString("tag");
     this.pageSize = GetPageSize(10); //每页数量
     _lastMonth    = bll.getLastFinancialMonth();
     if (string.IsNullOrEmpty(_lastMonth))
     {
         _lastMonth    = DateTime.Now.ToString("yyyy-MM");
         _defaultMonth = _lastMonth;
     }
     else
     {
         _defaultMonth = _lastMonth;
         _lastMonth    = ConvertHelper.toDate(_lastMonth + "-01").Value.AddMonths(1).ToString("yyyy-MM");
     }
     if (!IsPostBack)
     {
         if (_tag != "0")
         {
             if (string.IsNullOrEmpty(_smonth))
             {
                 _smonth = _defaultMonth;
             }
             if (string.IsNullOrEmpty(_emonth))
             {
                 _emonth = _defaultMonth;
             }
         }
         InitData();
         RptBind();
     }
 }
예제 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     flag    = DTRequest.GetString("flag");
     _smonth = DTRequest.GetString("txtsDate");
     _emonth = DTRequest.GetString("txteDate");
     _area   = DTRequest.GetString("ddlarea");
     if (string.IsNullOrEmpty(flag))
     {
         flag = "0";
     }
     _lastMonth = bll.getLastFinancialMonth();
     if (flag == "0")
     {
         if (string.IsNullOrEmpty(_lastMonth))
         {
             //_lastMonth = DateTime.Now.ToString("yyyy-MM");
             //labUnFinMonth.Text = _lastMonth;
             _defaultMonth         = DateTime.Now.ToString("yyyy-MM");
             labUnFinMonth.Visible = false;
             labtitle.Text         = "请选择首次结账月份:";
         }
         else
         {
             _defaultMonth      = _lastMonth;
             _lastMonth         = ConvertHelper.toDate(_lastMonth + "-01").Value.AddMonths(1).ToString("yyyy-MM");
             labUnFinMonth.Text = _lastMonth;
             txtDate.Visible    = false;
         }
     }
     else
     {
         if (string.IsNullOrEmpty(_lastMonth))
         {
             labFinMonth.Text     = "还未结账过";
             btnFinancial.Visible = false;
         }
         else
         {
             labFinMonth.Text = _lastMonth;
         }
     }
     if (!IsPostBack)
     {
         InitData();
         _smonth = _defaultMonth;
         _emonth = _defaultMonth;
         RptBind();
         div0.Visible = false;
         div1.Visible = false;
         if (flag == "0")
         {
             div0.Visible = true;
         }
         else
         {
             div1.Visible = true;
         }
     }
     txtsDate.Text         = _smonth;
     txteDate.Text         = _emonth;
     ddlarea.SelectedValue = _area;
 }