/// <summary>
 /// 绑定物料报表
 /// </summary>
 private void BindList()
 {
     string year = rblYear.SelectedValue;
     string quarter = rblQuarter.SelectedValue;
     DataSet ds = new BeijianInput().GetSumStatictis(year, quarter);
     gvBeijianList.DataSource = ds;
     gvBeijianList.DataBind();
 }
 /// <summary>
 /// 绑定物料报表
 /// </summary>
 /// <param name="year">报表的年份,为空显示所有年份</param>
 /// <param name="QuarterID">报表对应的季度,为空显示所有的季度</param>
 private void BindList(string year, string quarter)
 {
     DataSet ds = new BeijianInput().GetSumStatictis(year, quarter);
     gvBeijianList.DataSource = ds;
     gvBeijianList.DataBind();
 }
 /// <summary>
 /// 绑定物料报表
 /// </summary>
 private void BindList()
 {
     string year = rblYear.SelectedValue;
     string shipID = rblShip.SelectedValue;
     DataSet ds = new BeijianInput().GetCountStatictis(year, shipID);
     gvBeijianList.DataSource = ds;
     gvBeijianList.DataBind();
 }
 /// <summary>
 /// 绑定物料报表
 /// </summary>
 /// <param name="year">报表的年份,为空显示所有年份</param>
 /// <param name="shipID">报表对应的船舶,为空显示所有的船舶</param>
 private void BindList(string year, string shipID)
 {
     DataSet ds = new BeijianInput().GetCountStatictis(year, shipID);
     gvBeijianList.DataSource = ds;
     gvBeijianList.DataBind();
 }
        private void BindList(int pageIndex, int pageSize)
        {
            string dateID = MonthAndShipNavigate1.DateID;
            string shipID = MonthAndShipNavigate1.ShipID;

            DataSet ds = new BeijianInput().GetList(dateID, shipID, this.ReportTypeID, pageSize, pageIndex);
            gvBeijianList.DataSource = ds;
            gvBeijianList.DataBind();
            CustomDataSet cDS = ds as CustomDataSet;
            if (cDS == null)
            {
                pGrid.TotalAmout = 0;
                return;
            }
            pGrid.TotalAmout = cDS.TotalAmout;
        }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                string id = this.ReportID;
                BeijianInputInfo wInfo = new BeijianInputInfo();
                if (string.IsNullOrEmpty(id) == false)
                {
                    wInfo = new BeijianInput().GetByID(id);
                }

                wInfo.UsageType = rblUsage.SelectedValue;
                wInfo.ReportTypeID = rblReportType.SelectedValue;
                wInfo.InputUserID = this.UserCacheInfo.ID;
                wInfo.ShipID = ddlShip.SelectedValue;
                string year = ddlReportYear.SelectedValue;
                string month = ddlReportMonth.SelectedValue;
                string dimTimeID = new DimTime().GetIDByMonth(year, month);
                wInfo.DimTimeID = dimTimeID;
                wInfo.CurrencyID = ddlCurrency.SelectedValue;
                wInfo.ExchangeRateID = this.RateID;

                wInfo.电器 = tb电器.Text;
                wInfo.分油机 = tb分油机.Text;
                wInfo.辅机 = tb辅机.Text;
                wInfo.副机 = tb副机.Text;
                wInfo.舾装 = tb舾装.Text;
                wInfo.主机 = tb主机.Text;
                if (string.IsNullOrEmpty(id) == true)
                {
                    this.ReportID = new BeijianInput().Add(wInfo);
                }
                else
                {
                    new BeijianInput().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)
        {
            BeijianInputInfo wInfo = new BeijianInput().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.总数;

            tb电器.Text = wInfo.电器;
            tb分油机.Text = wInfo.分油机;
            tb辅机.Text = wInfo.辅机;
            tb副机.Text = wInfo.副机;
            tb舾装.Text = wInfo.舾装;
            tb主机.Text = wInfo.主机;
            InvoiceList1.KeyID = id;
            InvoiceList1.MenuID = this.MenuID;
        }