コード例 #1
0
        void gridView1_RowCellClick(object sender, DevExpress.XtraGrid.Views.Grid.RowCellClickEventArgs e)
        {
            DataRow dr = gridView1.GetDataRow(e.RowHandle);

            if (e.Column.Name == "update")
            {
                ucPharmacyDiaryAdd uclivingdiaryadd = new ucPharmacyDiaryAdd();
                uclivingdiaryadd.Datarow = dr;
                uclivingdiaryadd.SetDate();
                DialogResult dialogresult = uclivingdiaryadd.ShowDialog();
                if (dialogresult == DialogResult.OK)
                {
                    GetData();
                }
                uclivingdiaryadd.Dispose();
            }
            if (e.Column.Name == "del")
            {
                object obj = TmoServiceClient.InvokeServerMethodT <bool>(funCode.DeleteProduct, dr["living_guid"].ToString());
                if (Convert.ToBoolean(obj))
                {
                    DXMessageBox.Show("删除成功!", true);
                    GetData();
                }
                else
                {
                    DXMessageBox.Show("删除失败!", true);
                }
            }
        }
コード例 #2
0
        private void btnAddTarget_Click(object sender, EventArgs e)
        {
            int[] rowHandles      = this.gridView1.GetSelectedRows();
            ucPharmacyDiaryAdd da = new ucPharmacyDiaryAdd();

            if (rowHandles != null && rowHandles.Length > 0)
            {
                var userID = gridView1.GetRowCellValue(rowHandles[0], "user_id").ToString();
                da.SetValue(userID);
            }
            DialogResult dr = da.ShowDialog();

            if (dr == DialogResult.OK)
            {
                GetData();
            }
            da.Dispose();
        }