protected void Page_Load(object sender, EventArgs e)
 {
     try
     {
         if (!IsPostBack)
         {
             TitleInitial("证书记录汇总", "用户可以维护证书相关信息,并按年份形成报表。");
             this.DimID = GetRequest("dimID");
             this.ID = GetRequest("ID");
             tbYear.Text = DateTime.Now.Year.ToString();
             tbUserName.Text = this.UserCacheInfo.Name;
             tbCreateTime.Text = DateTime.Now.ToShortDateString();
             CertificateFleeInfo wInfo = new CertificateFleeInfo();
             if (string.IsNullOrEmpty(this.ID) == false)
             {
                 wInfo = new CertificateFlee().GetByID(this.ID);
                 SetPageValue(wInfo);
             }
             BindCurrency();
             BindRate();
         }
     }
     catch (ArgumentNullException aex)
     {
         ShowMsg(aex.Message);
     }
     catch (Exception ex)
     {
         ShowMsg(ex.Message);
         Log(ex);
     }
 }
        protected void btnSave_Click(object sender, EventArgs e)
        {
            try
            {
                string id = this.ID;
                CertificateFleeInfo wInfo = new CertificateFleeInfo();
                if (string.IsNullOrEmpty(id) == false)
                {
                    wInfo = new CertificateFlee().GetByID(id);
                }

                wInfo.InputUserID = this.UserCacheInfo.ID;
                string year = tbYear.Text;
                string dimTimeID = new DimTime().GetIDByMonth(year, "12");
                wInfo.DimTimeID = dimTimeID;
                wInfo.CurrencyID = ddlCurrency.SelectedValue;
                wInfo.ExchangeRateID = this.RateID;

                wInfo.发证日期 = DateTime.Parse(c发证日期.Text);
                wInfo.有效期至 = DateTime.Parse(c有效期至.Text);
                wInfo.年审有效日期 = DateTime.Parse(c年审有效日期.Text);
                wInfo.项目名称 = tb项目名称.Text;
                wInfo.证书类型 = rblType.SelectedValue;
                wInfo.快递费 = tb快递费.Text;
                wInfo.图纸复印费 = tb图纸复印费.Text;
                wInfo.洗照片 = tb洗照片.Text;
                wInfo.公正 = tb公正.Text;
                wInfo.其他 = tb其他.Text;
                wInfo.备注 = tb备注.Text;

                if (string.IsNullOrEmpty(id) == true)
                {
                    this.ID = new CertificateFlee().Add(wInfo);
                    wInfo.ID = this.ID;
                    SetPageValue(wInfo);
                }
                else
                {
                    new CertificateFlee().Update(wInfo);
                }
                ShowMsg("报表保存成功。");
            }
            catch (ArgumentNullException aex)
            {
                ShowMsg(aex.Message);
            }
            catch (Exception ex)
            {
                ShowMsg(ex.Message);
                Log(ex);
            }
        }
        /// <summary>
        /// 根据页面实体设置页面值
        /// </summary>
        /// <param name="wInfo"></param>
        private void SetPageValue(CertificateFleeInfo wInfo)
        {
            DimTimeInfo dInfo = new DimTime().GetDimTimeInfo(wInfo.DimTimeID);
            tbYear.Text = dInfo.Year.ToString();
            tbUserName.Text = this.UserCacheInfo.Name;
            tbCreateTime.Text = wInfo.CreateTime.ToShortDateString();

            ddlCurrency.SelectedValue = wInfo.CurrencyID;
            ddlYear.SelectedValue = dInfo.Year.ToString();
            ddlMonth.SelectedValue = dInfo.MonthNumOfYear.ToString();

            c发证日期.Text = wInfo.发证日期.ToShortDateString();
            c有效期至.Text = wInfo.有效期至.ToShortDateString();
            c年审有效日期.Text = wInfo.年审有效日期.ToShortDateString();
            tb项目名称.Text = wInfo.项目名称;
            rblType.SelectedValue = wInfo.证书类型;
            tb快递费.Text = wInfo.快递费;
            tb图纸复印费.Text = wInfo.图纸复印费;
            tb洗照片.Text = wInfo.洗照片;
            tb公正.Text = wInfo.公正;
            tb其他.Text = wInfo.其他;
            tb备注.Text = wInfo.备注;
        }
示例#4
0
 /// <summary>
 /// 更新费用类别
 /// </summary>
 /// <param name="cInfo">实体</param>
 public void Update(CertificateFleeInfo cInfo)
 {
     if (string.IsNullOrEmpty(cInfo.ID))
     {
         throw new ArgumentNullException("参数ID不能为空。");
     }
     dal.Update(cInfo);
 }
示例#5
0
 /// <summary>
 /// 添加费用类别
 /// </summary>
 /// <param name="cInfo">实体</param>
 /// <returns>新增实体的主键</returns>
 public string Add(CertificateFleeInfo cInfo)
 {
     return dal.Add(cInfo);
 }
示例#6
0
 /// <summary>
 /// 添加费用类别
 /// </summary>
 /// <param name="ID">实体主键</param>
 /// <returns></returns>
 public void Delete(string ID)
 {
     CertificateFleeInfo cInfo = new CertificateFleeInfo(ID);
     dal.Delete(cInfo);
 }