/// <summary> /// 职位列表 /// </summary> private void GetPositionList() { PositionTO to = new PositionTO(); if (!string.IsNullOrEmpty(Request.Form["PositName"])) { to.Name = pName = Request.Form["PositName"]; } string orderBy = ""; if (!string.IsNullOrEmpty(Request.Form["hidPosit"])) { pageIndex = Convert.ToInt32(Request.Form["hidPosit"]); } else { if (!string.IsNullOrEmpty(Request.QueryString["pageIndex"])) { pageIndex = Convert.ToInt32(Request.QueryString["pageIndex"]); } } DataTable dt = new PositionBLL().GetPositionList(to, pageIndex, pageSize, orderBy, out rowCount); StringBuilder sb = new StringBuilder(); if (dt.Rows.Count > 0) { for (int i = 0; i < dt.Rows.Count; i++) { DataRow dr = dt.Rows[i]; if (i % 2 == 0) { sb.Append("<tr bgcolor=\"#f8f8f8\">"); } else { sb.Append("<tr>"); } sb.AppendFormat("<td height=\"40\" align=\"center\"><span class=\"line\" style=\"COLOR: #666;\">{0}</span></td>", i + 1); sb.AppendFormat("<td><span class=\"line cl_sp\" style=\"COLOR: #666;\">{0}</span><span class=\"line cl_inp\" style=\"COLOR: #666;display:none;\"><input type=\"text\" value=\"{0}\" style=\"width:120px;\"/></span></td>", dr["Name"]); sb.AppendFormat("<td><span class=\"bottom cl_block\"><a style=\"color:#3B96D3;\" href=\"javascript:void(0)\" onclick=\"UpdatePosit({0})\">修改</a>   <a style=\"color:#3B96D3;\" onclick=\"delPosition('{1}')\" href=\"javascript:void(0)\">删除</a></span> <span class=\"bottom cl_none\" style=\"display:none;\"><a style=\"color:#3B96D3;\" href=\"javascript:void(0)\" onclick=\"SavePosit({0},'{1}')\">保存</a>   <a style=\"color:#3B96D3;\" href=\"javascript:void(0)\" onclick=\"CanclePosit({0})\">取消</a></span> </td></tr>", i, dr["ID"]); } } else { sb.Append("<tr bgcolor=\"#f8f8f8\"><td colspan=\"10\"><span class=\"line\">没有相关信息!</span></td></tr>"); } positList = sb.ToString(); string url = "PositionList.aspx?pageIndex={0}"; if (!string.IsNullOrEmpty(pName)) { url += "&PositName=" + pName; } PageList = DivPage.Pager(pageSize, rowCount, pageIndex, url); }
private void Init() { btn_ShowCloseProduct = new Button(); btn_ShowCloseProduct.Text = Cons.User_btnHideXem; btn_ShowCloseProduct.Location = new Point(20, 5); btn_ShowCloseProduct.Size = new Size(300, 30); btn_ShowCloseProduct.Click += Btn_ShowCloseProduct_Click; this.Controls.Add(btn_ShowCloseProduct); #region Search gb_Search = new GroupBox(); gb_Search.Location = new Point(10, 60); gb_Search.Size = new Size(700, 90); gb_Search.Text = "Search"; this.Controls.Add(gb_Search); lb_username = new Label(); lb_username.Location = new Point(10, 25); lb_username.Size = new Size(70, 20); lb_username.Text = "User KH: "; gb_Search.Controls.Add(lb_username); tb_username = new TextBox(); tb_username.Location = new Point(lb_username.Location.X + lb_username.Size.Width, 20); tb_username.Size = new Size(200, 20); gb_Search.Controls.Add(tb_username); lb_TenKH = new Label(); lb_TenKH.Location = new Point(tb_username.Location.X + tb_username.Size.Width + 10, 25); lb_TenKH.Size = new Size(70, 20); lb_TenKH.Text = "Tên KH: "; gb_Search.Controls.Add(lb_TenKH); tb_TenKH = new TextBox(); tb_TenKH.Location = new Point(lb_TenKH.Location.X + lb_TenKH.Size.Width, 20); tb_TenKH.Size = new Size(200, 20); gb_Search.Controls.Add(tb_TenKH); btn_Search = new Button(); btn_Search.Location = new Point(tb_TenKH.Location.X + tb_TenKH.Size.Width + 10, 15); btn_Search.Size = new Size(100, 30); btn_Search.Text = "Search "; btn_Search.Click += Btn_Search_Click; gb_Search.Controls.Add(btn_Search); lb_Enable = new Label(); lb_Enable.Location = new Point(10, lb_username.Location.Y + lb_username.Height + 10); lb_Enable.Size = new Size(70, 20); lb_Enable.Text = "Chế độ: "; gb_Search.Controls.Add(lb_Enable); cb_Enable = new ComboBox(); cb_Enable.Location = new Point(lb_Enable.Location.X + lb_username.Width, lb_Enable.Location.Y - 2); cb_Enable.Size = new Size(200, 20); cb_Enable.Items.Add("Tất cả"); cb_Enable.Items.Add("Đã kích hoạt"); cb_Enable.Items.Add("Chưa kích hoạt"); cb_Enable.DropDownStyle = ComboBoxStyle.DropDownList; cb_Enable.SelectedIndex = 0; gb_Search.Controls.Add(cb_Enable); #endregion #region DivPage dp = new DivPage(new Point(20, gb_Search.Location.Y + gb_Search.Height + 10)); dp.OnIndexChanged += Dp_OnIndexChanged; dp.setMaxcount(10); this.Controls.Add(dp); #endregion #region Data dv = new DataGridView(); dv.Location = new Point(10, dp.Location.Y + dp.Height + 10); dv.Size = new Size(700, 250); dv.Columns.Add("TU", "User name"); dv.Columns.Add("NU", "Họ tên"); dv.Columns.Add("DTLU", "Điểm tích lũy"); dv.Columns.Add("EU", "Isenable"); dv.Columns["TU"].Width = 150; dv.Columns["NU"].Width = 170; dv.Columns["DTLU"].Width = 280; dv.Columns["EU"].Width = 50; dv.Rows.Add(10); dv.AllowUserToAddRows = false; dv.ReadOnly = true; this.Controls.Add(dv); #endregion }
private void Init() { btn_ShowCloseProduct = new Button(); btn_ShowCloseProduct.Text = Cons.User_btnHideTrackingMail; btn_ShowCloseProduct.Location = new Point(20, 5); btn_ShowCloseProduct.Size = new Size(300, 30); btn_ShowCloseProduct.Click += Btn_ShowCloseProduct_Click; this.Controls.Add(btn_ShowCloseProduct); #region Search gb_Search = new GroupBox(); gb_Search.Location = new Point(10, 60); gb_Search.Size = new Size(700, 50); gb_Search.Text = "Search"; this.Controls.Add(gb_Search); lb_email = new Label(); lb_email.Location = new Point(10, 25); lb_email.Size = new Size(50, 20); lb_email.Text = "Mail: "; gb_Search.Controls.Add(lb_email); tb_email = new TextBox(); tb_email.Location = new Point(lb_email.Location.X + lb_email.Size.Width, 20); tb_email.Size = new Size(200, 20); gb_Search.Controls.Add(tb_email); lb_style = new Label(); lb_style.Location = new Point(tb_email.Location.X + tb_email.Size.Width + 10, 25); lb_style.Size = new Size(40, 20); lb_style.Text = "Style: "; gb_Search.Controls.Add(lb_style); cb_style = new ComboBox(); cb_style.Location = new Point(lb_style.Location.X + lb_style.Size.Width, 20); cb_style.Size = new Size(100, 20); cb_style.DropDownStyle = ComboBoxStyle.DropDownList; cb_style.DisplayMember = "Name"; gb_Search.Controls.Add(cb_style); lb_color = new Label(); lb_color.Location = new Point(cb_style.Location.X + cb_style.Size.Width + 10, 25); lb_color.Size = new Size(40, 20); lb_color.Text = "Color: "; gb_Search.Controls.Add(lb_color); cb_color = new ComboBox(); cb_color.Location = new Point(lb_color.Location.X + lb_color.Size.Width, 20); cb_color.Size = new Size(100, 20); cb_color.DropDownStyle = ComboBoxStyle.DropDownList; cb_color.DisplayMember = "Name"; gb_Search.Controls.Add(cb_color); btn_Search = new Button(); btn_Search.Location = new Point(cb_color.Location.X + cb_color.Size.Width + 10, 15); btn_Search.Size = new Size(100, 30); btn_Search.Text = "Search "; btn_Search.Click += Btn_Search_Click; gb_Search.Controls.Add(btn_Search); #endregion #region DivPage dp = new DivPage(new Point(20, gb_Search.Location.Y + gb_Search.Height + 10)); dp.OnIndexChanged += Dp_OnIndexChanged; dp.setMaxcount(10); this.Controls.Add(dp); #endregion #region Data dv = new DataGridView(); dv.Location = new Point(10, dp.Location.Y + dp.Height + 10); dv.Size = new Size(700, 250); dv.Columns.Add("ID", "ID"); dv.Columns.Add("TM", "Tracking mail"); dv.Columns.Add("Pro", "Mã sản phẩm"); dv.Columns.Add("Style", "Style"); dv.Columns.Add("Color", "Color"); dv.Columns.Add("Date", "Ngày"); dv.Columns["ID"].Width = 30; dv.Columns["TM"].Width = 170; dv.Columns["Pro"].Width = 100; dv.Columns["Style"].Width = 130; dv.Columns["Color"].Width = 100; dv.Columns["Date"].Width = 120; dv.Rows.Add(10); dv.AllowUserToAddRows = false; dv.MultiSelect = false; dv.ReadOnly = true; this.Controls.Add(dv); #endregion #region Action btn_addUser = new Button(); btn_addUser.Location = new Point(20, dv.Location.Y + dv.Height + 20); btn_addUser.Size = new Size(100, 50); btn_addUser.Text = "Thêm User"; btn_addUser.Click += Btn_addUser_Click; this.Controls.Add(btn_addUser); btn_delete = new Button(); btn_delete.Location = new Point(btn_addUser.Location.X + btn_addUser.Width + 20, btn_addUser.Location.Y); btn_delete.Size = new Size(100, 50); btn_delete.Text = "Xóa Tracking Mail"; btn_delete.Click += Btn_delete_Click; this.Controls.Add(btn_delete); #endregion }
public void Init() { btn_ShowCloseProduct = new Button(); btn_ShowCloseProduct.Text = Cons.Test_btnHideXem; btn_ShowCloseProduct.Location = new Point(20, 5); btn_ShowCloseProduct.Size = new Size(300, 30); btn_ShowCloseProduct.Click += Btn_ShowCloseProduct_Click; this.Controls.Add(btn_ShowCloseProduct); #region Search gb_Search = new GroupBox(); gb_Search.Location = new Point(10, 60); gb_Search.Size = new Size(700, 50); gb_Search.Text = "Search"; this.Controls.Add(gb_Search); lb_MaSP = new Label(); lb_MaSP.Location = new Point(10, 25); lb_MaSP.Size = new Size(70, 20); lb_MaSP.Text = "Mã SP: "; gb_Search.Controls.Add(lb_MaSP); tb_MaSP = new TextBox(); tb_MaSP.Location = new Point(lb_MaSP.Location.X + lb_MaSP.Size.Width, 20); tb_MaSP.Size = new Size(200, 20); gb_Search.Controls.Add(tb_MaSP); lb_TenSP = new Label(); lb_TenSP.Location = new Point(tb_MaSP.Location.X + tb_MaSP.Size.Width + 10, 25); lb_TenSP.Size = new Size(70, 20); lb_TenSP.Text = "Tên SP: "; gb_Search.Controls.Add(lb_TenSP); tb_TenSP = new TextBox(); tb_TenSP.Location = new Point(lb_TenSP.Location.X + lb_TenSP.Size.Width, 20); tb_TenSP.Size = new Size(200, 20); gb_Search.Controls.Add(tb_TenSP); btn_Search = new Button(); btn_Search.Location = new Point(tb_TenSP.Location.X + tb_TenSP.Size.Width + 10, 15); btn_Search.Size = new Size(100, 30); btn_Search.Text = "Search "; btn_Search.Click += Btn_Search_Click; gb_Search.Controls.Add(btn_Search); #endregion #region DivPage dp = new DivPage(new Point(20, gb_Search.Location.Y + gb_Search.Height + 10)); dp.OnIndexChanged += Dp_OnIndexChanged; dp.setMaxcount(10); this.Controls.Add(dp); #endregion #region Data dv = new DataGridView(); dv.Location = new Point(10, dp.Location.Y + dp.Height + 10); dv.Size = new Size(700, 250); dv.Columns.Add("MSP", "Mã sản phẩm"); dv.Columns.Add("TSP", "Tên sản phẩm"); dv.Columns.Add("HTG", "Hash Tag"); dv.Columns["TSP"].Width = 270; dv.Columns["HTG"].Width = 280; dv.Rows.Add(10); dv.ReadOnly = true; dv.AllowUserToAddRows = false; this.Controls.Add(dv); #endregion #region Action ctm = new ContextMenuStrip(); ctm.Size = new System.Drawing.Size(105, 26); ToolStripMenuItem itemEditProduct = new ToolStripMenuItem(); itemEditProduct.Text = "Edit"; itemEditProduct.Click += ItemEditProduct_Click; itemEditProduct.Size = new System.Drawing.Size(104, 22); ctm.Items.Add(itemEditProduct); ToolStripMenuItem itemDeleteProduct = new ToolStripMenuItem(); itemDeleteProduct.Text = "Delete"; itemDeleteProduct.Click += ItemDeleteProduct_Click; itemDeleteProduct.Size = new System.Drawing.Size(104, 22); ctm.Items.Add(itemDeleteProduct); ToolStripMenuItem itemChangeHashtag = new ToolStripMenuItem(); itemChangeHashtag.Text = "Change HashTag"; itemChangeHashtag.Click += ItemChangeHashtag_Click; itemChangeHashtag.Size = new System.Drawing.Size(104, 22); ctm.Items.Add(itemChangeHashtag); ToolStripMenuItem itemChangestatus = new ToolStripMenuItem(); itemChangestatus.Text = "Change Catogary"; itemChangestatus.Click += ItemChangestatus_Click; itemChangestatus.Size = new System.Drawing.Size(104, 22); ctm.Items.Add(itemChangestatus); ToolStripMenuItem itemFeatureImage = new ToolStripMenuItem(); itemFeatureImage.Text = "Change Feature Image"; itemFeatureImage.Click += ItemFeatureImage_Click; itemFeatureImage.Size = new System.Drawing.Size(104, 22); ctm.Items.Add(itemFeatureImage); ToolStripMenuItem itemVision = new ToolStripMenuItem(); itemVision.Text = "Change Default Vision (Front or Behide)"; itemVision.Click += ItemVision_Click; itemVision.Size = new System.Drawing.Size(104, 22); ctm.Items.Add(itemVision); dv.ContextMenuStrip = ctm; #endregion }
public void Init() { btn_Refresh = new Button(); btn_Refresh.Location = new Point(610, 20); btn_Refresh.Size = new Size(100, 30); btn_Refresh.Text = "Refresh "; btn_Refresh.Click += Btn_Refresh_Click; this.Controls.Add(btn_Refresh); #region DivPage dp = new DivPage(new Point(20, btn_Refresh.Location.Y + btn_Refresh.Height + 10)); dp.OnIndexChanged += Dp_OnIndexChanged; dp.setMaxcount(10); this.Controls.Add(dp); #endregion #region Data dv = new DataGridView(); dv.Location = new Point(10, dp.Location.Y + dp.Height + 10); dv.Size = new Size(700, 250); dv.Columns.Add("ID", "ID"); dv.Columns.Add("QT", "Câu hỏi"); dv.Columns["ID"].Width = 70; dv.Columns["QT"].Width = 580; dv.Rows.Add(10); dv.ReadOnly = true; dv.AllowUserToAddRows = false; dv.SelectionChanged += Dv_SelectionChanged; dv.CellMouseClick += Dv_CellMouseClick; dv.MultiSelect = false; this.Controls.Add(dv); #endregion #region Action ctm = new ContextMenuStrip(); ctm.Size = new System.Drawing.Size(105, 26); ToolStripMenuItem itemAdd = new ToolStripMenuItem(); itemAdd.Text = "Add FAQ"; itemAdd.Click += ItemAdd_Click; itemAdd.Size = new System.Drawing.Size(104, 22); ctm.Items.Add(itemAdd); ToolStripMenuItem itemUpdate = new ToolStripMenuItem(); itemUpdate.Text = "Update FAQ"; itemUpdate.Click += ItemUpdate_Click; itemUpdate.Size = new System.Drawing.Size(104, 22); ctm.Items.Add(itemUpdate); ToolStripMenuItem itemDelete = new ToolStripMenuItem(); itemDelete.Text = "Delete FAQ"; itemDelete.Click += ItemDelete_Click; itemDelete.Size = new System.Drawing.Size(104, 22); ctm.Items.Add(itemDelete); ToolStripMenuItem itemDetail = new ToolStripMenuItem(); itemDetail.Text = "Detail FAQ"; itemDetail.Click += ItemDetail_Click; itemDetail.Size = new System.Drawing.Size(104, 22); ctm.Items.Add(itemDetail); dv.ContextMenuStrip = ctm; #endregion }
private void Init() { #region Search gb_Search = new GroupBox(); gb_Search.Location = new Point(10, 10); gb_Search.Size = new Size(700, 130); gb_Search.Text = "Search"; this.Controls.Add(gb_Search); lb_begin_date = new Label(); lb_begin_date.Location = new Point(10, 25); lb_begin_date.Size = new Size(70, 20); lb_begin_date.Text = "Begin Date: "; gb_Search.Controls.Add(lb_begin_date); dtp_begin_date = new DateTimePicker(); dtp_begin_date.Location = new Point(lb_begin_date.Location.X + lb_begin_date.Size.Width, 20); dtp_begin_date.Size = new Size(250, 20); dtp_begin_date.Format = DateTimePickerFormat.Custom; dtp_begin_date.CustomFormat = "yyyy-MM-dd HH:mm:ss"; dtp_begin_date.Value = DateTime.Now.AddDays(-1); gb_Search.Controls.Add(dtp_begin_date); lb_end_date = new Label(); lb_end_date.Location = new Point(dtp_begin_date.Location.X + dtp_begin_date.Size.Width + 10, 25); lb_end_date.Size = new Size(70, 20); lb_end_date.Text = "End Date: "; gb_Search.Controls.Add(lb_end_date); dtp_end_date = new DateTimePicker(); dtp_end_date.Location = new Point(lb_end_date.Location.X + lb_end_date.Size.Width, 20); dtp_end_date.Size = new Size(250, 20); dtp_end_date.Format = DateTimePickerFormat.Custom; dtp_end_date.CustomFormat = "yyyy-MM-dd HH:mm:ss"; dtp_end_date.Value = DateTime.Now; gb_Search.Controls.Add(dtp_end_date); lb_user = new Label(); lb_user.Location = new Point(10, lb_begin_date.Location.Y + lb_begin_date.Height + 10); lb_user.Size = new Size(70, 20); lb_user.Text = "User: "******"Status: "; gb_Search.Controls.Add(lb_status); cb_status = new ComboBox(); cb_status.Location = new Point(lb_status.Location.X + lb_status.Width, lb_user.Location.Y); cb_status.Size = new Size(250, 20); cb_status.DropDownStyle = ComboBoxStyle.DropDownList; cb_status.DisplayMember = "name"; gb_Search.Controls.Add(cb_status); btn_Search = new Button(); btn_Search.Size = new Size(100, 30); btn_Search.Location = new Point(cb_status.Location.X + cb_status.Width - btn_Search.Width, lb_user.Location.Y + lb_user.Height + 10); btn_Search.Text = "Search "; btn_Search.Click += Btn_Search_Click; gb_Search.Controls.Add(btn_Search); #endregion #region DivPage dp = new DivPage(new Point(20, gb_Search.Location.Y + gb_Search.Height + 10)); dp.OnIndexChanged += Dp_OnIndexChanged; dp.setMaxcount(10); this.Controls.Add(dp); #endregion #region Data dv = new DataGridView(); dv.Location = new Point(10, dp.Location.Y + dp.Height + 10); dv.Size = new Size(700, 250); dv.Columns.Add("ID", "ID"); dv.Columns.Add("UN", "User Name"); dv.Columns.Add("Q", "Quantity"); dv.Columns.Add("D", "CreateDate"); dv.Columns.Add("SS", "Status"); dv.Columns["ID"].Width = 50; dv.Columns["UN"].Width = 250; dv.Columns["Q"].Width = 70; dv.Columns["D"].Width = 150; dv.Columns["SS"].Width = 130; dv.Rows.Add(10); dv.AllowUserToAddRows = false; dv.ReadOnly = true; this.Controls.Add(dv); #endregion #region Action ctm = new ContextMenuStrip(); ctm.Size = new System.Drawing.Size(105, 26); ToolStripMenuItem itemChangestatus = new ToolStripMenuItem(); itemChangestatus.Text = "Change status"; itemChangestatus.Click += ItemChangestatus_Click; itemChangestatus.Size = new System.Drawing.Size(104, 22); ctm.Items.Add(itemChangestatus); ToolStripMenuItem itemDelete = new ToolStripMenuItem(); itemDelete.Text = "Delete Order"; itemDelete.Click += ItemDelete_Click; itemDelete.Size = new System.Drawing.Size(104, 22); ctm.Items.Add(itemDelete); ToolStripMenuItem itemDetail = new ToolStripMenuItem(); itemDetail.Text = "Detail Order"; itemDetail.Click += ItemDetail_Click; itemDetail.Size = new System.Drawing.Size(104, 22); ctm.Items.Add(itemDetail); dv.ContextMenuStrip = ctm; #endregion }
public void Init() { #region Search gb_Search = new GroupBox(); gb_Search.Location = new Point(10, 20); gb_Search.Size = new Size(700, 50); gb_Search.Text = "Search"; this.Controls.Add(gb_Search); rdb_All = new RadioButton(); rdb_All.Location = new Point(10, 25); rdb_All.Size = new Size(150, 20); rdb_All.Text = "Tất cả"; rdb_All.Checked = true; gb_Search.Controls.Add(rdb_All); rdb_Replied = new RadioButton(); rdb_Replied.Location = new Point(rdb_All.Location.X + rdb_All.Size.Width + 10, 25); rdb_Replied.Size = new Size(150, 20); rdb_Replied.Text = "Đã trả lời"; gb_Search.Controls.Add(rdb_Replied); rdb_NotReplied = new RadioButton(); rdb_NotReplied.Location = new Point(rdb_Replied.Location.X + rdb_Replied.Size.Width + 10, 25); rdb_NotReplied.Size = new Size(150, 20); rdb_NotReplied.Text = "Chưa trả lời"; gb_Search.Controls.Add(rdb_NotReplied); //lb_MaSP = new Label(); //lb_MaSP.Location = new Point(10, 25); //lb_MaSP.Size = new Size(70, 20); //lb_MaSP.Text = "Mã SP: "; //gb_Search.Controls.Add(lb_MaSP); //tb_MaSP = new TextBox(); //tb_MaSP.Location = new Point(lb_MaSP.Location.X + lb_MaSP.Size.Width, 20); //tb_MaSP.Size = new Size(200, 20); //gb_Search.Controls.Add(tb_MaSP); //lb_TenSP = new Label(); //lb_TenSP.Location = new Point(tb_MaSP.Location.X + tb_MaSP.Size.Width + 10, 25); //lb_TenSP.Size = new Size(70, 20); //lb_TenSP.Text = "Tên SP: "; //gb_Search.Controls.Add(lb_TenSP); //tb_TenSP = new TextBox(); //tb_TenSP.Location = new Point(lb_TenSP.Location.X + lb_TenSP.Size.Width, 20); //tb_TenSP.Size = new Size(200, 20); //gb_Search.Controls.Add(tb_TenSP); btn_Search = new Button(); btn_Search.Location = new Point(rdb_NotReplied.Location.X + rdb_NotReplied.Size.Width + 10, 15); btn_Search.Size = new Size(100, 30); btn_Search.Text = "Search "; btn_Search.Click += Btn_Search_Click; gb_Search.Controls.Add(btn_Search); #endregion #region DivPage dp = new DivPage(new Point(20, gb_Search.Location.Y + gb_Search.Height + 10)); dp.OnIndexChanged += Dp_OnIndexChanged; dp.setMaxcount(10); this.Controls.Add(dp); #endregion #region Data dv = new DataGridView(); dv.Location = new Point(10, dp.Location.Y + dp.Height + 10); dv.Size = new Size(700, 250); dv.Columns.Add("ID", "ID"); dv.Columns.Add("TNG", "Tên người gửi"); dv.Columns.Add("MNG", "Mail người gửi"); dv.Columns.Add("PNG", "SDT người gửi"); dv.Columns.Add("IR", "Trạng thái"); dv.Columns["ID"].Width = 70; dv.Columns["TNG"].Width = 150; dv.Columns["MNG"].Width = 200; dv.Columns["PNG"].Width = 100; dv.Columns["IR"].Width = 130; dv.Rows.Add(10); dv.ReadOnly = true; dv.AllowUserToAddRows = false; dv.SelectionChanged += Dv_SelectionChanged; dv.CellMouseClick += Dv_CellMouseClick; dv.MultiSelect = false; this.Controls.Add(dv); #endregion lb_message = new Label(); lb_message.Location = new Point(10, dv.Location.Y + dv.Height + 10); lb_message.Size = new Size(200, 30); lb_message.Text = "Nội dung:"; lb_message.Font = new Font("consolas", 18); this.Controls.Add(lb_message); btn_reviewReply = new Button(); btn_reviewReply.Location = new Point(gb_Search.Width - 110, dv.Location.Y + dv.Height + 10); btn_reviewReply.Size = new Size(100, 30); btn_reviewReply.Text = "Xem lại Trả lời"; //btn_reviewReply.Font = new Font("consolas", 18); btn_reviewReply.Click += Btn_reviewReply_Click; btn_reviewReply.Visible = false; this.Controls.Add(btn_reviewReply); btn_Reply = new Button(); btn_Reply.Location = new Point(gb_Search.Width - 110, dv.Location.Y + dv.Height + 10); btn_Reply.Size = new Size(100, 30); btn_Reply.Text = "Trả lời"; //btn_Reply.Font = new Font("consolas", 18); btn_Reply.Click += Btn_Reply_Click; btn_Reply.Visible = false; this.Controls.Add(btn_Reply); rtb_message = new RichTextBox(); rtb_message.Location = new Point(10, lb_message.Location.Y + lb_message.Height + 10); rtb_message.Size = new Size(gb_Search.Width, 200); this.Controls.Add(rtb_message); }
public void Init() { #region Search gb_Search = new GroupBox(); gb_Search.Location = new Point(10, 10); gb_Search.Size = new Size(700, 50); gb_Search.Text = "Search"; this.Controls.Add(gb_Search); lb_MaSP = new Label(); lb_MaSP.Location = new Point(10, 25); lb_MaSP.Size = new Size(100, 20); lb_MaSP.Text = "Mã Collections: "; gb_Search.Controls.Add(lb_MaSP); tb_MaSP = new TextBox(); tb_MaSP.Location = new Point(lb_MaSP.Location.X + lb_MaSP.Size.Width, 20); tb_MaSP.Size = new Size(170, 20); gb_Search.Controls.Add(tb_MaSP); lb_TenSP = new Label(); lb_TenSP.Location = new Point(tb_MaSP.Location.X + tb_MaSP.Size.Width + 10, 25); lb_TenSP.Size = new Size(120, 20); lb_TenSP.Text = "Tên Collections: "; gb_Search.Controls.Add(lb_TenSP); tb_TenSP = new TextBox(); tb_TenSP.Location = new Point(lb_TenSP.Location.X + lb_TenSP.Size.Width, 20); tb_TenSP.Size = new Size(170, 20); gb_Search.Controls.Add(tb_TenSP); btn_Search = new Button(); btn_Search.Location = new Point(tb_TenSP.Location.X + tb_TenSP.Size.Width + 10, 15); btn_Search.Size = new Size(100, 30); btn_Search.Text = "Search "; btn_Search.Click += Btn_Search_Click; gb_Search.Controls.Add(btn_Search); #endregion #region DivPage dp = new DivPage(new Point(20, gb_Search.Location.Y + gb_Search.Height + 10)); dp.OnIndexChanged += Dp_OnIndexChanged; dp.setMaxcount(10); this.Controls.Add(dp); #endregion #region Data dv = new DataGridView(); dv.Location = new Point(10, dp.Location.Y + dp.Height + 10); dv.Size = new Size(700, 250); dv.Columns.Add("MC", "Mã collection"); dv.Columns.Add("NC", "Tên collection"); dv.Columns.Add("TC", "Title collection"); dv.Columns.Add("SS", "Bản chính thức"); dv.Columns["MC"].Width = 50; dv.Columns["NC"].Width = 150; dv.Columns["TC"].Width = 350; dv.Columns["SS"].Width = 100; dv.Rows.Add(10); dv.ReadOnly = true; dv.AllowUserToAddRows = false; dv.MultiSelect = false; dv.CellMouseClick += Dv_CellMouseClick; dv.SelectionChanged += Dv_SelectionChanged; this.Controls.Add(dv); #endregion #region Action ctm = new ContextMenuStrip(); ctm.Size = new System.Drawing.Size(105, 26); ToolStripMenuItem itemAdd = new ToolStripMenuItem(); itemAdd.Text = "Add"; itemAdd.Click += ItemAdd_Click; itemAdd.Size = new System.Drawing.Size(104, 22); ctm.Items.Add(itemAdd); ToolStripMenuItem itemUpdate = new ToolStripMenuItem(); itemUpdate.Text = "Update"; itemUpdate.Click += ItemUpdate_Click; itemUpdate.Size = new System.Drawing.Size(104, 22); ctm.Items.Add(itemUpdate); ToolStripMenuItem itemDelete = new ToolStripMenuItem(); itemDelete.Text = "Delete"; itemDelete.Click += ItemDelete_Click; itemDelete.Size = new System.Drawing.Size(104, 22); ctm.Items.Add(itemDelete); ToolStripMenuItem itemDetail = new ToolStripMenuItem(); itemDetail.Text = "Detail"; itemDetail.Click += ItemDetail_Click; itemDetail.Size = new System.Drawing.Size(104, 22); ctm.Items.Add(itemDetail); dv.ContextMenuStrip = ctm; #endregion }