Esempio n. 1
0
        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public 珠宝入库系统.Model.商品表 GetModel(string 条码号)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select  top 1 条码号,产品大类,成色,主石名称,首饰类别,自定大类,款号,安全库编号,证书号,原编号,加盟品牌,总件重,净金重,含配金重,金价,金耗,金料金额,配件1计价,配件1名,配件1数,配件1重,配件1价,配件1金额,配件2计价,配件2名,配件2数,配件2重,配件2价,配件2金额,手寸,主石计价方式,主石号,主石规格,主石粒数,主石重,主石单位,主石价,主石金额,主石外型,主石颜色,主石净度,主石车工,辅石1计价方式,辅石1号,辅石1名,辅石1粒数,辅石1重量,辅石1单价,辅石1金额,辅石2计价方式,辅石2号,辅石2名,辅石2粒数,辅石2重量,辅石2单价,辅石2金额,辅石3计价方式,辅石3号,辅石3名,辅石3粒数,辅石3重量,辅石3单价,辅石3金额,辅石4计价方式,辅石4号,辅石4名,辅石4粒数,辅石4重量,辅石4单价,辅石4金额,辅石5计价方式,辅石5号,辅石5名,辅石5粒数,辅石5重量,辅石5单价,辅石5金额,辅石总粒数,辅石总重量,加工费方式,加工费,证书费,其它费用名,其他费方式,其它费,进货成本,成本基数,真实成本,市场成本,销售倍率,售价,备注,当前状态,入库单号,入库时间,供应商,退库单号,退库时间,发货单号,发货时间,分销商,分销柜组,退货单号,退货时间,销售单号,销售时间,销售客户,原售价,折扣率,实售价,销退单号,销退时间,调价单号,调价时间,盘点单号,盘点时间,调价顺序,c0186,公司品牌,公司地址,检测单位,产地,执行标准,公司LOGOA,公司LOGOB,促销原价,库存,售出,种类,品种,编码,厂家,厂址,新增时间,编辑时间,产品大类名,产品名称,状态 from 商品表 ");
            strSql.Append(" where 条码号=@条码号 ");
            SqlParameter[] parameters = {
                    new SqlParameter("@条码号", SqlDbType.NVarChar,255)			};
            parameters[0].Value = 条码号;

            珠宝入库系统.Model.商品表 model = new 珠宝入库系统.Model.商品表();
            DataSet ds = DbHelperSQL.Query(strSql.ToString(), parameters);
            if (ds.Tables[0].Rows.Count > 0)
            {
                return DataRowToModel(ds.Tables[0].Rows[0]);
            }
            else
            {
                return null;
            }
        }
