public static Model.T_Standard FillModelByRow(DataRow row) { Model.T_Standard model = new Model.T_Standard(); if (row["ID"].ToString() != "") { model.ID = int.Parse(row["ID"].ToString()); } model.sProductNum = row["sProductNum"].ToString (); model.sName = row["sName"].ToString (); model.sUnit = row["sUnit"].ToString (); if (row["sWeight"].ToString() != "") { model.sWeight = decimal.Parse(row["sWeight"].ToString()); } if (row["sVolume"].ToString() != "") { model.sVolume = decimal.Parse(row["sVolume"].ToString()); } if (row["sPrice"].ToString() != "") { model.sPrice = decimal.Parse(row["sPrice"].ToString()); } if (row["sSortNum"].ToString() != "") { model.sSortNum = int.Parse(row["sSortNum"].ToString()); } return(model); }
private void ShowInfo(int _id) { //获取实体对象 ModelInfo = bll.GetModel(_id); //规格名称 this.txt_sName.Text = ModelInfo.sName; //计量单位 this.txt_sUnit.Text = ModelInfo.sUnit; //重量 this.txt_sWeight.Text = MyCommFun.ObjToStr(ModelInfo.sWeight); //体积 this.txt_sVolume.Text = MyCommFun.ObjToStr(ModelInfo.sVolume); //价格 this.txt_sPrice.Text = MyCommFun.ObjToStr(ModelInfo.sPrice); //排序序号 this.txtSortid.Text = MyCommFun.ObjToStr(ModelInfo.sSortNum); //备注 //this.txt_Remark.Text = ModelInfo.sRemark; }
/// <summary> /// 更新一条数据 /// </summary> public bool Update(Model.T_Standard model) { return(dal.Update(model)); }
/// <summary> /// 增加一条数据 /// </summary> public int Insert(Model.T_Standard model) { return(dal.Insert(model)); }