/// <summary>
 /// 绑定物料报表
 /// </summary>
 /// <param name="year">报表的年份,为空显示所有年份</param>
 /// <param name="shipID">报表对应的船舶,为空显示所有的船舶</param>
 private void BindList(string year, string shipID)
 {
     DataSet ds = new JianyanInput().GetCountStatictis(year, shipID);
     gvJianyanList.DataSource = ds;
     gvJianyanList.DataBind();
 }
 /// <summary>
 /// 绑定物料报表
 /// </summary>
 private void BindList()
 {
     string year = rblYear.SelectedValue;
     string shipID = rblShip.SelectedValue;
     DataSet ds = new JianyanInput().GetCountStatictis(year, shipID);
     gvJianyanList.DataSource = ds;
     gvJianyanList.DataBind();
 }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                string id = this.ReportID;
                JianyanInputInfo wInfo = new JianyanInputInfo();
                if (string.IsNullOrEmpty(id) == false)
                {
                    wInfo = new JianyanInput().GetByID(id);
                }

                wInfo.UsageType = rblUsage.SelectedValue;
                string reportTypeID = rblReportType.SelectedValue;
                if (string.IsNullOrEmpty(reportTypeID))
                {
                    ShowMsg("请选择报表类型。");
                    return;
                }
                wInfo.ReportTypeID = rblReportType.SelectedValue;
                wInfo.InputUserID = this.UserCacheInfo.ID;
                wInfo.CurrencyID = ddlCurrency.SelectedValue;
                wInfo.ExchangeRateID = this.RateID;

                wInfo.总数 = tb总数.Text;
                string year = ddlReportYear.SelectedValue;
                string month = ddlReportMonth.SelectedValue;
                string dimTimeID = new DimTime().GetIDByMonth(year, month);
                wInfo.DimTimeID = dimTimeID;
                wInfo.ShipID = ddlShip.SelectedValue; 
                
                if (string.IsNullOrEmpty(id) == true)
                {
                    this.ReportID = new JianyanInput().Add(wInfo);
                }
                else
                {
                    new JianyanInput().Update(wInfo);
                }
                tb总数.Text = wInfo.总数;
                ShowMsg("检验报表保存成功。");
            }
            catch (ArgumentNullException aex)
            {
                ShowMsg(aex.Message);
            }
            catch (Exception ex)
            {
                ShowMsg(ex.Message);
                Log(ex);
            }
        }
        private void SetPageValue(string id)
        {
            JianyanInputInfo wInfo = new JianyanInput().GetByID(id);
            DimTimeInfo dInfo = new DimTime().GetDimTimeInfo(wInfo.DimTimeID);
            ddlReportMonth.SelectedValue = dInfo.MonthNumOfYear.ToString();
            ddlReportYear.SelectedValue = dInfo.Year.ToString();
            tbUserName.Text = this.UserCacheInfo.Name;
            tbCreateTime.Text = wInfo.CreateTime.ToShortDateString();

            rblReportType.Items.FindByValue(wInfo.ReportTypeID).Selected = true;
            rblUsage.Items.FindByValue(wInfo.UsageType).Selected = true;
            ddlShip.SelectedItem.Selected = false;
            ddlCurrency.SelectedItem.Selected = false;
            ddlYear.SelectedItem.Selected = false;
            ddlMonth.SelectedItem.Selected = false;
            ddlShip.Items.FindByValue(wInfo.ShipID).Selected = true;
            ddlCurrency.Items.FindByValue(wInfo.CurrencyID).Selected = true;
            ddlYear.Items.FindByValue(dInfo.Year.ToString()).Selected = true;
            ddlMonth.Items.FindByValue(dInfo.MonthNumOfYear.ToString()).Selected = true;

            tb总数.Text = wInfo.总数;
            InvoiceList1.KeyID = id;
        }
        private void BindList(int pageIndex, int pageSize)
        {
            string dateID = MonthAndShipNavigate1.DateID;
            string shipID = MonthAndShipNavigate1.ShipID;

            DataSet ds = new JianyanInput().GetList(dateID, shipID, this.ReportTypeID, pageSize, pageIndex);
            gvJianyanList.DataSource = ds;
            gvJianyanList.DataBind();
            CustomDataSet cDS = ds as CustomDataSet;
            if (cDS == null)
            {
                pGrid.TotalAmout = 0;
                return;
            }
            pGrid.TotalAmout = cDS.TotalAmout;
        }
 /// <summary>
 /// 绑定物料报表
 /// </summary>
 /// <param name="year">报表的年份,为空显示所有年份</param>
 /// <param name="QuarterID">报表对应的季度,为空显示所有的季度</param>
 private void BindList(string year, string quarter)
 {
     DataSet ds = new JianyanInput().GetSumStatictis(year, quarter);
     gvJianyanList.DataSource = ds;
     gvJianyanList.DataBind();
 }
 /// <summary>
 /// 绑定物料报表
 /// </summary>
 private void BindList()
 {
     string year = rblYear.SelectedValue;
     string quarter = rblQuarter.SelectedValue;
     DataSet ds = new JianyanInput().GetSumStatictis(year, quarter);
     gvJianyanList.DataSource = ds;
     gvJianyanList.DataBind();
 }