/// <summary> /// 取得修约规则后的数值 /// </summary> /// <param name="dt">修约数据</param> /// <param name="Item">项目代码</param> /// <param name="val">数据</param> /// <param name="Dec">保留位数</param> /// <returns></returns> public static string GetPValue(DataTable dt, string Item, decimal val, int Dec) { DataRow[] drRule = dt.Select("fldItemCode='" + Item + "'"); if (drRule.Length > 0) { return(ServiceCommon.GetRuleData(drRule[0], val, Dec)); } else { return(val.ToString().Split('.')[0] + (Dec == 0 ? "" : "." + (val.ToString().Split('.')[1].Length < Dec ? val.ToString().Split('.')[1] : val.ToString().Split('.')[1].Substring(0, Dec)))); } }
/// <summary> ///判断是否是字段浓度值 /// </summary> /// <param name="strColumnName">字符串</param> /// <returns></returns> public static bool IsItemValue(string strColumnName) { string strCName = strColumnName; string strItemCode = strCName.Substring(strCName.Length - 3, 3); if (ServiceCommon.IsNumeric(strItemCode)) { return(true); } else { return(false); } }