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("保存成功!"); } }
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(); 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("保存成功!"); } }
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 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(); } }
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(); } }
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) { 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("保存成功!"); } }
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;; } }
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.IsExternal = 0; data.IsEnabled = 1; data.IsDel = 0; data.Creator = this.CurrentUserName; data.CreateDate = DateTime.Now; _bus.Insert(data); ClearControls(); BindData(); this.promptControl.ShowSuccess("新增同级成功!"); } }
protected void btnChild_Click(object sender, EventArgs e) { if (Page.IsValid) { var data = _bus.CreateModel(); BindKit.FillModelFromContainer(this.editor, data); data.ParentId = Convert.ToInt32(this.Id.Value); data.RootId = GetRootId(); data.Path = data.Path + "/" + this.Id.Value; data.Level++; data.FullName = data.FullName + "/" + data.Alias; data.IsDel = 0; data.Creator = this.CurrentUserName; data.CreateDate = DateTime.Now; _bus.Insert(data); ClearControls(); BindData(); this.promptControl.ShowSuccess("新增下级成功!"); } }
protected void btnSave_Click(object sender, EventArgs e) { if (Page.IsValid) { var model = _bus.CreateModel(); BindKit.FillModelFromContainer(this.editor, model); if (this.Id.Value == "") { model.IsDel = 0; model.Creator = this.CurrentUserName; model.CreateDate = DateTime.Now; _bus.Insert(model); } else { _bus.Update(model, null); } this.promptControl.ShowSuccess("保存成功!"); } }
protected void btnSave_Click(object sender, EventArgs e) { if (Page.IsValid) { var model = new InfoContentPage(); BindKit.FillModelFromContainer(this.editor, model); 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(); } } //更新新图 if (this.Thumb.PostedFile.ContentLength > 0) { if (FileKit.IsImage(this.Thumb.PostedFile.FileName)) { model.Thumb = FileKit.SaveZoomImage(this.Thumb.PostedFile, 1024, 1024); } else { this.Alert("您上传的不是图片!"); } } ShowThumb(model.Thumb); } if (Request.QueryString["m"] == "content") { model.Title = this.InfoTitle.Text; if (!_infoBus.Update(model, "GroupCode='" + this.GroupCode + "'")) { model.GroupCode = this.GroupCode; model.CategoryId = 0; model.Click = 0; model.CreateDate = DateTime.Now; model.IsEnabled = 1; model.Author = this.CurrentUserName; model.Id = _infoBus.InsertIdentity(model); BindKit.BindModelToContainer(this.editor, model); } } else { if (string.IsNullOrEmpty(this.Id.Value) || this.Id.Value == "0") { model.Title = this.InfoTitle.Text; model.GroupCode = this.GroupCode; model.CategoryId = 0; model.Click = 0; model.CreateDate = DateTime.Now; model.IsEnabled = 1; model.Author = this.CurrentUserName; //_infoBus.Insert(model); model.Id = _infoBus.InsertIdentity(model); this.Id.Value = model.Id.ToString(); } else { model.Title = this.InfoTitle.Text; _infoBus.Update(model, null); } } this.promptControl.ShowSuccess("保存成功!"); } }
protected void btnSave_Click(object sender, EventArgs e) { if (Page.IsValid) { var model = _userBus.CreateModel(); BindKit.FillModelFromContainer(this.editor, model); //保存用户信息 if (this.Id.Value == "") { //if (_userBus.MemberExist(this.Account.Text)) { // this.promptControl.ShowError("用户账号已存在,请重新输入!"); // return; //} int phonecount = _dataBus.RecordCount(" IsDel = 0 and Mobile = '" + this.Mobile.Text + "'"); if (phonecount > 0) { this.promptControl.ShowError("会员电话号码已存在,请重新输入!"); return; } //获取最大排序 model.UserSn = Guid.NewGuid().ToString().ToLower(); model.IsEnabled = 1; model.IsDel = 0; model.Creator = this.CurrentUserName; model.CreateDate = DateTime.Now; model.Password = "******"; model.Name = this.Account.Text; model.Id = _userBus.InsertIdentity(model); } else { _userBus.Update(model, null); } var data = _dataBus.QueryModel("UserID='" + model.Id + "'"); if (data == null) { data = _dataBus.CreateModel(); BindKit.FillModelFromContainer(this.editor, data); data.UserId = model.Id; data.UserAccount = model.Account; data.IsDel = 0; data.Nickname = this.Account.Text; data.Memo = DateTime.Now.ToString(); data.Interest = this.Partner.SelectedValue; _dataBus.Insert(data); } else { BindKit.FillModelFromContainer(this.editor, data); data.UserAccount = model.Account; data.Interest = this.Partner.SelectedValue; _dataBus.Update(data, "UserID='" + data.UserId + "'"); } this.Id.Value = model.Id.ToString(); this.promptControl.ShowSuccess("保存成功!"); } }