private void p14_MouseUp(object sender, MouseEventArgs e) { //mouseright popup if (e.Button == System.Windows.Forms.MouseButtons.Right) { FrmFrame frm = new FrmFrame() { WindowState = FormWindowState.Normal, Width = 480, Height = 390, BackColor = Color.FromArgb(37, 37, 37), Text = "艺卓资源管理系统", Name = "过滤关键字设置", FormBorderStyle = FormBorderStyle.Sizable }; var control = new Center1ShowFilterByKeywordSetting(); frm.SetUserControl(control); // frm.ShowDialog(); if (SROperation2.Instance.isFilterKeywordChanged) { OnPageToolClicked(sender, new ToolEventArgs() { PicIndex = 14 }); } } }
private void 新建ToolStripMenuItem_Click(object sender, EventArgs e) { int itreeid = this.GetLeftTreeviewSelectedId(); FrmFrame frm = new FrmFrame() { StartPosition = FormStartPosition.CenterScreen, Text = "添加", Width = 319, Height = 174 }; Param.DPageParameter = ""; frm.SetUserControl(new SirdRoom.ManageSystem.ClientApplication.Pages.Wordbook.Add() { Name = "Add" }); if (frm.ShowDialog() == DialogResult.OK) { if (String.IsNullOrEmpty(Param.DPageParameter) == false) { String[] arrls = Param.DPageParameter.Split(new char[] { '|' }); string guid = Guid.NewGuid().ToString(); SRRC_BiaojiEntity ent = new SRRC_BiaojiEntity() { Addtime = DateTime.Now, Img = arrls[1], Name = arrls[0], User_id = SROperation.Instance.RightDtype == "Study" ? 0 : Param.UserId, Pid = itreeid, Code = guid, isShowKeyword = true, isShowPanel = true, isShowUserPanel = true, Hide = true }; if (itreeid > 0) { ent.Topid = (this.treeView1.SelectedNode.Tag as SRRC_BiaojiEntity).Topid == 0 ? (this.treeView1.SelectedNode.Tag as SRRC_BiaojiEntity).Id : (this.treeView1.SelectedNode.Tag as SRRC_BiaojiEntity).Topid; } SRRC_BiaojiEntity ent1 = DataBase.Instance.tSRRC_Biaoji.Get_Entity( new KeyValueCollection <SRRC_BiaojiEntity.FiledType>() { new KeyValue <SRRC_BiaojiEntity.FiledType>(SRRC_BiaojiEntity.FiledType.Pid, itreeid) }, new OrderCollection <SRRC_BiaojiEntity.FiledType>() { new Order <SRRC_BiaojiEntity.FiledType>(SRRC_BiaojiEntity.FiledType.OrderNum, OrderType.Desc) } ); ent.OrderNum = ent1 == null ? 0 : ent1.OrderNum + 1; DataBase.Instance.tSRRC_Biaoji.Add(ent); ent = DataBase.Instance.tSRRC_Biaoji.Get_Entity(guid); if (itreeid == 0) { this.treeView1.Nodes.Add(new TreeNode() { Tag = ent, Text = arrls[0], Name = ent.Id.ToString(), ImageKey = arrls[1], SelectedImageKey = arrls[1] }); } else { this.treeView1.SelectedNode.Nodes.Add(new TreeNode() { Tag = ent, Text = arrls[0], Name = ent.Id.ToString(), ImageKey = arrls[1], SelectedImageKey = arrls[1] }); } } } }
private void SetWaitPic() { FrmFrame ff = new FrmFrame() { Width = 284, Height = 258, Text = "正在加载,请稍后..." }; WaitPic wp = new WaitPic(); ff.SetUserControl(wp); ff.Show(); while (SROperation2.Instance.isLoading) { wp.SetReadCount(); ff.Refresh(); } }
//protected Int32 SelectedRowIndex = 0; //private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) //{ // if (e.RowIndex >= 0) // { // try // { // if (dataGridView1.Columns[e.ColumnIndex].GetType() == typeof(DataGridViewButtonColumn)) // { // if (dataGridView1.Columns[e.ColumnIndex].HeaderText.Equals("编辑") == true) //转发 // { // //this.dataGridView1.SelectedRows.Index; // this.SelectedRowIndex = e.RowIndex; // this.dataGridView1.CurrentCell = this.dataGridView1.Rows[e.RowIndex].Cells[1]; // Int32 id = Convert.ToInt32(dataGridView1.Rows[e.RowIndex].Cells["Id"].Value); // FrmFrame frm = new FrmFrame() {StartPosition = FormStartPosition.CenterScreen, Text = "编辑用户", Width = 829, Height= 622 }; // Param.DPageParameter = id.ToString(); // frm.SetUserControl(new SirdRoom.ManageSystem.ClientApplication.Pages.User.Add() { Name = "Add" }); // frm.ShowDialog(); // this.BindData(); // } // else if (dataGridView1.Columns[e.ColumnIndex].HeaderText.Equals("删除") == true) //报告 // { // this.SelectedRowIndex = e.RowIndex; // this.dataGridView1.CurrentCell = this.dataGridView1.Rows[e.RowIndex].Cells[1]; // Int32 id = Convert.ToInt32(dataGridView1.Rows[e.RowIndex].Cells["Id"].Value); // if (id == 1) // { // new SRFMessageBox("管理员不能被删除!", "提示", MessageBoxButtons.OK).ShowDialog(); return; // } // if (new SRFMessageBox("您确认要删除此用户吗?", "提示", MessageBoxButtons.YesNo).ShowDialog() == DialogResult.Yes) // { // DataBase.Instance.tSR_Systemrecord.Add(new SR_SystemrecordEntity() // { // Adddate = DateTime.Now, // Ltype = "日志", // Title = Param.Loginname, // Description = (DataBase.Instance.tSR_User.Get_Entity(id) == null ? "" : DataBase.Instance.tSR_User.Get_Entity(id).Loginname) // , // Remark = "删除" // }); // DataBase.Instance.tSR_User.Delete(id); // this.BindData(); // } // } // } // } // catch (Exception ex) // { // //ErrorMessage(ex.Message); // return; // } // } //} /// <summary> /// Add User /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void label1_Click(object sender, EventArgs e) { FrmFrame frm = new FrmFrame() { StartPosition = FormStartPosition.CenterScreen, Text = "添加用户", Width = 338, Height = 235 }; Param.DPageParameter = ""; frm.SetUserControl(new SirdRoom.ManageSystem.ClientApplication.Pages.User.Add() { Name = "Add" }); if (frm.ShowDialog() == DialogResult.OK) { this.BindData(); } }
//修改 private void lbl_Edit_Click(object sender, EventArgs e) { Int32 id = Convert.ToInt32((sender as Label).Tag); FrmFrame frm = new FrmFrame() { StartPosition = FormStartPosition.CenterScreen, Text = "编辑用户", Width = 338, Height = 235 }; Param.DPageParameter = id.ToString(); frm.SetUserControl(new SirdRoom.ManageSystem.ClientApplication.Pages.User.Add() { Name = "Add" }); if (frm.ShowDialog() == DialogResult.OK) { this.BindData(); } }
private void toolStripButton1_Click(object sender, EventArgs e) { FrmFrame frm = new FrmFrame() { WindowState = FormWindowState.Normal, Width = 480, Height = 400, BackColor = Color.FromArgb(37, 37, 37), Text = "艺卓资源管理系统", Name = "常驻关键字设置", FormBorderStyle = FormBorderStyle.Sizable }; var control = new KeywordManager(0); frm.SetUserControl(control); // frm.ShowDialog(); }
private void 修改ToolStripMenuItem_Click(object sender, EventArgs e) { int itreeid = this.GetLeftTreeviewSelectedId(); if (itreeid <= 0) { new SRFMessageBox("请选择要修改的节点!", "提示", MessageBoxButtons.OK).ShowDialog(); return; } FrmFrame frm = new FrmFrame() { StartPosition = FormStartPosition.CenterScreen, Text = "修改", Width = 319, Height = 174 }; SRRC_BiaojiEntity ent = DataBase.Instance.tSRRC_Biaoji.Get_Entity(itreeid); Param.DPageParameter = String.Format("{0}|{1}", ent.Name, ent.Img); frm.SetUserControl(new SirdRoom.ManageSystem.ClientApplication.Pages.Wordbook.Add() { Name = "Add" }); if (frm.ShowDialog() == DialogResult.OK) { if (String.IsNullOrEmpty(Param.DPageParameter) == false) { String[] arrls = Param.DPageParameter.Split(new char[] { '|' }); DataBase.Instance.tSRRC_Biaoji.Update( new KeyValueCollection <SRRC_BiaojiEntity.FiledType>() { new KeyValue <SRRC_BiaojiEntity.FiledType>(SRRC_BiaojiEntity.FiledType.Name, arrls[0]), new KeyValue <SRRC_BiaojiEntity.FiledType>(SRRC_BiaojiEntity.FiledType.Img, arrls[1]) }, " Id=[$Id$] ", new DataParameter("Id", itreeid)); this.treeView1.SelectedNode.Text = arrls[0]; this.treeView1.SelectedNode.ImageKey = this.treeView1.SelectedNode.SelectedImageKey = arrls[1]; } } }
//修改 private void lbl_Edit_Click(object sender, EventArgs e) { Int32 id = Convert.ToInt32((sender as Label).Tag); FrmFrame frm = new FrmFrame() { StartPosition = FormStartPosition.CenterScreen, Text = "编辑用户", Width = 338, Height = 235 }; Param.DPageParameter = id.ToString(); frm.SetUserControl(new SirdRoom.ManageSystem.ClientApplication.Pages.User.Add() { Name = "Add" }); if(frm.ShowDialog() == DialogResult.OK) this.BindData(); }
//protected Int32 SelectedRowIndex = 0; //private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) //{ // if (e.RowIndex >= 0) // { // try // { // if (dataGridView1.Columns[e.ColumnIndex].GetType() == typeof(DataGridViewButtonColumn)) // { // if (dataGridView1.Columns[e.ColumnIndex].HeaderText.Equals("编辑") == true) //转发 // { // //this.dataGridView1.SelectedRows.Index; // this.SelectedRowIndex = e.RowIndex; // this.dataGridView1.CurrentCell = this.dataGridView1.Rows[e.RowIndex].Cells[1]; // Int32 id = Convert.ToInt32(dataGridView1.Rows[e.RowIndex].Cells["Id"].Value); // FrmFrame frm = new FrmFrame() {StartPosition = FormStartPosition.CenterScreen, Text = "编辑用户", Width = 829, Height= 622 }; // Param.DPageParameter = id.ToString(); // frm.SetUserControl(new SirdRoom.ManageSystem.ClientApplication.Pages.User.Add() { Name = "Add" }); // frm.ShowDialog(); // this.BindData(); // } // else if (dataGridView1.Columns[e.ColumnIndex].HeaderText.Equals("删除") == true) //报告 // { // this.SelectedRowIndex = e.RowIndex; // this.dataGridView1.CurrentCell = this.dataGridView1.Rows[e.RowIndex].Cells[1]; // Int32 id = Convert.ToInt32(dataGridView1.Rows[e.RowIndex].Cells["Id"].Value); // if (id == 1) // { // new SRFMessageBox("管理员不能被删除!", "提示", MessageBoxButtons.OK).ShowDialog(); return; // } // if (new SRFMessageBox("您确认要删除此用户吗?", "提示", MessageBoxButtons.YesNo).ShowDialog() == DialogResult.Yes) // { // DataBase.Instance.tSR_Systemrecord.Add(new SR_SystemrecordEntity() // { // Adddate = DateTime.Now, // Ltype = "日志", // Title = Param.Loginname, // Description = (DataBase.Instance.tSR_User.Get_Entity(id) == null ? "" : DataBase.Instance.tSR_User.Get_Entity(id).Loginname) // , // Remark = "删除" // }); // DataBase.Instance.tSR_User.Delete(id); // this.BindData(); // } // } // } // } // catch (Exception ex) // { // //ErrorMessage(ex.Message); // return; // } // } //} /// <summary> /// Add User /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void label1_Click(object sender, EventArgs e) { FrmFrame frm = new FrmFrame() { StartPosition = FormStartPosition.CenterScreen, Text = "添加用户", Width = 338, Height = 235 }; Param.DPageParameter = ""; frm.SetUserControl(new SirdRoom.ManageSystem.ClientApplication.Pages.User.Add() { Name = "Add" }); if (frm.ShowDialog() == DialogResult.OK) this.BindData(); }