private void ListViewBing(PackageInfo pack) { ListViewItem lvi = new ListViewItem(); lvi.Text = pack.Packagename; lvi.Checked = false; lvi.SubItems.Add(pack.Packagepath); lvi.SubItems.Add(pack.Packtime); lvi.SubItems.Add(pack.Testtime); lvi.SubItems.Add(pack.Publishtime); lvi.SubItems.Add(pack.State); UIcheckinfo ui = UICheckDao.getUIcheckInfoByPackId(pack.Id); if (ui.State == null) { lvi.SubItems.Add("未生成检查"); } else { lvi.SubItems.Add(ui.State); } lvi.SubItems.Add(pack.Moduleid.ToString()); lvi.SubItems.Add(pack.Managerid.ToString()); lvi.SubItems.Add(pack.Id.ToString()); lvi.SubItems.Add(pack.TestRate.ToString()); this.listView1.Items.Add(lvi); }
//新建 public UICheck() { // // The InitializeComponent() call is required for Windows Forms designer support. // InitializeComponent(); this.KeyPreview = true; //先响应控件的ctrl+V的keydown事件。 this.comboBox1.DataSource = Source_Person; this.comboBox1.DisplayMember = "fullname"; this.comboBox1.ValueMember = "id"; this.comboBox1.AutoCompleteSource = AutoCompleteSource.ListItems; this.comboBox1.AutoCompleteMode = AutoCompleteMode.SuggestAppend; this.textBox2.Text = UICheckDao.getNewCheckNO(); this.comboBox2.DataSource = Source_Module; this.comboBox2.DisplayMember = "fullname"; this.comboBox2.ValueMember = "id"; this.comboBox2.AutoCompleteSource = AutoCompleteSource.ListItems; this.comboBox2.AutoCompleteMode = AutoCompleteMode.SuggestAppend; this.comboBox3.DataSource = Source_Project; this.comboBox3.DisplayMember = "projectname"; this.comboBox3.ValueMember = "id"; this.comboBox3.AutoCompleteSource = AutoCompleteSource.ListItems; this.comboBox3.AutoCompleteMode = AutoCompleteMode.SuggestAppend; this.multiColumnFilterComboBox1.DataSource = PackageDao.getAllUnTestPack(); this.multiColumnFilterComboBox1.ViewColList.Add(new MComboColumn("packagename", 200, true)); this.multiColumnFilterComboBox1.ViewColList.Add(new MComboColumn("packtime", 60, true)); this.multiColumnFilterComboBox1.ViewColList.Add(new MComboColumn("code", 60, true)); this.multiColumnFilterComboBox1.DisplayMember = "packagename"; this.multiColumnFilterComboBox1.ValueMember = "id"; this.multiColumnFilterComboBox1.Validated += new EventHandler(Package_SelectedValueChanged); this.textBox1.Enabled = false; //新建时禁止评论图片 this.KeyDown += new KeyEventHandler(pictureBox1_KeyDown); this.pictureBox1.Click += new EventHandler(pictureBox1_Click); this.drawToolsControl.Visible = false; this.colorSelector.Visible = false; this.textBox.Visible = false; this.CenterToParent(); uiinfo = new UIcheckinfo(); this.button3.Visible = false; this.button6.Visible = false; ValidateUPDOWN(); // // TODO: Add constructor code after the InitializeComponent() call. // }
private UIcheckinfo ListViewSelect(ListViewItem lvi) { UIcheckinfo tu = new UIcheckinfo(); tu.Checkno = lvi.Text; tu.Packagename = lvi.SubItems[1].Text; tu.Createtime = lvi.SubItems[2].Text; tu.Checkedtime = lvi.SubItems[3].Text; tu.Checkername = lvi.SubItems[4].Text; tu.State = lvi.SubItems[5].Text; tu.Id = Int32.Parse(lvi.SubItems[6].Text); return(tu); }
static public UIcheckinfo getUIcheckInfoByPackId(int id) { DataSet data = SqlDBUtil.ExecuteQuery("select top 1 * from UIcheckinfo where packageid=" + id.ToString()); if (data.Tables["ds"].Rows.Count > 0) { UIcheckinfo ls = Row2UIcheckinfo(data.Tables["ds"].Rows[0]); return(ls); } else { return(new UIcheckinfo()); } }
/// <summary> /// LIstVieW 绑定数据。 /// </summary> /// <param name="tu"></param> private void ListViewBing(UIcheckinfo tu) { ListViewItem lvi = new ListViewItem(); lvi.Text = tu.Checkno; // lvi.Checked = false; lvi.SubItems.Add(tu.Packagename); lvi.SubItems.Add(tu.Createtime); lvi.SubItems.Add(tu.Checkedtime); lvi.SubItems.Add(tu.Checkername); // lvi.SubItems.Add(tu.State); lvi.SubItems.Add(tu.Id.ToString()); // this.listView1.Items.Add(lvi); }
//设置未检查,未通过,选择性通过,通过 void Button5Click(object sender, EventArgs e) { if (this.listView1.CheckedItems.Count > 0) { string state = ""; string bt = ((Button)sender).Text; string checkedtime = ""; string msgcontent = "{0},您好!\n您发布的{1}版本,"; if ("待检查".Equals(bt)) { state = Enum.GetName(typeof(CommonConst.CheckState), CommonConst.CheckState.未检查); } if ("未通过".Equals(bt)) { state = Enum.GetName(typeof(CommonConst.CheckState), CommonConst.CheckState.未通过); checkedtime = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"); msgcontent += "未通过界面检查。请登录以下网址查看界面检查详细:\n http://192.10.110.206:9001/CmdCtrlService/jsp/UIcheckView.jsp?checkno={2}"; } if ("选择性通过".Equals(bt)) { state = Enum.GetName(typeof(CommonConst.CheckState), CommonConst.CheckState.择性通过); checkedtime = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"); msgcontent += "选择性通过界面检查。请登录以下网址查看界面检查详细:\n http://192.10.110.206:9001/CmdCtrlService/jsp/UIcheckView.jsp?checkno={2}"; } if ("已通过".Equals(bt)) { state = Enum.GetName(typeof(CommonConst.CheckState), CommonConst.CheckState.已通过); checkedtime = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"); msgcontent += "检查单号为{2},已通过界面检查。"; } foreach (ListViewItem lvi in this.listView1.CheckedItems) { string id = lvi.SubItems[6].Text; UIcheckinfo uiinfo = UICheckDao.getUIcheckInfoById(Int32.Parse(id)); uiinfo.Checkedtime = checkedtime; uiinfo.State = state; uiinfo.Checkername = WatchCilent.GlobalParams.User.Fullname; uiinfo.Checkerid = WatchCilent.GlobalParams.User.Id; SqlDBUtil.update(uiinfo); SendMessageToManager(string.Format(msgcontent, uiinfo.Adminname, uiinfo.Packagename, uiinfo.Checkno), uiinfo.Adminid); } getUIcheckList(); } else { MessageBox.Show("请至少选择一条记录!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
//修改 void Button2Click(object sender, EventArgs e) { if (this.listView1.CheckedItems.Count == 1) { UIcheckinfo tu = ListViewSelect(this.listView1.CheckedItems[0]); UICheck uc = new UICheck(tu.Id, true); uc.ShowDialog(); } else { MessageBox.Show("请选择一条记录", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } getUIcheckList(); }
//删除 void Button3Click(object sender, EventArgs e) { if (this.listView1.CheckedItems.Count > 0) { foreach (ListViewItem lvi in this.listView1.CheckedItems) { UIcheckinfo tu = ListViewSelect(lvi); SqlDBUtil.delete(tu); UICheckDao.DelUICheckViewByNO(tu.Checkno); } MessageBox.Show("删除成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); getUIcheckList(); } else { MessageBox.Show("请至少选择一条记录", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private static UIcheckinfo Row2UIcheckinfo(DataRow row) { UIcheckinfo test = new UIcheckinfo(); test.Id = Int32.Parse(row["id"].ToString()); //test.Testcontent = row["testcontent"] as byte[]; test.Adminid = Int32.Parse(!(row["adminid"].ToString().Equals(""))?row["adminid"].ToString():"0"); test.Adminname = row["adminname"].ToString(); test.Moduleid = Int32.Parse(!(row["moduleid"].ToString().Equals(""))?row["moduleid"].ToString():"0"); test.Modulename = row["modulename"].ToString(); test.Packageid = Int32.Parse(!(row["packageid"].ToString().Equals(""))?row["packageid"].ToString():"0"); test.Packagename = row["packagename"].ToString(); test.Projectid = Int32.Parse(!(row["projectid"].ToString().Equals(""))?row["projectid"].ToString():"0"); test.Projectname = row["projectname"].ToString(); test.Checkno = row["checkno"].ToString(); test.Checkerid = Int32.Parse(!(row["checkerid"].ToString().Equals(""))?row["moduleid"].ToString():"0"); test.Checkername = row["checkername"].ToString(); test.Checkedtime = row["checkedtime"].ToString(); test.Createtime = row["createtime"].ToString(); test.State = row["state"].ToString(); return(test); }
//修改查看 public UICheck(int id, bool isedit) { // // The InitializeComponent() call is required for Windows Forms designer support. // InitializeComponent(); _isedit = isedit; uiinfo = UICheckDao.getUIcheckInfoById(id); this.comboBox1.DataSource = Source_Person; this.comboBox1.DisplayMember = "fullname"; this.comboBox1.ValueMember = "id"; this.comboBox1.AutoCompleteSource = AutoCompleteSource.ListItems; this.comboBox1.AutoCompleteMode = AutoCompleteMode.SuggestAppend; this.textBox2.Text = UICheckDao.getNewCheckNO(); this.comboBox2.DataSource = Source_Module; this.comboBox2.DisplayMember = "fullname"; this.comboBox2.ValueMember = "id"; this.comboBox2.AutoCompleteSource = AutoCompleteSource.ListItems; this.comboBox2.AutoCompleteMode = AutoCompleteMode.SuggestAppend; this.comboBox3.DataSource = Source_Project; this.comboBox3.DisplayMember = "projectname"; this.comboBox3.ValueMember = "id"; this.comboBox3.AutoCompleteSource = AutoCompleteSource.ListItems; this.comboBox3.AutoCompleteMode = AutoCompleteMode.SuggestAppend; //this.multiColumnFilterComboBox1.DataSource = PackageDao.getAllUnTestPack(); this.multiColumnFilterComboBox1.ViewColList.Add(new MComboColumn("packagename", 200, true)); this.multiColumnFilterComboBox1.ViewColList.Add(new MComboColumn("packtime", 60, true)); this.multiColumnFilterComboBox1.ViewColList.Add(new MComboColumn("code", 60, true)); this.multiColumnFilterComboBox1.DisplayMember = "packagename"; this.multiColumnFilterComboBox1.ValueMember = "id"; this.multiColumnFilterComboBox1.Validated += new EventHandler(Package_SelectedValueChanged); this.textBox2.ReadOnly = true; TestUnitBingData(); if (isedit) { this.checkBox1.Checked = false; this.pictureBox1.SelectColor = Color.Red; this.textBox.Visible = false; this.colorSelector.Visible = false; drawToolsControl.ButtonRedoClick += new EventHandler( DrawToolsControlButtonRedoClick); drawToolsControl.ButtonDrawStyleClick += new EventHandler( DrawToolsControlButtonDrawStyleClick); colorSelector.ColorChanged += new EventHandler(colorSelector_ColorChanged); colorSelector.FontSizeChanged += new EventHandler(colorSelector_FontSizeChanged); this.pictureBox1.TextBoxHide += new EventHandler(TextBoxExLostFocus); this.pictureBox1.TextBoxShow += new EventHandler(pictureBox1_TextBoxShow); } else { this.checkBox1.Checked = true; this.textBox1.ReadOnly = true; this.drawToolsControl.Visible = false; this.colorSelector.Visible = false; this.textBox.Visible = false; this.button4.Visible = false; this.button3.Visible = false; this.button6.Visible = false; } this.CenterToParent(); // // TODO: Add constructor code after the InitializeComponent() call. // }