Esempio n. 2
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public 珠宝入库系统.Model.商品表 DataRowToSimpleModel(DataRow row)
 {
     珠宝入库系统.Model.商品表 model = new 珠宝入库系统.Model.商品表();
     if (row != null)
     {
         if (row["条码号"] != null)
         {
             model.条码号 = row["条码号"].ToString();
         }
         if (row["产品大类"] != null)
         {
             model.产品大类 = row["产品大类"].ToString();
         }
         if (row["成色"] != null)
         {
             model.成色 = row["成色"].ToString();
         }
         if (row["主石名称"] != null)
         {
             model.主石名称 = row["主石名称"].ToString();
         }
         if (row["首饰类别"] != null)
         {
             model.首饰类别 = row["首饰类别"].ToString();
         }
         if (row["自定大类"] != null)
         {
             model.自定大类 = row["自定大类"].ToString();
         }
         if (row["款号"] != null)
         {
             model.款号 = row["款号"].ToString();
         }
         //if (row["安全库编号"] != null)
         //{
         //    model.安全库编号 = row["安全库编号"].ToString();
         //}
         if (row["证书号"] != null)
         {
             model.证书号 = row["证书号"].ToString();
         }
         if (row["原编号"] != null)
         {
             model.原编号 = row["原编号"].ToString();
         }
         //if (row["加盟品牌"] != null)
         //{
         //    model.加盟品牌 = row["加盟品牌"].ToString();
         //}
         if (row["总件重"] != null)
         {
             model.总件重 = row["总件重"].ToString();
         }
         if (row["净金重"] != null)
         {
             model.净金重 = row["净金重"].ToString();
         }
         //if (row["含配金重"] != null)
         //{
         //    model.含配金重 = row["含配金重"].ToString();
         //}
         //if (row["金价"] != null)
         //{
         //    model.金价 = row["金价"].ToString();
         //}
         //if (row["金耗"] != null)
         //{
         //    model.金耗 = row["金耗"].ToString();
         //}
         //if (row["金料金额"] != null)
         //{
         //    model.金料金额 = row["金料金额"].ToString();
         //}
         //if (row["配件1计价"] != null)
         //{
         //    model.配件1计价 = row["配件1计价"].ToString();
         //}
         //if (row["配件1名"] != null)
         //{
         //    model.配件1名 = row["配件1名"].ToString();
         //}
         //if (row["配件1数"] != null)
         //{
         //    model.配件1数 = row["配件1数"].ToString();
         //}
         //if (row["配件1重"] != null)
         //{
         //    model.配件1重 = row["配件1重"].ToString();
         //}
         //if (row["配件1价"] != null)
         //{
         //    model.配件1价 = row["配件1价"].ToString();
         //}
         //if (row["配件1金额"] != null)
         //{
         //    model.配件1金额 = row["配件1金额"].ToString();
         //}
         //if (row["配件2计价"] != null)
         //{
         //    model.配件2计价 = row["配件2计价"].ToString();
         //}
         //if (row["配件2名"] != null)
         //{
         //    model.配件2名 = row["配件2名"].ToString();
         //}
         //if (row["配件2数"] != null)
         //{
         //    model.配件2数 = row["配件2数"].ToString();
         //}
         //if (row["配件2重"] != null)
         //{
         //    model.配件2重 = row["配件2重"].ToString();
         //}
         //if (row["配件2价"] != null)
         //{
         //    model.配件2价 = row["配件2价"].ToString();
         //}
         //if (row["配件2金额"] != null)
         //{
         //    model.配件2金额 = row["配件2金额"].ToString();
         //}
         if (row["手寸"] != null)
         {
             model.手寸 = row["手寸"].ToString();
         }
         //if (row["主石计价方式"] != null)
         //{
         //    model.主石计价方式 = row["主石计价方式"].ToString();
         //}
         //if (row["主石号"] != null)
         //{
         //    model.主石号 = row["主石号"].ToString();
         //}
         if (row["主石规格"] != null)
         {
             model.主石规格 = row["主石规格"].ToString();
         }
         if (row["主石粒数"] != null)
         {
             model.主石粒数 = row["主石粒数"].ToString();
         }
         if (row["主石重"] != null)
         {
             model.主石重 = row["主石重"].ToString();
         }
         //if (row["主石单位"] != null)
         //{
         //    model.主石单位 = row["主石单位"].ToString();
         //}
         //if (row["主石价"] != null)
         //{
         //    model.主石价 = row["主石价"].ToString();
         //}
         if (row["主石金额"] != null)
         {
             model.主石金额 = row["主石金额"].ToString();
         }
         //if (row["主石外型"] != null)
         //{
         //    model.主石外型 = row["主石外型"].ToString();
         //}
         if (row["主石颜色"] != null)
         {
             model.主石颜色 = row["主石颜色"].ToString();
         }
         if (row["主石净度"] != null)
         {
             model.主石净度 = row["主石净度"].ToString();
         }
         if (row["主石车工"] != null)
         {
             model.主石车工 = row["主石车工"].ToString();
         }
         //if (row["辅石1计价方式"] != null)
         //{
         //    model.辅石1计价方式 = row["辅石1计价方式"].ToString();
         //}
         //if (row["辅石1号"] != null)
         //{
         //    model.辅石1号 = row["辅石1号"].ToString();
         //}
         //if (row["辅石1名"] != null)
         //{
         //    model.辅石1名 = row["辅石1名"].ToString();
         //}
         //if (row["辅石1粒数"] != null)
         //{
         //    model.辅石1粒数 = row["辅石1粒数"].ToString();
         //}
         //if (row["辅石1重量"] != null)
         //{
         //    model.辅石1重量 = row["辅石1重量"].ToString();
         //}
         //if (row["辅石1单价"] != null)
         //{
         //    model.辅石1单价 = row["辅石1单价"].ToString();
         //}
         //if (row["辅石1金额"] != null)
         //{
         //    model.辅石1金额 = row["辅石1金额"].ToString();
         //}
         //if (row["辅石2计价方式"] != null)
         //{
         //    model.辅石2计价方式 = row["辅石2计价方式"].ToString();
         //}
         //if (row["辅石2号"] != null)
         //{
         //    model.辅石2号 = row["辅石2号"].ToString();
         //}
         //if (row["辅石2名"] != null)
         //{
         //    model.辅石2名 = row["辅石2名"].ToString();
         //}
         //if (row["辅石2粒数"] != null)
         //{
         //    model.辅石2粒数 = row["辅石2粒数"].ToString();
         //}
         //if (row["辅石2重量"] != null)
         //{
         //    model.辅石2重量 = row["辅石2重量"].ToString();
         //}
         //if (row["辅石2单价"] != null)
         //{
         //    model.辅石2单价 = row["辅石2单价"].ToString();
         //}
         //if (row["辅石2金额"] != null)
         //{
         //    model.辅石2金额 = row["辅石2金额"].ToString();
         //}
         //if (row["辅石3计价方式"] != null)
         //{
         //    model.辅石3计价方式 = row["辅石3计价方式"].ToString();
         //}
         //if (row["辅石3号"] != null)
         //{
         //    model.辅石3号 = row["辅石3号"].ToString();
         //}
         //if (row["辅石3名"] != null)
         //{
         //    model.辅石3名 = row["辅石3名"].ToString();
         //}
         //if (row["辅石3粒数"] != null)
         //{
         //    model.辅石3粒数 = row["辅石3粒数"].ToString();
         //}
         //if (row["辅石3重量"] != null)
         //{
         //    model.辅石3重量 = row["辅石3重量"].ToString();
         //}
         //if (row["辅石3单价"] != null)
         //{
         //    model.辅石3单价 = row["辅石3单价"].ToString();
         //}
         //if (row["辅石3金额"] != null)
         //{
         //    model.辅石3金额 = row["辅石3金额"].ToString();
         //}
         //if (row["辅石4计价方式"] != null)
         //{
         //    model.辅石4计价方式 = row["辅石4计价方式"].ToString();
         //}
         //if (row["辅石4号"] != null)
         //{
         //    model.辅石4号 = row["辅石4号"].ToString();
         //}
         //if (row["辅石4名"] != null)
         //{
         //    model.辅石4名 = row["辅石4名"].ToString();
         //}
         //if (row["辅石4粒数"] != null)
         //{
         //    model.辅石4粒数 = row["辅石4粒数"].ToString();
         //}
         //if (row["辅石4重量"] != null)
         //{
         //    model.辅石4重量 = row["辅石4重量"].ToString();
         //}
         //if (row["辅石4单价"] != null)
         //{
         //    model.辅石4单价 = row["辅石4单价"].ToString();
         //}
         //if (row["辅石4金额"] != null)
         //{
         //    model.辅石4金额 = row["辅石4金额"].ToString();
         //}
         //if (row["辅石5计价方式"] != null)
         //{
         //    model.辅石5计价方式 = row["辅石5计价方式"].ToString();
         //}
         //if (row["辅石5号"] != null)
         //{
         //    model.辅石5号 = row["辅石5号"].ToString();
         //}
         //if (row["辅石5名"] != null)
         //{
         //    model.辅石5名 = row["辅石5名"].ToString();
         //}
         //if (row["辅石5粒数"] != null)
         //{
         //    model.辅石5粒数 = row["辅石5粒数"].ToString();
         //}
         //if (row["辅石5重量"] != null)
         //{
         //    model.辅石5重量 = row["辅石5重量"].ToString();
         //}
         //if (row["辅石5单价"] != null)
         //{
         //    model.辅石5单价 = row["辅石5单价"].ToString();
         //}
         //if (row["辅石5金额"] != null)
         //{
         //    model.辅石5金额 = row["辅石5金额"].ToString();
         //}
         if (row["辅石总粒数"] != null)
         {
             model.辅石总粒数 = row["辅石总粒数"].ToString();
         }
         if (row["辅石总重量"] != null)
         {
             model.辅石总重量 = row["辅石总重量"].ToString();
         }
         if (row["加工费方式"] != null)
         {
             model.加工费方式 = row["加工费方式"].ToString();
         }
         if (row["加工费"] != null)
         {
             model.加工费 = row["加工费"].ToString();
         }
         //if (row["证书费"] != null)
         //{
         //    model.证书费 = row["证书费"].ToString();
         //}
         //if (row["其它费用名"] != null)
         //{
         //    model.其它费用名 = row["其它费用名"].ToString();
         //}
         //if (row["其他费方式"] != null)
         //{
         //    model.其他费方式 = row["其他费方式"].ToString();
         //}
         //if (row["其它费"] != null)
         //{
         //    model.其它费 = row["其它费"].ToString();
         //}
         //if (row["进货成本"] != null)
         //{
         //    model.进货成本 = row["进货成本"].ToString();
         //}
         //if (row["成本基数"] != null)
         //{
         //    model.成本基数 = row["成本基数"].ToString();
         //}
         //if (row["真实成本"] != null)
         //{
         //    model.真实成本 = row["真实成本"].ToString();
         //}
         if (row["市场成本"] != null)
         {
             model.市场成本 = row["市场成本"].ToString();
         }
         //if (row["销售倍率"] != null)
         //{
         //    model.销售倍率 = row["销售倍率"].ToString();
         //}
         if (row["售价"] != null)
         {
             model.售价 = row["售价"].ToString();
         }
         if (row["备注"] != null)
         {
             model.备注 = row["备注"].ToString();
         }
         //if (row["当前状态"] != null)
         //{
         //    model.当前状态 = row["当前状态"].ToString();
         //}
         //if (row["入库单号"] != null)
         //{
         //    model.入库单号 = row["入库单号"].ToString();
         //}
         //if (row["入库时间"] != null)
         //{
         //    model.入库时间 = row["入库时间"].ToString();
         //}
         //if (row["供应商"] != null)
         //{
         //    model.供应商 = row["供应商"].ToString();
         //}
         //if (row["退库单号"] != null)
         //{
         //    model.退库单号 = row["退库单号"].ToString();
         //}
         //if (row["退库时间"] != null)
         //{
         //    model.退库时间 = row["退库时间"].ToString();
         //}
         //if (row["发货单号"] != null)
         //{
         //    model.发货单号 = row["发货单号"].ToString();
         //}
         //if (row["发货时间"] != null)
         //{
         //    model.发货时间 = row["发货时间"].ToString();
         //}
         //if (row["分销商"] != null)
         //{
         //    model.分销商 = row["分销商"].ToString();
         //}
         //if (row["分销柜组"] != null)
         //{
         //    model.分销柜组 = row["分销柜组"].ToString();
         //}
         //if (row["退货单号"] != null)
         //{
         //    model.退货单号 = row["退货单号"].ToString();
         //}
         //if (row["退货时间"] != null)
         //{
         //    model.退货时间 = row["退货时间"].ToString();
         //}
         //if (row["销售单号"] != null)
         //{
         //    model.销售单号 = row["销售单号"].ToString();
         //}
         //if (row["销售时间"] != null)
         //{
         //    model.销售时间 = row["销售时间"].ToString();
         //}
         //if (row["销售客户"] != null)
         //{
         //    model.销售客户 = row["销售客户"].ToString();
         //}
         //if (row["原售价"] != null)
         //{
         //    model.原售价 = row["原售价"].ToString();
         //}
         //if (row["折扣率"] != null)
         //{
         //    model.折扣率 = row["折扣率"].ToString();
         //}
         //if (row["实售价"] != null)
         //{
         //    model.实售价 = row["实售价"].ToString();
         //}
         //if (row["销退单号"] != null)
         //{
         //    model.销退单号 = row["销退单号"].ToString();
         //}
         //if (row["销退时间"] != null)
         //{
         //    model.销退时间 = row["销退时间"].ToString();
         //}
         //if (row["调价单号"] != null)
         //{
         //    model.调价单号 = row["调价单号"].ToString();
         //}
         //if (row["调价时间"] != null)
         //{
         //    model.调价时间 = row["调价时间"].ToString();
         //}
         //if (row["盘点单号"] != null)
         //{
         //    model.盘点单号 = row["盘点单号"].ToString();
         //}
         //if (row["盘点时间"] != null)
         //{
         //    model.盘点时间 = row["盘点时间"].ToString();
         //}
         //if (row["调价顺序"] != null)
         //{
         //    model.调价顺序 = row["调价顺序"].ToString();
         //}
         //if (row["c0186"] != null)
         //{
         //    model.c0186 = row["c0186"].ToString();
         //}
         //if (row["公司品牌"] != null)
         //{
         //    model.公司品牌 = row["公司品牌"].ToString();
         //}
         //if (row["公司地址"] != null)
         //{
         //    model.公司地址 = row["公司地址"].ToString();
         //}
         //if (row["检测单位"] != null)
         //{
         //    model.检测单位 = row["检测单位"].ToString();
         //}
         //if (row["产地"] != null)
         //{
         //    model.产地 = row["产地"].ToString();
         //}
         //if (row["执行标准"] != null)
         //{
         //    model.执行标准 = row["执行标准"].ToString();
         //}
         //if (row["公司LOGOA"] != null)
         //{
         //    model.公司LOGOA = row["公司LOGOA"].ToString();
         //}
         //if (row["公司LOGOB"] != null)
         //{
         //    model.公司LOGOB = row["公司LOGOB"].ToString();
         //}
         //if (row["促销原价"] != null)
         //{
         //    model.促销原价 = row["促销原价"].ToString();
         //}
         //if (row["库存"] != null && row["库存"].ToString() != "")
         //{
         //    model.库存 = int.Parse(row["库存"].ToString());
         //}
         //if (row["售出"] != null && row["售出"].ToString() != "")
         //{
         //    model.售出 = int.Parse(row["售出"].ToString());
         //}
         if (row["种类"] != null)
         {
             model.种类 = row["种类"].ToString();
         }
         if (row["品种"] != null)
         {
             model.品种 = row["品种"].ToString();
         }
         if (row["编码"] != null)
         {
             model.编码 = row["编码"].ToString();
         }
         if (row["厂家"] != null)
         {
             model.厂家 = row["厂家"].ToString();
         }
         if (row["厂址"] != null)
         {
             model.厂址 = row["厂址"].ToString();
         }
         if (row["新增时间"] != null)
         {
             model.新增时间 = row["新增时间"].ToString();
         }
         if (row["编辑时间"] != null)
         {
             model.编辑时间 = row["编辑时间"].ToString();
         }
         if (row["产品大类名"] != null)
         {
             model.产品大类名 = row["产品大类名"].ToString();
         }
         if (row["产品名称"] != null)
         {
             model.产品名称 = row["产品名称"].ToString();
         }
         //if (row["状态"] != null)
         //{
         //    model.状态 = row["状态"].ToString();
         //}
     }
     return model;
 }
