private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) { try { int rowhandle = this.gridView1.FocusedRowHandle; Models.dd_shop_signusers dd_Shop_Signusers = new Models.dd_shop_signusers(); dd_Shop_Signusers.name = this.gridView1.GetRowCellValue(rowhandle, "name").ToString(); dd_Shop_Signusers.telno = this.gridView1.GetRowCellValue(rowhandle, "telno").ToString(); dd_Shop_Signusers.maxusenums = Convert.ToInt32(this.gridView1.GetRowCellValue(rowhandle, "maxusenums")); dd_Shop_Signusers.maxprice = Convert.ToDecimal(this.gridView1.GetRowCellValue(rowhandle, "maxprice")); dd_Shop_Signusers.id = Convert.ToInt32(this.gridView1.GetRowCellValue(rowhandle, "id")); if (e.Button.Index == 0) { MyForm.MemberManagement.ProtocolDetaileForm protocolDetaile = new MyForm.MemberManagement.ProtocolDetaileForm(dd_Shop_Signusers, 1); protocolDetaile.StartPosition = FormStartPosition.CenterScreen; protocolDetaile.ShowDialog(); RefreshGridList(); } else if (e.Button.Index == 1) { if (XtraMessageBox.Show("确定清帐?清帐后账单将归零", "清帐确认", MessageBoxButtons.YesNo) == DialogResult.OK) { MemberCard.ClearBillSignUser(dd_Shop_Signusers.id); Utils.utils.ShowTip("提示", "清帐成功!"); RefreshGridList(); } } } catch { } }
public ProtocolDetaileForm(Models.dd_shop_signusers dd_Shop_Signusers, int type) { InitializeComponent(); MyControl.MemberManagement.ProtocolDetaileControl protocolDetaile = new MyControl.MemberManagement.ProtocolDetaileControl(dd_Shop_Signusers, type); protocolDetaile.Dock = DockStyle.Fill; protocolDetaile.CloseEvent += MyCloseEvent; this.Controls.Add(protocolDetaile); }
private void simpleButton1_Click(object sender, EventArgs e) { Models.dd_shop_signusers dd_Shop_Signusers = new Models.dd_shop_signusers(); MyForm.MemberManagement.ProtocolDetaileForm protocolDetaile = new MyForm.MemberManagement.ProtocolDetaileForm(dd_Shop_Signusers, 0); protocolDetaile.StartPosition = FormStartPosition.CenterScreen; protocolDetaile.ShowDialog(); RefreshGridList(); }
public ProtocolDetaileControl(Models.dd_shop_signusers dd_Shop_Signusers, int type)//1编辑 2新增 { InitializeComponent(); this.type = type; if (type == 1) { id = dd_Shop_Signusers.id; this.Txt_maxprice.Text = dd_Shop_Signusers.maxprice.ToString(); this.Txt_maxusenums.Text = dd_Shop_Signusers.maxusenums.ToString(); this.Txt_name.Text = dd_Shop_Signusers.name.ToString(); this.Txt_phone.Text = dd_Shop_Signusers.telno.ToString(); } }