Ejemplo n.º 1
0
        public static DairyParameter WrapDairyParameterItem(DataRow row)
        {
            DairyParameter p = new DairyParameter();

            p.PastureID      = Convert.ToInt32(row["PastureID"]);
            p.ParameterName  = row["ParameterName"].ToString();
            p.ParameterValue = Convert.ToSingle(row["ParameterValue"]);
            int temp = Convert.ToInt32(row["CanBeConfiguredByPasture"]);

            if (temp > 0)
            {
                p.CanBeConfiguredByPasture = true;
            }
            else
            {
                p.CanBeConfiguredByPasture = false;
            }
            temp = Convert.ToInt32(row["CanBeConfiguredByAdmin"]);
            if (temp > 0)
            {
                p.CanBeConfiguredByAdmin = true;
            }
            else
            {
                p.CanBeConfiguredByAdmin = false;
            }
            p.Description = row["Description"].ToString();
            return(p);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 更新牧场参数
        /// </summary>
        /// <param name="parameter"></param>
        /// <returns></returns>
        public static int UpdatePastureParameter(DairyParameter parameter)
        {
            int i = 0;
            DairyParameterDAL dal = new DairyParameterDAL();

            if (parameter.CanBeConfiguredByPasture)
            {
                i = dal.UpdatePastureParameter(parameter.PastureID, parameter.ParameterName, parameter.ParameterValue);
            }
            return(i);
        }