//CreateProductComprison public string CreateProductComprison(ProductCropModel productmapinstance) { string id = base.GetGlobalId(); string buyerid = productmapinstance.BuyerID; string productid = string.IsNullOrEmpty(productmapinstance.ProductID) ? "" : productmapinstance.ProductID; string salerid = productmapinstance.SalerID; string senderid = productmapinstance.SenderID; string factoryid = productmapinstance.FactoryID; string code = productmapinstance.Code; string modecode = productmapinstance.ModeCode; string modename = productmapinstance.ModeName; string name = productmapinstance.Name; int packagerate = int.Parse(productmapinstance.PackageRate); string producer = productmapinstance.Producer; string producercode = productmapinstance.ProducerCode; string remark = productmapinstance.Remark; string speccode = productmapinstance.SpecCode; string specname = productmapinstance.SpecName; string specunit = productmapinstance.SpecUnit; string specunitcode = productmapinstance.SpecUnitCode; int standrate = int.Parse(productmapinstance.StandRate); string useunit = productmapinstance.UseUnit; string useunitcode = productmapinstance.UseUnitCode; string read = productmapinstance.Read; StringBuilder sqlstr = new StringBuilder(); sqlstr.AppendFormat("insert into gpo_PRODUCT_MAP (ID,PRODUCT_ID,map_orgtype,MAP_ORGID,FACTORY_ID,SALER_ID,SENDER_ID,SPEC_UNIT,PACKAGE_RATE,MODE_NAME,REMARK,SPEC_UNIT_ID,STAND_RATE,MODE_ID,FACTORY_NAME,FACTORY_CODE,USE_UNIT,USE_UNIT_ID,MEDICAL_SPEC,MEDICAL_SPEC_ID,PRODUCT_NAME,PRODUCT_CODE,PROCESS_FLAG) values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}','{12}','{13}','{14}','{15}','{16}', '{17}','{18}','{19}','{20}','{21}','{22}')", id, productid, '1', buyerid, factoryid, salerid, senderid, specunit, packagerate, modename, remark, specunitcode, standrate, modecode, producer, producercode, useunit, useunitcode, specname, speccode, name, code, read); base.DbFacade.SQLExecuteNonQuery(sqlstr.ToString()); return(id); }
/// <summary> /// 加入药品匹配表 /// </summary> /// <param name="productmapinstance"></param> /// <returns></returns> public void AddProductMap(ProductCropModel productmapinstance) { bool flag = ProductCodeCompareDAL.GetInstance().JudgeProductCode(productmapinstance.Code, productmapinstance.SalerID); if (!flag) { ProductCodeCompareDAL.GetInstance().CreateProductComprison(productmapinstance); } else { ProductCodeCompareDAL.GetInstance().UpdateComparison(productmapinstance); } }
private ProductCropModel setProduct(DataGridViewRow dgvr) { ProductCropModel model = new ProductCropModel(); model.Code = getDgvData(dgvr.Cells["PRODUCT_CODE"]); model.Name = dgvr.Cells["PRODUCT_NAME"].Value.ToString(); model.ModeName = getDgvData(dgvr.Cells["MEDICAL_MODE"]); model.SpecName = getDgvData(dgvr.Cells["MEDICAL_SPEC"]); model.SpecUnit = getDgvData(dgvr.Cells["SPEC_UNIT"]); model.ProducerCode = getDgvData(dgvr.Cells["FACTORY_CODE"]); model.Producer = getDgvData(dgvr.Cells["FACTORY_NAME"]); model.BuyerID = base.CurrentUserOrgId; return(model); }
/// <summary> /// 修改产品编码匹配关系 /// </summary> /// <param name="productmapinstance"></param> public void UpdateComparison(ProductCropModel productmapinstance) { string id = productmapinstance.ID; string buyerid = productmapinstance.BuyerID; string productid = productmapinstance.ProductID; string salerid = productmapinstance.SalerID; string senderid = productmapinstance.SenderID; string factoryid = productmapinstance.FactoryID; string code = productmapinstance.Code; string modename = productmapinstance.ModeName; string name = productmapinstance.Name; int packagerate = int.Parse(productmapinstance.PackageRate); string producer = productmapinstance.Producer; string remark = productmapinstance.Remark; string specname = productmapinstance.SpecName; string specunit = productmapinstance.SpecUnit; int standrate = int.Parse(productmapinstance.StandRate); string useunit = productmapinstance.UseUnit; string read = productmapinstance.Read; StringBuilder sqlstr = new StringBuilder("update GPO_PRODUCT_MAP"); sqlstr.AppendFormat(" set PRODUCT_ID='{0}'", productid); sqlstr.AppendFormat(",MAP_ORGID='{0}'", buyerid); sqlstr.AppendFormat(",FACTORY_ID='{0}'", factoryid); sqlstr.AppendFormat(",SALER_ID='{0}'", salerid); sqlstr.AppendFormat(",SENDER_ID='{0}'", senderid); sqlstr.AppendFormat(",MODE_NAME='{0}'", modename); sqlstr.AppendFormat(",PRODUCT_NAME='{0}'", name); sqlstr.AppendFormat(",PACKAGE_RATE='{0}'", packagerate); sqlstr.AppendFormat(",FACTORY_NAME='{0}'", producer); sqlstr.AppendFormat(",REMARK='{0}'", remark); sqlstr.AppendFormat(",MEDICAL_SPEC='{0}'", specname); sqlstr.AppendFormat(",SPEC_UNIT='{0}'", specunit); sqlstr.AppendFormat(",STAND_RATE='{0}'", standrate); sqlstr.AppendFormat(",USE_UNIT='{0}'", useunit); sqlstr.AppendFormat(",PROCESS_FLAG='{0}'", read); sqlstr.AppendFormat(" where PRODUCT_CODE='{0}' and MAP_ORGID='{1}' and id='{2}'", code, buyerid, id); base.DbFacade.SQLExecuteNonQuery(sqlstr.ToString()); }