示例#1
0
 /// <summary>
 /// 添加费用类别
 /// </summary>
 /// <param name="ID">实体主键</param>
 /// <returns></returns>
 public void Delete(string ID)
 {
     XiuliInputInfo cInfo = new XiuliInputInfo(ID);
     dal.Delete(cInfo);
 }
示例#2
0
 /// <summary>
 /// 添加费用类别
 /// </summary>
 /// <param name="cInfo">实体</param>
 /// <returns>新增实体的主键</returns>
 public string Add(XiuliInputInfo cInfo)
 {
     return dal.Add(cInfo);
 }
示例#3
0
 /// <summary>
 /// 更新费用类别
 /// </summary>
 /// <param name="cInfo">实体</param>
 public void Update(XiuliInputInfo cInfo)
 {
     if (string.IsNullOrEmpty(cInfo.ID))
     {
         throw new ArgumentNullException("参数ID不能为空。");
     }
     dal.Update(cInfo);
 }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                string id = this.ReportID;
                XiuliInputInfo wInfo = new XiuliInputInfo();
                if (string.IsNullOrEmpty(id) == false)
                {
                    wInfo = new XiuliInput().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.总数 = tb总数.Text;

                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;
                if (string.IsNullOrEmpty(id) == true)
                {
                    this.ReportID = new XiuliInput().Add(wInfo);
                }
                else
                {
                    new XiuliInput().Update(wInfo);
                }
                tb总数.Text = wInfo.总数;
                ShowMsg("修理报表保存成功。");
            }
            catch (ArgumentNullException aex)
            {
                ShowMsg(aex.Message);
            }
            catch (Exception ex)
            {
                ShowMsg(ex.Message);
                Log(ex);
            }
        }