Esempio n. 1
0
        private void BindList(int pageIndex, int pageSize)
        {
            string dateID = MonthAndShipNavigate1.DateID;
            string shipID = MonthAndShipNavigate1.ShipID;

            DataSet ds = new WuliaoInput().GetList(dateID, shipID, this.ReportTypeID, pageSize, pageIndex);
            gvWuliaoList.DataSource = ds;
            gvWuliaoList.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;
                WuliaoInputInfo wInfo = new WuliaoInputInfo();
                if (string.IsNullOrEmpty(id) == false)
                {
                    wInfo = new WuliaoInput().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;
                string year = ddlReportYear.SelectedValue;
                string month = ddlReportMonth.SelectedValue;
                string dimTimeID = new DimTime().GetIDByMonth(year, month);
                wInfo.DimTimeID = dimTimeID;
                wInfo.ShipID = ddlShip.SelectedValue;
                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;
                wInfo.药品 = tb药品.Text;
                wInfo.油漆 = tb油漆.Text;
                if (string.IsNullOrEmpty(id) == true)
                {
                    this.ReportID = new WuliaoInput().Add(wInfo);
                }
                else
                {
                    new WuliaoInput().Update(wInfo);
                }
                tb总数.Text = wInfo.总数;
                ShowMsg("物料报表保存成功。");
            }
            catch (ArgumentNullException aex)
            {
                ShowMsg(aex.Message);
            }
            catch (Exception ex)
            {
                ShowMsg(ex.Message);
                Log(ex);
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (!IsPostBack)
         {
             TitleInitial("物料报表", "用户可以新增、修改或者删除物料报表信息,报表登记用户不能修改已经被财务部门确认过的报表。");
             this.ReportID = GetRequest("ID");
             BindShip();
             BindCurrency();
             if (string.IsNullOrEmpty(this.ReportID) )
             {
                 SetNewReport();
                 return;
             }
             WuliaoInputInfo wInfo = new WuliaoInput().GetByID(this.ReportID);
             SetPageValue(wInfo, wInfo.ReportTypeID);
             foreach (ListItem item in rblReportType.Items)
             {
                 item.Text = item.Text.Replace("(当前状态)", "");
                 if (item.Value == wInfo.ReportTypeID)
                 {
                     item.Text = item.Text + "(当前状态)";
                 }
             }
             //InvoiceList1.KeyID = ReportID;
         }
     }
     catch (ArgumentNullException aex)
     {
         ShowMsg(aex.Message);
     }
     catch (Exception ex)
     {
         ShowMsg(ex.Message);
         Log(ex);
     }
 }
        protected void rblReportType_SelectedIndexChanged(object sender, EventArgs e)
        {
            string id = this.ReportID;

            if (string.IsNullOrEmpty(id))
            {
                return;
            }
            WuliaoInputInfo wInfo = new WuliaoInput().GetByID(id);
            string selectValue = rblReportType.SelectedValue;
            if (selectValue == "1" && wInfo.ReportTypeID != "1")
            {
                WuliaoInputInfo preInfo = new ReportBase<WuliaoInputInfo>().GetPreestimateModel(wInfo.ID);
                SetPageValue(preInfo, selectValue);
            }
            else if (selectValue == "2" && wInfo.ReportTypeID == "3")
            {
                WuliaoInputInfo preInfo = new ReportBase<WuliaoInputInfo>().GetAmendModel(wInfo.ID);
                SetPageValue(preInfo, selectValue);
            }
            else
            {
                SetPageValue(wInfo, selectValue);
            }
        }
Esempio n. 5
0
 /// <summary>
 /// 绑定物料报表
 /// </summary>
 private void BindList()
 {
     string year = rblYear.SelectedValue;
     string shipID = rblShip.SelectedValue;
     DataSet ds = new WuliaoInput().GetCountStatictis(year, shipID);
     gvWuliaoList.DataSource = ds;
     gvWuliaoList.DataBind();
 }
Esempio n. 6
0
 /// <summary>
 /// 绑定物料报表
 /// </summary>
 /// <param name="year">报表的年份,为空显示所有年份</param>
 /// <param name="shipID">报表对应的船舶,为空显示所有的船舶</param>
 private void BindList(string year, string shipID)
 {
     DataSet ds = new WuliaoInput().GetCountStatictis(year, shipID);
     gvWuliaoList.DataSource = ds;
     gvWuliaoList.DataBind();
 }
 /// <summary>
 /// 绑定物料报表
 /// </summary>
 /// <param name="year">报表的年份,为空显示所有年份</param>
 /// <param name="QuarterID">报表对应的季度,为空显示所有的季度</param>
 private void BindList(string year, string quarter)
 {
     DataSet ds = new WuliaoInput().GetSumStatictis(year, quarter);
     gvWuliaoList.DataSource = ds;
     gvWuliaoList.DataBind();
 }
 /// <summary>
 /// 绑定物料报表
 /// </summary>
 private void BindList()
 {
     string year = rblYear.SelectedValue;
     string quarter = rblQuarter.SelectedValue;
     DataSet ds = new WuliaoInput().GetSumStatictis(year, quarter);
     gvWuliaoList.DataSource = ds;
     gvWuliaoList.DataBind();
 }