public PackageView(PackageData packageData) { new SpaceView(2).AddTo(this); new LabelView(packageData.Name).FontBold().Width(150).AddTo(this); new LabelView(packageData.version).TextMiddleCenter().Width(80).AddTo(this); var installedPackage = InstalledPackageVersions.FindVersionByName(packageData.Name); new LabelView(installedPackage != null ? installedPackage.Version : " ").TextMiddleCenter().Width(80) .AddTo(this); new LabelView(packageData.AccessRight.ToString()).TextMiddleCenter().Width(80).AddTo(this); if (!string.IsNullOrEmpty(packageData.DocUrl)) { new ButtonView(LocaleText.Doc, () => { }).AddTo(this); } else { new SpaceView(40).AddTo(this); } // 数据绑定 var bindingSet = BindKit.CreateBindingSet(this, new PackageViewModel()); if (installedPackage == null) { bindingSet.Bind(new ButtonView(LocaleText.Import).Width(90).AddTo(this)) .For(v => v.OnClick) .To(vm => vm.Import) .CommandParameter(packageData); } else if (packageData.VersionNumber > installedPackage.VersionNumber) { bindingSet.Bind(new ButtonView(LocaleText.Update).Width(90).AddTo(this)) .For(v => v.OnClick) .To(vm => vm.Update) .CommandParameter(packageData); } else if (packageData.VersionNumber == installedPackage.VersionNumber) { bindingSet.Bind(new ButtonView(LocaleText.Reimport).Width(90).AddTo(this)) .For(v => v.OnClick) .To(vm => vm.Reimport) .CommandParameter(packageData); } else if (packageData.VersionNumber < installedPackage.VersionNumber) { new SpaceView(94).AddTo(this); } bindingSet.Bind(new ButtonView(LocaleText.ReleaseNotes).AddTo(this)) .For(v => v.OnClick) .To(vm => vm.OpenReadme) .CommandParameter(packageData); bindingSet.Build(); }
private void BindData() { string whereString = ""; string key = this.txtKeywords.Text.FormatSqlParm(); if (!string.IsNullOrEmpty(this.ddlDictGroup.SelectedValue)) { whereString = string.Format("`GroupCode`='{0}'", this.ddlDictGroup.SelectedValue); } if (!string.IsNullOrEmpty(key)) { if (!string.IsNullOrEmpty(whereString)) { whereString += " AND "; } whereString += string.Format("(Name LIKE '%{0}%' OR Code LIKE '%{0}%')", key); } int count = _bus.RecordCount(whereString); this.NPager1.PageSize = 10; this.NPager1.RecordCount = count; this.list.DataSource = _bus.GetDictItemData(this.NPager1.CurrentPage, this.NPager1.PageSize, this.ddlDictGroup.SelectedValue, this.txtKeywords.Text); this.list.DataBind(); BindKit.BindOnClientClick(this.list, "Delete", "return confirm('确定要删除吗?');"); }
protected void btnSave_Click(object sender, EventArgs e) { if (Page.IsValid) { this.CurName.Text = ""; var data = _bus.CreateModel(); BindKit.FillModelFromContainer(this.editor, data); if (this.Id.Value == "") { data.FullName = data.Alias; data.ParentId = 0; data.RootId = 0; data.Path = ""; data.Level = 0; data.IsDel = 0; data.Creator = this.CurrentUserName; data.CreateDate = DateTime.Now; _bus.Insert(data); } else { data.FullName = data.FullName.IndexOf("/") > -1 ? data.FullName.Substring(0, data.FullName.LastIndexOf("/")) + "/" + data.Alias : data.Alias; _bus.Update(data, null); } ClearControls(); BindData(); this.promptControl.ShowSuccess("保存成功!"); } }
protected void btnSave_Click(object sender, EventArgs e) { if (Page.IsValid) { var data = _bus.CreateModel(); BindKit.FillModelFromContainer(this.editor, data); if (this.Id.Value == "") { data.ParentId = 0; data.RootId = 0; data.Path = ""; data.Depth = 0; data.IsExternal = 0; data.IsEnabled = 1; data.IsDel = 0; data.Creator = this.CurrentUserName; data.CreateDate = DateTime.Now; _bus.Insert(data); } else { _bus.Update(data, null); } ClearControls(); BindData(); this.promptControl.ShowSuccess("保存成功!"); } }
protected void btnSave_Click(object sender, EventArgs e) { if (Page.IsValid) { var model = _bus.CreateModel(); //model.Value = this.Value.Color; if (this.GroupCode.Text == "机场") { if (string.IsNullOrEmpty(Memo.Text)) { this.promptControl.ShowError("请在备注栏填写机场的三位码!"); } } BindKit.FillModelFromContainer(this.container, model); if (this.Id.Value == "") { model.Creator = this.CurrentUserName; model.CreateDate = DateTime.Now; _bus.Insert(model); } else { _bus.Update(model, null); } this.promptControl.ShowSuccess("保存成功!"); } }
private void BindData() { var userId = WebParmKit.GetRequestString("key", 0); if (userId > 0) { var model = _userBus.QueryModel("Id=" + userId); if (model != null) { BindKit.BindModelToContainer(this.editor, model); //this.Account.ReadOnly = true; var data = _dataBus.QueryModel("UserAccount='" + model.Account + "'"); if (data != null) { BindKit.BindModelToContainer(this.editor, data); this.Id.Value = model.Id.ToString(); } } } BindKit.BindToListControl(this.Partner, _dibbus.Query(" GroupCode ='partner' and IsEnabled =1"), "Name", "Name"); }
private void BindData() { var userId = WebParmKit.GetRequestString("key", 0); if (userId > 0) { var model = _userBus.QueryModel("Id=" + userId); if (model != null) { BindKit.BindModelToContainer(this.editor, model); var data = _dataBus.QueryModel("UserAccount='" + model.Account + "'"); if (data != null) { BindKit.BindModelToContainer(this.editor, data); this.Id.Value = model.Id.ToString(); } this._userOrg.Visible = true; this._userRole.Visible = true; } } else { this._userOrg.Visible = false; this._userRole.Visible = false; } }
private void BindData() { int dataId = WebParmKit.GetRequestString("key", 0); if (dataId > 0) { string whereString = "GroupCode='" + this.GroupCode + "' and Id=" + dataId; var model = _infoBus.QueryModel(whereString); if (model != null) { BindKit.BindModelToContainer(this.editor, model); this.InfoTitle.Text = model.Title; ShowThumb(model.Thumb); } } if (Request.QueryString["m"] == "content") { string whereString = "GroupCode='" + this.GroupCode + "'"; var model = _infoBus.QueryModel(whereString); if (model != null) { BindKit.BindModelToContainer(this.editor, model); this.InfoTitle.Text = model.Title; } } }
protected void btnSave_Click(object sender, EventArgs e) { if (Page.IsValid) { var model = _bus.CreateModel(); BindKit.FillModelFromContainer(this.container, model); model.IsEntity = 0; if (this.Id.Value == "") { model.IsEntity = 0; model.IsDel = 0; model.Creator = this.CurrentUserName; model.CreateDate = DateTime.Now; _bus.Insert(model); } else { _bus.Update(model, null); string code = model.Code; new DictItemBus().Update(new DictItem() { GroupCode = code }, "GroupCode='" + this.OldCode.Value + "'"); this.OldCode.Value = code; } this.promptControl.ShowSuccess("保存成功!"); } }
public void OnDispose() { BindKit.ClearBindingSet(this); mCategoriesSelectorView = null; mPackageManagerApp.Dispose(); mPackageManagerApp = null; }
public PackageRepositoryView(PackageRepository packageRepository) { new SpaceView(2).AddTo(this); new LabelView(packageRepository.name).FontBold().Width(200).AddTo(this); new LabelView(packageRepository.latestVersion).TextMiddleCenter().Width(80).AddTo(this); var installedPackage = InstalledPackageVersions.FindVersionByName(packageRepository.name); new LabelView(installedPackage != null ? installedPackage.Version : " ").TextMiddleCenter().Width(100) .AddTo(this); new LabelView(packageRepository.accessRight).TextMiddleLeft().Width(50).AddTo(this); // 数据绑定 var bindingSet = BindKit.CreateBindingSet(this, new PackageViewModel()); if (installedPackage == null) { bindingSet.Bind(new ButtonView(LocaleText.Import).Width(90).AddTo(this)) .For(v => v.OnClick) .To(vm => vm.Import) .CommandParameter(packageRepository); } else if (packageRepository.VersionNumber > installedPackage.VersionNumber) { bindingSet.Bind(new ButtonView(LocaleText.Update).Width(90).AddTo(this)) .For(v => v.OnClick) .To(vm => vm.Update) .CommandParameter(packageRepository); } else if (packageRepository.VersionNumber == installedPackage.VersionNumber) { bindingSet.Bind(new ButtonView(LocaleText.Reimport).Width(90).AddTo(this)) .For(v => v.OnClick) .To(vm => vm.Reimport) .CommandParameter(packageRepository); } else if (packageRepository.VersionNumber < installedPackage.VersionNumber) { new SpaceView(94).AddTo(this); } bindingSet.Bind(new ButtonView(LocaleText.ReleaseNotes).Width(100) .AddTo(this)) .For(v => v.OnClick) .To(vm => vm.OpenDetail) .CommandParameter(packageRepository); new LabelView(packageRepository.author) .TextMiddleLeft() .FontBold().Width(100) .AddTo(this); bindingSet.Build(); }
protected void btnSave_Click(object sender, EventArgs e) { if (Page.IsValid) { if ((string.IsNullOrEmpty(this.Id.Value) || this.Id.Value == "0") && _userBus.UserExist(this.Account.Text)) { this.promptControl.ShowError("用户账号已存在,请重新输入!"); return; } var model = _userBus.CreateModel(); BindKit.FillModelFromContainer(this.editor, model); //保存用户信息 if (this.Id.Value == "") { //获取最大排序 int maxOrderBy = _userBus.GetMaxOrderBy(); model.UserSn = Guid.NewGuid().ToString().ToLower(); model.IsEnabled = 1; model.IsDel = 0; model.OrderBy = maxOrderBy + 1; model.Creator = this.CurrentUserName; model.CreateDate = DateTime.Now; model.Id = _userBus.InsertIdentity(model); } else { _userBus.Update(model, null); } var data = _dataBus.QueryModel("UserAccount='" + model.Account + "'"); if (data == null) { data = _dataBus.CreateModel(); BindKit.FillModelFromContainer(this.editor, data); data.UserId = model.Id; data.UserAccount = model.Account; _dataBus.Insert(data); } else { BindKit.FillModelFromContainer(this.editor, data); _dataBus.Update(data, "UserAccount='" + data.UserAccount + "'"); } this.Id.Value = model.Id.ToString(); this.promptControl.ShowSuccess("保存成功!"); this._userOrg.Visible = true; this._userRole.Visible = true; } }
protected void tree_SelectedNodeChanged(object sender, EventArgs e) { var val = this.tree.SelectedValue; var data = _bus.GetGroup(Convert.ToInt32(val)); if (data != null) { BindKit.BindModelToContainer(this.editor, data); SetControlStatus(); } }
private void BindData() { var dataId = WebParmKit.GetRequestString("key", 0); if (dataId > 0) { var model = _bus.QueryModel("Id=" + dataId); if (model != null) { BindKit.BindModelToContainer(this.editor, model); } } }
protected void tree_SelectedNodeChanged(object sender, EventArgs e) { ClearControls(); var val = this.tree.SelectedValue; var data = _bus.GetMenuItem(Convert.ToInt32(val)); if (data != null) { BindKit.BindModelToContainer(this.editor, data); this.CurName.Text = data.Name; SetControlStatus(); } }
private void DataBind() { int Id = WebParmKit.GetRequestString("key", 0); if (Id > 0) { var model = _bus.QueryModel("Id=" + Id); if (model != null) { BindKit.BindModelToContainer(this.container, model); this.OldCode.Value = model.Code; } } }
private void BindData() { int Id = WebParmKit.GetRequestString("key", 0); if (Id > 0) { var model = _bus.QueryModel("Id=" + Id); if (model != null) { BindKit.BindModelToContainer(this.container, model); //this.Value.Color = model.Value; } } }
private void BindData() { var advId = Convert.ToInt32(this.Id.Value); if (advId > 0) { var model = _bus.QueryModel("Id=" + advId); if (model != null) { BindKit.BindModelToContainer(this.editor, model); ShowThumb(model.Image); } } }
protected void btnChild_Click(object sender, EventArgs e) { if (Page.IsValid) { var data = new InfoGroup(); BindKit.FillModelFromContainer(this.editor, data); data.ParentId = Convert.ToInt32(this.Id.Value); _bus.Insert(data); ClearControls(); BindData(); } }
private void BindData() { string whereString = "IsDel=0"; string key = this.txtKeywords.Text.FormatSqlParm(); if (!string.IsNullOrEmpty(key)) { whereString += " AND (Name LIKE '%" + key + "%' OR Code LIKE '%" + key + "%')"; } this.list.DataSource = _bus.Query(whereString, "CreateDate DESC"); this.list.DataBind(); BindKit.BindOnClientClick(this.list, "Delete", "return confirm('确定要删除吗?');"); }
private void BindData() { var contentId = WebParmKit.GetRequestString("id", 0); if (contentId > 0) { var model = _bus.QueryModel("Id=" + contentId); if (model != null) { BindKit.BindModelToContainer(this.editor, model); this.ContentTitle.Text = model.Title; ShowThumb(model.Thumb); } } }
private void BindGroupList() { BindKit.BindToListControl(this.GroupCode, _groupBus.Query(""), "Name", "Code"); //获取字典分组 string group = WebParmKit.GetQuery("group", ""); string fix = WebParmKit.GetQuery("fix", ""); if (!string.IsNullOrEmpty(group)) { this.GroupCode.SelectedIndex = this.GroupCode.Items.IndexOf(this.GroupCode.Items.FindByValue(group)); } if (fix == "true") { this.GroupCode.Enabled = false; } }
protected void btnSave_Click(object sender, EventArgs e) { if (Page.IsValid) { var model = new InfoContentPage(); BindKit.FillModelFromContainer(this.editor, model); model.Title = this.ContentTitle.Text; if (!string.IsNullOrEmpty(this.Thumb.FileName)) { //清理老图像 if (!string.IsNullOrEmpty(this.PreviewThumb.ImageUrl)) { var f = new FileInfo(Server.MapPath(this.PreviewThumb.ImageUrl)); if (f.Exists) { f.Delete(); } } //更新新图 model.Thumb = FileKit.SaveZoomImage(this.Thumb.PostedFile, 1024, 1024); } if (this.Id.Value == "") { model.GroupCode = this.GroupCode; model.CategoryId = 0; model.Click = 0; model.CreateDate = DateTime.Now; model.IsEnabled = 1; model.Author = this.CurrentUserName; _bus.Insert(model); } else { _bus.Update(model, null); } ShowThumb(model.Thumb); this.promptControl.ShowSuccess("保存成功!"); } }
protected void btnSave_Click(object sender, EventArgs e) { if (Page.IsValid) { SysMemberInfo model = null; var dt = _userBus.GetMemberList(1, 1, string.Format("Account='{0}' or Mobile='{1}'", this.Account.Text, this.Mobile.Text)); if (dt.Rows.Count > 0) { this.Id.Value = dt.Rows[0]["Id"].ToString(); BindData(); model = _userBus.QueryModel("Id=" + this.Id.Value); } else { model = new SysMemberInfo(); BindKit.FillModelFromContainer(this.editor, model); //获取最大排序 model.UserSn = Guid.NewGuid().ToString().ToLower(); model.IsEnabled = 1; model.IsDel = 0; model.Creator = this.CurrentUserName; model.CreateDate = DateTime.Now; //新增数据 model.Id = _userBus.InsertIdentity(model); } //保存用户信息 var data = _dataBus.QueryModel("UserAccount='" + model.Account + "'"); if (data == null) { data = _dataBus.CreateModel(); BindKit.FillModelFromContainer(this.editor, data); data.UserId = model.Id; data.UserAccount = model.Account; data.IsDel = 0; _dataBus.Insert(data); } this.Id.Value = model.Id.ToString(); this.promptControl.ShowSuccess("执行成功!"); BindLog(); } }
private void BindData() { var user = LoginKit.GetCurrentMember(); if (user == null) { this.Alert("无法获取用户信息!"); return; } SysMemberDataBus bus = new SysMemberDataBus(); var model = bus.QueryModel(" IsDel = 0 and UserId=" + user.Id); if (model != null) { BindKit.BindModelToContainer(this.frm, model); } }
protected void btnSave_Click(object sender, EventArgs e) { if (Page.IsValid) { var model = new InfoAdv(); BindKit.FillModelFromContainer(this.editor, model); if (!string.IsNullOrEmpty(this.AdvImage.FileName)) { //清理老图像 if (!string.IsNullOrEmpty(this.PreviewImage.ImageUrl)) { var f = new FileInfo(Server.MapPath(this.PreviewImage.ImageUrl)); if (f.Exists) { f.Delete(); } } //更新新图 model.Image = FileKit.SaveThumbnailImage(this.AdvImage.PostedFile, 1024, 1024); } if (this.Id.Value == "") { //model.Type = ""; model.Click = 0; model.IsEnabled = 1; model.CreateDate = DateTime.Now; model.Creator = this.CurrentUserName; this.Id.Value = _bus.InsertIdentity(model).ToString(); } else { _bus.Update(model, null); } ShowThumb(model.Image); this.promptControl.ShowSuccess("保存成功!"); } }
private void BindData() { var userId = ConvertKit.ConvertValue(this.Id.Value, 0); if (userId > 0) { var model = _userBus.QueryModel("Id=" + userId); if (model != null) { BindKit.BindModelToContainer(this.editor, model); var data = _dataBus.QueryModel("UserAccount='" + model.Account + "'"); if (data != null) { BindKit.BindModelToContainer(this.editor, data); this.Id.Value = model.Id.ToString(); } } } }
protected void btnSave_Click(object sender, EventArgs e) { if (Page.IsValid) { var data = new InfoGroup(); BindKit.FillModelFromContainer(this.editor, data); if (this.Id.Value == "") { _bus.Insert(data); } else { _bus.Update(data, null); } ClearControls(); BindData(); } }
protected void btnSame_Click(object sender, EventArgs e) { if (Page.IsValid) { var data = _bus.CreateModel(); BindKit.FillModelFromContainer(this.editor, data); data.ParentId = Convert.ToInt32(this.ParentId.Value); data.RootId = GetRootId(); data.FullName = data.FullName.IndexOf("/") > -1 ? data.FullName.Substring(0, data.FullName.LastIndexOf("/")) + "/" + data.Alias : data.Alias; data.IsDel = 0; data.Creator = this.CurrentUserName; data.CreateDate = DateTime.Now; _bus.Insert(data); ClearControls(); BindData(); this.promptControl.ShowSuccess("新增同级成功!"); } }
protected void btnSubmit_Click(object sender, EventArgs e) { SysMemberDataBus bus = new SysMemberDataBus(); SysMemberData smd = new SysMemberData(); BindKit.FillModelFromContainer(this.frm, smd); try { if (!string.IsNullOrEmpty(this.Id.Value)) { int id; int.TryParse(this.Id.Value, out id); bus.Update(smd, " IsDel = 0 and UserId=" + id); this.Alert("修改用户信息成功!"); } } catch (Exception ex) { this.Alert("修改用户信息失败!原因:" + ex.ToString()); return;; } }