/// <summary> /// 载入数据 /// </summary> /// <param name="info">BEProductDataInfo结构</param> private void LoadProductData(ProductData data) { this.m_id = data.id; this.HuoHao = data.huohao; this.DengJi_Id = data.dengji_id; this.MadePlace_Id = data.madeplace_id; this.PartName_Id = data.partname_id; this.SafeData_Id = data.safedata_id; this.StandardData_Id = data.standarddata_id; this.m_price = data.price; this.m_memo = data.memo; this.m_pwash = data.pwash == 1 ? true : false; this.m_tag_id = data.tag_id; this.m_wash_id = data.wash_id; this.m_lastamp = data.lastamp; this.m_pbad = data.pbad == 1 ? true : false; this.m_ptemplate = data.ptemplate == 1 ? true : false; this.m_wash_u = data.wash_u; this.m_template_data = data.template_data; this.Color_Id = (int)data.color_id; this.m_gyear = data.gyear; this.m_gmonth = data.gmonth; //加载EAN13信息 using (ProductContext ctx = new ProductContext()) { var ean13_data = from mater in ctx.BarcodeInfo where mater.product_id == this.m_id orderby mater.size_name select mater; foreach(var obj in ean13_data) { EAN13DataInfo info = new EAN13DataInfo(); info.Id = obj.id; info.SizeName = obj.size_name; info.BarcodeType = obj.barcode; info.Memo = obj.memo; this.m_ean13_data_list.Add(info); } } using (ProductContext ctx = new ProductContext()) { //洗唛宽度 this.m_wash_size = (from product in ctx.ProductData where product.id == this.m_id select product.WashPrintTemplate.daxiao).FirstOrDefault(); //处理成份信息 var materialData_entity = from mater in ctx.MaterialData where mater.product_id == this.m_id orderby mater.order_index select mater; foreach(var obj in materialData_entity) { MaterialDataInfo info = new MaterialDataInfo(); info.Id = obj.id; info.Type = obj.type; info.Sel = obj.sel; info.Memo = obj.memo; this.m_material_data_list.Add(info); } /*******************************************************/ //处理填充信息 var fill_entity = from fill in ctx.MaterialFill where fill.product_id == this.m_id orderby fill.size_name select fill; foreach(var obj in fill_entity) { UpdataMaterialFillList(obj.size_name, obj.fill); } this.MaterialFillInfo.material_type = (from fill in ctx.MaterialFill where fill.product_id == this.m_id select fill.type).FirstOrDefault(); //处理打印模板信息 } this.m_tagCODE93_filename = string.Format("{0}\\{1}", ConfigurationManager.AppSettings["Template"], GetTagFileName()); //this.m_wash_filename = string.Format("{0}\\{1}", ConfigurationManager.AppSettings["Template"], GetWashFileName()); this.m_wash_filename = string.Format("{0}\\{1}", ConfigurationManager.AppSettings["Template"],GetWashFileNameById(this.Wash_Id)); this.m_tagEAN13_filename = string.Format("{0}\\13{1}", ConfigurationManager.AppSettings["Template"], GetTagFileName()); }
public void UpdateEAN13Info(string m_sizename,string m_ean13,string m_memo) { bool bfind = false; foreach(var obj in this.m_ean13_data_list) { if(obj.SizeName == m_sizename) { obj.BarcodeType = m_ean13; bfind = true; break; } } if(!bfind) { EAN13DataInfo info = new EAN13DataInfo(); info.SizeName = m_sizename; info.BarcodeType = m_ean13; info.Memo = m_memo; this.m_ean13_data_list.Add(info); } }