private void BtnAdd_Click(object sender, RoutedEventArgs e) { if (string.IsNullOrEmpty(txtCategoryID.Text)) { CPApplication.Current.CurrentPage.Context.Window.Alert(ResManufacturerIndexPageCategory.Msg_CategoryIDIsEmpty, MessageType.Warning); return; } int categodyID; if (!int.TryParse(txtCategoryID.Text, out categodyID)) { CPApplication.Current.CurrentPage.Context.Window.Alert(ResManufacturerIndexPageCategory.Msg_CategoryIDIsInvalid, MessageType.Warning); return; } var brandShipCategory = new BrandShipCategory(); int categoryID; int.TryParse(txtCategoryID.Text, out categoryID); brandShipCategory.BrandShipCategoryID = categoryID; brandShipCategory.ManufacturerSysNo = ManufacturerSysNo; if (brandShipCategory.BrandShipCategoryID != 0 && ManufacturerSysNo != 0) { var facade = new ManufacturerFacade(); facade.CreateBrandShipCategory(brandShipCategory, (obj, args) => { if (args.FaultsHandle()) { return; } CPApplication.Current.CurrentPage.Context.Window.Alert(ResManufacturerIndexPageCategory.Msg_AddSuccessfully); dgManufacturerIndexPageCategory.Bind(); }); } }
/// <summary> /// 创建旗舰店首页分类 /// </summary> /// <param name="brandShipCategory"></param> public int CreateBrandShipCategory(BrandShipCategory brandShipCategory) { DataCommand cmd = DataCommandManager.GetDataCommand("AddBrandShipCategory"); cmd.SetParameterValue("@ECC3SysNo", brandShipCategory.BrandShipCategoryID); cmd.SetParameterValue("@ManufacturerSysNo", brandShipCategory.ManufacturerSysNo); cmd.ExecuteNonQuery(); return((int)cmd.GetParameterValue("@Flag")); }
/// <summary> /// 创建旗舰店首页分类 /// </summary> /// <param name="brandShipCategory"></param> /// <returns></returns> public void CreateBrandShipCategory(BrandShipCategory brandShipCategory) { int result = _manufacturerDA.CreateBrandShipCategory(brandShipCategory); string message = string.Empty; switch (result) { case -1: message = ResouceManager.GetMessageString("IM.ResManufacturerIndexPageCategory", "Msg_CategoryIsNotExist"); throw new BizException(message); break; case -2: message = ResouceManager.GetMessageString("IM.ResManufacturerIndexPageCategory", "Msg_CategoryIsExist"); throw new BizException(message); break; default: break; } }
public void CreateBrandShipCategory(BrandShipCategory brandShipCategory) { ObjectFactory <ManufacturerAppService> .Instance.CreateBrandShipCategory(brandShipCategory); }
/// <summary> /// 创建旗舰店首页分类 /// </summary> /// <param name="brandShipCategory"></param> /// <returns></returns> public void CreateBrandShipCategory(BrandShipCategory brandShipCategory) { ObjectFactory <ManufacturerProcessor> .Instance.CreateBrandShipCategory(brandShipCategory); }
/// <summary> /// 添加旗舰店首页分类 /// </summary> /// <param name="sysNo"></param> /// <param name="callback"></param> public void CreateBrandShipCategory(BrandShipCategory brandShipCategory, EventHandler <RestClientEventArgs <BrandShipCategory> > callback) { _restClient.Create(CreateBrandShipCategoryRelativeUrl, brandShipCategory, callback); }