Beispiel #1
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Model.Fieldcmp GetModel(string where)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select id, iprintcount, ccode, cname, cfrombillcardnum, ctobillcardnum, vt_id, cmodifer, dmodifydate, ufts  ");
            strSql.Append("  from " + _tablename + " ");
            strSql.Append(" where ");
            strSql.Append(where);
            Model.Fieldcmp model = new Model.Fieldcmp();
            DataSet        ds    = DbHelperSQL.Query(strSql.ToString(), null);

            if (ds.Tables[0].Rows.Count > 0)
            {
                model.Id = ds.Tables[0].Rows[0]["id"].ToString();
                if (ds.Tables[0].Rows[0]["iprintcount"].ToString() != "")
                {
                    model.Iprintcount = int.Parse(ds.Tables[0].Rows[0]["iprintcount"].ToString());
                }
                model.Ccode            = ds.Tables[0].Rows[0]["ccode"].ToString();
                model.Cname            = ds.Tables[0].Rows[0]["cname"].ToString();
                model.Cfrombillcardnum = ds.Tables[0].Rows[0]["cfrombillcardnum"].ToString();
                model.Ctobillcardnum   = ds.Tables[0].Rows[0]["ctobillcardnum"].ToString();
                model.Vt_id            = ds.Tables[0].Rows[0]["vt_id"].ToString();
                model.Cmodifer         = ds.Tables[0].Rows[0]["cmodifer"].ToString();
                if (ds.Tables[0].Rows[0]["dmodifydate"].ToString() != "")
                {
                    model.Dmodifydate = DateTime.Parse(ds.Tables[0].Rows[0]["dmodifydate"].ToString());
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }
Beispiel #2
0
        /// <summary>
        /// 获取字段对照数据
        /// </summary>
        /// <param name="dt"></param>
        /// <param name="pdt"></param>
        /// <returns></returns>
        public List <Model.Fieldcmps> GetListFieldcmps(Model.Synergismlogdt dt, Model.Synergismlogdt pdt, int tasktype)
        {
            DAL.Fieldcmp   fddal   = new DAL.Fieldcmp();
            Model.Fieldcmp fdmodel = fddal.GetModel(string.Format("cfrombillcardnum='{0}' and ctobillcardnum='{1}'", pdt.Cvouchertype, dt.Cvouchertype));
            BLL.Common.ErrorMsg(fdmodel, "未能取字段对照数据");
            // 模扳数据
            List <Model.Fieldcmps> listfd = GetModelList(string.Format("id='{0}'   order by ctype ,cremark desc,autoid asc", fdmodel.Id));

            BLL.Common.ErrorMsg(listfd, "未能取字段对照数据");
            return(listfd);
        }