public ProductEntity ByProductNameGetInfo(ProductEntity entity) { CustomDataCommand command = DataCommandManager.CreateCustomDataCommandFromConfig("ByProductNameGetInfo"); command.SetParameterValue("@ProductName", entity.ProductName); command.SetParameterValue("@SysNo", entity.SysNo); ProductEntity result = command.ExecuteEntity<ProductEntity>(); return result; }
public int ByProductNameGetInfo(string productName, string sysno) { int SysNo; int.TryParse(sysno, out SysNo); ProductEntity entity = new ProductEntity() { ProductName = productName, SysNo = SysNo }; ProductEntity cheEntity = ProductFacade.ByProductNameGetInfo(entity); if (cheEntity == null || cheEntity.SysNo == 0) { return 1; } return 0; }
public int Create(ProductEntity obj) { obj.InDate = DateTime.Now; obj.InUser = WebContext.LoginUser.UserName; obj.Status = 0; if (obj.SysNo == 0) { return ProductFacade.InsertProduct(obj); } else { return ProductFacade.UpdateProduct(obj); } }
public int InsertProduct(ProductEntity entity) { CustomDataCommand command = DataCommandManager.CreateCustomDataCommandFromConfig("InsertProduct"); command.SetParameterValue("@ProductTypeSysNo", entity.ProductTypeSysNo); command.SetParameterValue("@ProductName", entity.ProductName); command.SetParameterValue("@Price", entity.Price); command.SetParameterValue("@Weight", entity.Weight); command.SetParameterValue("@Mdient", entity.Mdient); command.SetParameterValue("@Sdient", entity.Sdient); command.SetParameterValue("@Method", entity.Method); command.SetParameterValue("@Order", entity.Order); command.SetParameterValue("@SmallImageUrl", entity.SmallImageUrl); command.SetParameterValue("@BigImageUrl", entity.BigImageUrl); command.SetParameterValue("@Status", entity.Status); command.SetParameterValue("@InUser", entity.InUser); command.SetParameterValue("@InDate", entity.InDate); object obj = command.ExecuteScalar(); if (obj != null) return Convert.ToInt32(obj); else return 0; }
/// <summary> /// /// </summary> /// <param name="log"></param> public static int UpdateProduct(ProductEntity entity) { return RestClient.Post<int>("ProductService/UpdateProduct", entity); }
/// <summary> /// /// </summary> /// <param name="log"></param> public static int InsertProduct(ProductEntity entity) { return RestClient.Post<int>("ProductService/InsertProduct", entity); }
/// <summary> /// /// </summary> /// <param name="log"></param> public static ProductEntity ByProductNameGetInfo(ProductEntity entity) { return RestClient.Post<ProductEntity>("ProductService/ByProductNameGetInfo", entity); }
public int UpdateProduct(ProductEntity entity) { return ObjectFactory<IProductDataAccess>.Instance.UpdateProduct(entity); }
public ProductEntity ByProductNameGetInfo(ProductEntity entity) { return ObjectFactory<IProductDataAccess>.Instance.ByProductNameGetInfo(entity); }
public int UpdateProduct(ProductEntity entity) { CustomDataCommand command = DataCommandManager.CreateCustomDataCommandFromConfig("UpdateProduct"); command.SetParameterValue("@SysNo", entity.SysNo); command.SetParameterValue("@ProductTypeSysNo", entity.ProductTypeSysNo); command.SetParameterValue("@ProductName", entity.ProductName); command.SetParameterValue("@Price", entity.Price); command.SetParameterValue("@Weight", entity.Weight); command.SetParameterValue("@Mdient", entity.Mdient); command.SetParameterValue("@Sdient", entity.Sdient); command.SetParameterValue("@Method", entity.Method); command.SetParameterValue("@Order", entity.Order); command.SetParameterValue("@SmallImageUrl", entity.SmallImageUrl); command.SetParameterValue("@BigImageUrl", entity.BigImageUrl); command.SetParameterValue("@Status", entity.Status); command.SetParameterValue("@InUser", entity.InUser); command.SetParameterValue("@InDate", entity.InDate); return command.ExecuteNonQuery(); }