Exemple #1
0
        /// <summary>保存
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void OnTextChanged_CompactMoney(object sender, EventArgs e)
        {
            try
            {
                var tbCompactMoney = (TextBox)sender;
                var dataItem       = (GridDataItem)tbCompactMoney.Parent.Parent;
                var companyId      = dataItem.GetDataKeyValue("CompanyId");
                var compactMoney   = WebControl.NumberRecovery(tbCompactMoney.Text);

                //正则表达式
                if (Regex.IsMatch(compactMoney, @"^(([1-9]\d{0,9})|0)(\.\d{1,2})?$"))
                {
                    var info = new ProcurementCompactQuantityInfo
                    {
                        CompanyId    = new Guid(companyId.ToString()),
                        DateYear     = DateYear,
                        CompactMoney = Convert.ToDecimal(compactMoney)
                    };
                    var result = _procurementCompactQuantityDal.SaveProcurementCompactQuantity(info);
                    if (!result)
                    {
                        RAM.Alert("系统提示:数据保存异常,请尝试刷新后继续操作!");
                    }
                    else
                    {
                        RadGridProcurementCompactQuantity.Rebind();
                    }
                }
                else
                {
                    var companyInfo = _companyCussent.GetCompanyCussent(new Guid(companyId.ToString()));
                    var companyName = string.Empty;
                    if (companyInfo != null)
                    {
                        companyName = companyInfo.CompanyName;
                    }
                    RAM.Alert(string.Format("系统提示:{0}输入金额格式不正确!(不能设置负值)", companyName));
                }
            }
            catch (Exception)
            {
                RAM.Alert("系统提示:保存异常,请尝试刷新后继续操作!");
            }
        }
Exemple #2
0
 /// <summary>搜索
 /// </summary>
 protected void OnClick_Btn_Search(object sender, EventArgs e)
 {
     DateYear = Convert.ToInt32(RCB_Year.SelectedValue);
     RadGridProcurementCompactQuantity.Rebind();
 }