有无其他方法赋值
public static Hl_ptype GetHl_ptypeByTypeId(string typeId){
Hl_ptype ptype = null;
SqlDataReader ptypeRead = Hl_ptypeService.GetProductListByTypeID(typeId);
if (ptypeRead.Read())
{
ptype = new Hl_ptype();
ptype.TypeId = ptypeRead["typeId"].ToString();
ptype.ParId = ptypeRead["ParId"].ToString();
ptype.小类ID1 = ptypeRead["小类ID"].ToString();
ptype.大类ID1 = ptypeRead["大类ID"].ToString();
ptype.FullName = ptypeRead["FullName"].ToString();
ptype.Name = ptypeRead["Name"].ToString();
ptype.Efullname = ptypeRead["Efullname"].ToString();
ptype.Ename = ptypeRead["Ename"].ToString();
ptype.BarCode = ptypeRead["BarCode"].ToString();
ptype.Standard = Convert.ToDouble(ptypeRead["standard"].ToString());
ptype.Unit1 = ptypeRead["Unit1"].ToString();
ptype.Unit2 = ptypeRead["Unit2"].ToString();
= ptypeRead["Comment"].ToString();
ptype.KCQX = Convert.ToDouble(ptypeRead["KCQX"].ToString());
ptype.Warndown = Convert.ToDouble(ptypeRead["warndown"].ToString());
ptype.Warnup = Convert.ToDouble(ptypeRead["warnup"].ToString());
ptype.ParamA = Convert.ToDouble(ptypeRead["ParamA"].ToString());
ptype.ParamB = Convert.ToDouble(ptypeRead["ParamB"].ToString());
ptype.ParamC = Convert.ToDouble(ptypeRead["ParamC"].ToString());
ptype.ParamD = Convert.ToDouble(ptypeRead["ParamD"].ToString());
ptype.Dlyorder = Convert.ToInt32(ptypeRead["dlyorder"].ToString());
ptype.Deleted = Convert.ToInt32(ptypeRead["deleted"].ToString());
ptype.Hit = Convert.ToInt32(checkIn.isCheckInNull(ptypeRead["Hit"].ToString()));
string material = ptypeRead["color"].ToString();
string color = ptypeRead["color"].ToString();
WinnerDBHelper.CloseConn();
ptype.Material = isStringNull(material);
ptype.Color = isStringNull(color);
}
return ptype;
}
有无其他方法赋值!
这样很麻烦!