Esempio n. 3
0
        /// <summary>
        /// 更新商品
        /// </summary>
        /// <param name="GoodsCode"></param>
        private void UpdateGoods(string GoodsCode)
        {
            商品表Model = 商品表BLL.GetModel(GoodsCode);

            if (商品表Model != null)
            {
                txtCode.Text = 商品表Model.条码号.ToString();
                txtWeight.Text = 商品表Model.总件重.ToString();
                txtGoldWeight.Text = 商品表Model.净金重.ToString();
                cmdCatalog.Text = 商品表Model.产品大类名.ToString();
                lblCatalog.Text = 商品表Model.产品大类.ToString();
                cmbMaterialType.Text = 商品表Model.成色.ToString();
                cmbJewelType.Text = 商品表Model.主石名称.ToString();
                cmbJewelryType.Text = 商品表Model.首饰类别.ToString();
                txtStyleCode.Text = 商品表Model.款号.ToString();
                txtOldCode.Text = 商品表Model.原编号.ToString();
                txtCertCode.Text = 商品表Model.证书号.ToString();
                txtSize.Text = 商品表Model.手寸.ToString();
                cmbExtType.Text = 商品表Model.加工费方式.ToString();
                txtExtCharge.Text = 商品表Model.加工费.ToString();

                cmbZL.Text = 商品表Model.种类.ToString();
                cmbPZ.Text = 商品表Model.品种.ToString();
                cmbCJ.Text = 商品表Model.厂家.ToString();
                txtMemo.Text = 商品表Model.备注.ToString();

                //txtWeight.Text= 商品表Model.净金重;

                txtZSSL.Text = 商品表Model.主石粒数.ToString();
                txtZSZL.Text = 商品表Model.主石重.ToString();
                txtZSJE.Text = 商品表Model.主石金额.ToString();
                cmbColor.Text = 商品表Model.主石颜色.ToString();
                cmbClarity.Text = 商品表Model.主石净度.ToString();
                cmbCut.Text = 商品表Model.主石车工.ToString();

                txtFSSL.Text = 商品表Model.辅石总粒数.ToString();
                txtFSZL.Text = 商品表Model.辅石总重量.ToString();
                txtCost.Text = 商品表Model.市场成本.ToString();
                txtPrice.Text = 商品表Model.售价.ToString();
            }
        }