public DataDictBLL(IDataDictService dataDictService, DataDictCache dataDictCache, DataDictDetailCache dataDictDetailCache) { _dataDictService = dataDictService; _dataDictCache = dataDictCache; _dataDictDetailCache = dataDictDetailCache; }
private void btnDelCommonType_Click(object sender, EventArgs e) { int id = 0; Int32.TryParse(txtCommonTypeId.Text, out id); if (id == 0) { Msg.Warning("编号必须大于0!"); txtCommonTypeId.Focus(); return; } if (false == Msg.AskQuestion("确认要删除 '" + txtCommonTypeId.Text + "' 的记录!")) { return; } //删除字典类型 bool success = (_BLL as bllCommonDataDict).DeleteCommonType(txtCommonTypeId.Text); if (success) { DataDictCache.Cache.DeleteCacheRow(tb_t_CommDataDictType.__TableName, tb_t_CommDataDictType.__KeyName, txtCommonTypeId.Text); bllComDataBaseTool.WriteLogOp(_FunctionID, "0", "删除公共字典类型:" + txtCommonTypeName.Text + "(" + txtCommonTypeId.Text + ")"); DataDictCache.RefreshCache(); gcProfileClass.DataSource = DataDictCache.Cache.CommonDataDictType; DataBinder.BindingLookupEditDataSource(txtDataType, DataDictCache.Cache.CommonDataDictType, "FTYPENAME", "FID"); Msg.ShowInformation("删除成功!"); } }
protected override void InitializeForm() { _SummaryView = new DevGridView(gvSummary);//每个业务窗体必需给这个变量赋值. _ActiveEditor = txtCode; _KeyEditor = txtCode; _DetailGroupControl = gcDetailEditor; _BLL = new bllSUPPLIERCUSTOMER(); //业务逻辑实例 _BllCustomer = _BLL as bllSUPPLIERCUSTOMER; //本窗体引用 base.InitializeForm(); //绑定相关缓存数据 //search DataBinder.BindingLookupEditDataSource(txt_Attr, DataDictCache.GetCacheConfigData("COMPANYTYPE"), "NAME", "ID"); //summary DataBinder.BindingLookupEditDataSource(LookUpEdit_TYPE_CFG, DataDictCache.GetCacheConfigData("COMPANYTYPE"), "NAME", "ID"); DataBinder.BindingLookupEditDataSource(LookUpEdit_WAREHOUSEID, DataDictCache.GetCacheTableData("WAREHOUSE"), "NAME", "ID"); DataBinder.BindingLookupEditDataSource(LookUpEdit_COMPANYID, DataDictCache.GetCacheTableData("COMPANY"), "NAME", "ID"); //detail DataBinder.BindingLookupEditDataSource(lookUpEdit1_typecfg, DataDictCache.GetCacheConfigData("COMPANYTYPE"), "NAME", "ID"); DataBinder.BindingLookupEditDataSource(lookUpEdit1_warehouse, DataDictCache.GetCacheTableData("WAREHOUSE"), "NAME", "ID"); DataBinder.BindingLookupEditDataSource(lookUpEdit1_company, DataDictCache.GetCacheTableData("COMPANY"), "NAME", "ID"); }
public DataTable GetItemClass() { DataDictCache.RefreshCache(); _ClassSummaryTable = DataDictCache.Cache.ItemClass; SetDefault(_ClassSummaryTable); return(_ClassSummaryTable); }
private void frmModifyLog_Load(object sender, EventArgs e) { this.InitButtons(); txtDateTo.DateTime = DateTime.Today; DataTable BusinessTables = DataDictCache.GetCacheTableData("BUSINESSTABLE"); DataBinder.BindingLookupEditDataSource(cbBusiness, BusinessTables, "FormCaption", "FormName"); }
protected override void InitializeForm() { _SummaryView = new DevGridView(gvSummary);//给成员变量赋值.每个业务窗体必需给这个变量赋值. _ActiveEditor = txtCode; _DetailGroupControl = gcDetailEditor; _BLL = new bllSTACKER(); base.InitializeForm(); BindingSummarySearchPanel(btnQuery, btnEmpty, panelSearch);//绑定搜索面板 DataBinder.BindingLookupEditDataSource(S_ROADWAYID, DataDictCache.GetCacheTableData("ROADWAY"), "NAME", "ID"); DataBinder.BindingLookupEditDataSource(E_ROADWAYID, DataDictCache.GetCacheTableData("ROADWAY"), "NAME", "ID"); DataBinder.BindingLookupEditDataSource(R_ROADWAYID, DataDictCache.GetCacheTableData("ROADWAY"), "NAME", "ID"); }
private void btnAddCommonType_Click(object sender, EventArgs e) { if (false == ValidateCommonType()) { return; } //增加一个字典类型 bool success = (_BLL as bllCommonDataDict).AddCommonType(txtCommonTypeId.Text, txtCommonTypeName.Text); if (success) { DataDictCache.RefreshCache(); Msg.ShowInformation("新增成功!"); } }
protected override void InitializeForm() { _SummaryView = new DevGridView(gvSummary);//每个业务窗体必需给这个变量赋值. _ActiveEditor = txtCODE; _KeyEditor = txtCODE; _DetailGroupControl = gcDetailEditor; _BLL = new bllZONE(); //业务逻辑实例 _BllInstance = _BLL as bllZONE; //本窗体引用 base.InitializeForm(); BindingSummarySearchPanel(btnQuery, btnEmpty, panelSearch);//绑定搜索面板 DataBinder.BindingLookupEditDataSource(S_WAREHOUSEID, DataDictCache.GetCacheTableData("WAREHOUSE"), "NAME", "ID"); DataBinder.BindingLookupEditDataSource(lookUpEdit1, DataDictCache.GetCacheTableData("WAREHOUSE"), "NAME", "ID"); DataBinder.BindingLookupEditDataSource(repositoryItemLookUpEdit1, DataDictCache.GetCacheTableData("WAREHOUSE"), "NAME", "ID"); }
protected override void InitializeForm() { _SummaryView = new DevGridView(gvSummary);//每个业务窗体必需给这个变量赋值. _ActiveEditor = txtPcode; _KeyEditor = txtPcode; _DetailGroupControl = gcDetailEditor; _BLL = new bllITEM(); //业务逻辑实例 _BllInstance = _BLL as bllITEM; //本窗体引用 base.InitializeForm(); DataBinder.BindingLookupEditDataSource(repositoryItemLookUpEdit_W, DataDictCache.GetCacheTableData("WAREHOUSE"), "NAME", "ID"); DataBinder.BindingLookupEditDataSource(repositoryItemLookUpEdit_C, DataDictCache.GetCacheTableData("COMPANY"), "NAME", "ID"); DataBinder.BindingLookupEditDataSource(lookUpEdit1_warehouse, DataDictCache.GetCacheTableData("WAREHOUSE"), "NAME", "ID"); DataBinder.BindingLookupEditDataSource(lookUpEdit1_company, DataDictCache.GetCacheTableData("COMPANY"), "NAME", "ID"); }
private void btnAddCommonType_Click(object sender, EventArgs e) { if (false == ValidateCommonType()) { return; } string sfid = bllComDataBaseTool.GetTableID(tb_t_CommDataDictType.__TableName, tb_t_CommDataDictType.__KeyName); //增加一个字典类型 bool success = (_BLL as bllCommonDataDict).AddCommonType(sfid, txtCommonTypeId.Text, txtCommonTypeName.Text); if (success) { DataDictCache.RefreshCache(tb_t_CommDataDictType.__TableName); bllComDataBaseTool.WriteLogOp(_FunctionID, "0", "新增公共字典类型:" + txtCommonTypeName.Text + "(" + txtCommonTypeId.Text + ")"); DataDictCache.RefreshCache(); gcProfileClass.DataSource = DataDictCache.Cache.CommonDataDictType; DataBinder.BindingLookupEditDataSource(txtDataType, DataDictCache.Cache.CommonDataDictType, "FTYPENAME", "FID"); Msg.ShowInformation("新增成功!"); } }
protected override void InitializeForm() { _SummaryView = new DevGridView(gvSummary);//每个业务窗体必需给这个变量赋值. //_ActiveEditor = txtCODE; //_KeyEditor = txtCODE; _DetailGroupControl = gcDetailEditor; _BLL = new bllITEM_PALLET_CAPACITY(); //业务逻辑实例 _BllInstance = _BLL as bllITEM_PALLET_CAPACITY; //本窗体引用 base.InitializeForm(); BindingSummarySearchPanel(btnQuery, btnEmpty, panelSearch);//绑定搜索面板 DataBinder.BindingLookupEditDataSource(S_PALLETSPECID, DataDictCache.GetCacheTableData("PALLETSPEC"), "NAME", "ID"); DataBinder.BindingLookupEditDataSource(E_PALLETSPECID, DataDictCache.GetCacheTableData("PALLETSPEC"), "NAME", "ID"); DataBinder.BindingLookupEditDataSource(R_PALLETSPECID, DataDictCache.GetCacheTableData("PALLETSPEC"), "NAME", "ID"); DataBinder.BindingLookupEditDataSource(E_ITEMID, DataDictCache.GetCacheTableData("ITEM"), "NAME", "ID"); DataBinder.BindingLookupEditDataSource(S_ITEMID, DataDictCache.GetCacheTableData("ITEM"), "NAME", "ID"); DataBinder.BindingLookupEditDataSource(R_ITEMID, DataDictCache.GetCacheTableData("ITEM"), "NAME", "ID"); }
private string GetAttributeName(string attributeCodes) { string[] codes = attributeCodes.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries); string item; StringBuilder sb = new StringBuilder(); foreach (string code in codes) { item = code; string filter = tb_CustomerAttribute.AttributeCode + "='" + code + "'"; DataRow[] rows = DataDictCache.GetCacheTableData("COMPANYTYPE").Select(filter); if (rows.Length > 0) { item = item + "=" + rows[0][tb_CustomerAttribute.NativeName].ToString(); } sb.Append(item + ","); } return(sb.ToString()); }
//重写保存功能 public override void DoSave(IButtonInfo sender) { UpdateLastControl(); //更新最后一个输入控件的数据 string sDesc = ""; if (!ValidatingData()) { return; //检查输入完整性 } //调用UpdateEx扩展方法提交数据,由后台生成主键并返回到客户端。 SaveResultEx ret = _BLL.UpdateEx(_UpdateType);//调用业务逻辑层的Update方法提交数据 if (_UpdateType == UpdateType.Add) { sDesc = "新增数据字典"; } else { sDesc = "修改数据字典"; } if (ret.Success) { _BLL.DataBinder.Rows[0][tb_t_CommonDataDict.FDataCode] = ret.PrimaryKey; //生成的主键 this.UpdateSummaryRow(_BLL.DataBinder.Rows[0]); //刷新表格内的数据. this._UpdateType = UpdateType.None; this.SetViewMode(); this.ShowDetailPage(false); this.ButtonStateChanged(_UpdateType); bllComDataBaseTool.WriteLogOp(_FunctionID, "0", sDesc + _BLL.DataBinder.Rows[0][tb_t_CommonDataDict.FNativeName].ToString() + "(" + _BLL.DataBinder.Rows[0][tb_t_CommonDataDict.FDataCode].ToString() + ")"); DataDictCache.RefreshCache(); gcSummary.DataSource = DataDictCache.Cache.CommonDataDict; Msg.ShowInformation("保存成功!"); } else { Msg.Warning("保存失败!"); } }
/// <summary> /// 初始化MDI主窗体,在登录窗体显示加载状态。 /// </summary> /// <param name="splash">登录窗体上的进度显示组件</param> public void InitUserInterface(IMsg splash) { try { this.SuspendLayout(); splash.UpdateMessage("正在初始化用户界面..."); this._MdiToolbar = new DevBarRegister(this, this.barToolButtons); this.RegisterMdiButtons(); splash.UpdateMessage("下载基础数据..."); CommonData.GetCommonInfos(); //获取其它公共数据 DataDictCache.RefreshCache(); splash.UpdateMessage("正在初始化模块容器..."); _ModuleContainer = (frmModuleContainer)MdiTools.OpenChildForm(this as IMdiForm, typeof(frmModuleContainer), null); _ModuleContainer.InitButtons(); splash.UpdateMessage("正在加载模块..."); _ModuleManager = new ModuleManager(this, _ModuleContainer.xtraTabControl1); //创建模块管理器 _ModuleManager.LoadModules(splash, _moduleMenus); //加载可用模块 splash.UpdateMessage("正在初始化用户权限..."); SystemAuthentication.SetMenuAuthority(_moduleMenus); _ModuleManager.SetModuleSecurity(_moduleMenus); splash.UpdateMessage("正在加载工具栏(Toolbar)..."); _ModuleManager.CreateToolButtons(barMainMenu, _moduleMenus); splash.UpdateMessage("正在加载导航面板(Navigator Panel)..."); _ModuleManager.CreateNavBarButtons(this.navBarControl1, _moduleMenus, NavigatorStyle.BarContainer); //创建导航工具栏按钮 splash.UpdateMessage("加载完毕."); this.ResumeLayout(); } catch (Exception ex) { Msg.ShowException(ex); } }
/// <summary> /// 保存基础资料名称 /// </summary> private void DoSaveClass(IButtonInfo sender) { UpdateLastControl(); //更新最后一个输入控件的数据 string sDesc = ""; if (!ValidatingDataClass()) { return; //检查输入完整性 } //调用UpdateEx扩展方法提交数据,由后台生成主键并返回到客户端。 SaveResultEx ret = _BLL.UpdateClassEx(_UpdateType);//调用业务逻辑层的Update方法提交数据 if (_UpdateType == UpdateType.Add) { sDesc = "新增基础数据"; } else { sDesc = "修改基础数据"; } if (ret.Success) { this.UpdateClassSummaryRow(_BLL._ClassDataBinder.Rows[0]); //刷新表格内的数据. this._UpdateType = UpdateType.None; this.SetViewMode(); this.ShowDetailPageClass(false); this.ButtonStateChanged(_UpdateType); bllComDataBaseTool.WriteLogOp(_FunctionID, "0", sDesc + _BLL._ClassDataBinder.Rows[0][tb_t_ItemClass.FName].ToString() + "(" + _BLL._ClassDataBinder.Rows[0][tb_t_ItemClass.FNumber].ToString() + ")"); DataDictCache.RefreshCache(); gcProfileClass.DataSource = DataDictCache.Cache.ItemClass; //_BLL.ClassSummaryTable = DataDictCache.Cache.ItemClass; Msg.ShowInformation("保存成功!"); } else { Msg.Warning("保存失败!"); } }
protected override void InitializeForm() { _SummaryView = new DevGridView(gvSummary);//给成员变量赋值.每个业务窗体必需给这个变量赋值. _ActiveEditor = txtCode; _DetailGroupControl = gcDetailEditor; _BLL = new bllPALLET(); base.InitializeForm(); BindingSummarySearchPanel(btnQuery, btnEmpty, panelSearch);//绑定搜索面板 DataBinder.BindingLookupEditDataSource(txt_Spec, DataDictCache.GetCacheTableData("PALLETSPEC"), "NAME", "ID"); DataBinder.BindingLookupEditDataSource(rItemLookUpEdit_Spec, DataDictCache.GetCacheTableData("PALLETSPEC"), "NAME", "ID"); DataBinder.BindingLookupEditDataSource(lookUpEdit1, DataDictCache.GetCacheTableData("PALLETSPEC"), "NAME", "ID"); DataBinder.BindingLookupEditDataSource(lookUpEdit8, DataDictCache.GetCacheTableData("PALLETSPEC"), "NAME", "ID"); DataBinder.BindingLookupEditDataSource(lookUpEdit2, DataDictCache.GetCacheConfigData("PALLET_STATUS"), "NAME", "ID"); DataBinder.BindingLookupEditDataSource(txtPalletStatus, DataDictCache.GetCacheConfigData("PALLET_STATUS"), "NAME", "ID"); DataBinder.BindingLookupEditDataSource(rItemLookUpEdit_status, DataDictCache.GetCacheConfigData("PALLET_STATUS"), "NAME", "ID"); labelAdmin.Visible = Loginer.CurrentUser.IsAdmin(); }
protected override void InitializeForm() { _SummaryView = new DevGridView(gvSummary);//每个业务窗体必需给这个变量赋值. _ActiveEditor = txtCODE; _KeyEditor = txtCODE; _DetailGroupControl = gcDetailEditor; _BLL = new bllWARECELL(); //业务逻辑实例 _BllInstance = _BLL as bllWARECELL; //本窗体引用 base.InitializeForm(); BindingSummarySearchPanel(btnQuery, btnEmpty, panelSearch);//绑定搜索面板 DataBinder.BindingLookupEditDataSource(R_PALLETID, DataDictCache.GetCacheTableData("PALLET"), "NAME", "ID"); DataBinder.BindingLookupEditDataSource(R_ROADWAYID, DataDictCache.GetCacheTableData("ROADWAY"), "NAME", "ID"); DataBinder.BindingLookupEditDataSource(R_STATUS_CFG, DataDictCache.GetCacheConfigData("WARECELL_STATUS"), "NAME", "ID"); DataBinder.BindingLookupEditDataSource(R_WARECELLSPECID, DataDictCache.GetCacheTableData("WARECELLSPEC"), "NAME", "ID"); DataBinder.BindingLookupEditDataSource(R_ZONEID, DataDictCache.GetCacheTableData("ZONE"), "NAME", "ID"); DataBinder.BindingLookupEditDataSource(S_PALLETID, DataDictCache.GetCacheTableData("PALLET"), "NAME", "ID"); DataBinder.BindingLookupEditDataSource(S_ROADWAYID, DataDictCache.GetCacheTableData("ROADWAY"), "NAME", "ID"); DataBinder.BindingLookupEditDataSource(S_STATUS_CFG, DataDictCache.GetCacheConfigData("WARECELL_STATUS"), "NAME", "ID"); DataBinder.BindingLookupEditDataSource(S_WARECELLSPECID, DataDictCache.GetCacheTableData("WARECELLSPEC"), "NAME", "ID"); DataBinder.BindingLookupEditDataSource(S_ZONEID, DataDictCache.GetCacheTableData("ZONE"), "NAME", "ID"); DataBinder.BindingLookupEditDataSource(E_PALLETID, DataDictCache.GetCacheTableData("PALLET"), "NAME", "ID"); DataBinder.BindingLookupEditDataSource(E_ROADWAYID, DataDictCache.GetCacheTableData("ROADWAY"), "NAME", "ID"); DataBinder.BindingLookupEditDataSource(E_STATUS_CFG, DataDictCache.GetCacheConfigData("WARECELL_STATUS"), "NAME", "ID"); DataBinder.BindingLookupEditDataSource(E_WARECELLSPECID, DataDictCache.GetCacheTableData("WARECELLSPEC"), "NAME", "ID"); DataBinder.BindingLookupEditDataSource(E_ZONEID, DataDictCache.GetCacheTableData("ZONE"), "NAME", "ID"); DataBinder.BindingLookupEditDataSource(P_WARECELLSPECID, DataDictCache.GetCacheTableData("WARECELLSPEC"), "NAME", "ID"); DataBinder.BindingLookupEditDataSource(P_ZONEID, DataDictCache.GetCacheTableData("ZONE"), "NAME", "ID"); labelAdmin.Visible = Loginer.CurrentUser.IsAdmin(); }