lu
2024-11-14 a0a61a0ae191ef17124b0bc00557de4f3f383c6a
DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQmCheckitemDt.cs
@@ -6,7 +6,6 @@
using System.Windows.Forms;
using DevExpress.XtraEditors;
using DevExpress.XtraGrid.Views.Grid;
using Gs.DevApp.DevFrm.QC.Models;
using Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
using Gs.DevApp.UserControl;
@@ -574,6 +573,7 @@
                foreach (DataRow dr in dt.Rows)
                {
                    rptJYBZ.Items.Add((new CboItemEntity(dr["SampleSizeNo"].ToString(), dr["SampleSizeName"].ToString())));
                    //rptJYBZ.Items.Add((new CboItemEntity(dr["SampleSizeNo"].ToString(), dr["SampleSizeName"].ToString())));
                    //string ddddd = dr["SampleSizeName"].ToString();
                }
            }
@@ -632,20 +632,55 @@
            ComboBoxEdit comboBox = sender as ComboBoxEdit;
            if (comboBox != null)
            {
                GridView myView = (gcMx1.MainView as GridView);
                int dataIndex = myView.GetDataSourceRowIndex(myView.FocusedRowHandle);
                CboItemEntity _itm = comboBox.EditValue as CboItemEntity;
                string _val = _itm.Value.ToString();
                string _txt = _itm.Text.ToString();
                gvMx1.CloseEditor();
                gvMx1.UpdateCurrentRow();
                GridView myView = (gcMx1.MainView as GridView);
                int dataIndex = myView.GetDataSourceRowIndex(myView.FocusedRowHandle);
                myView.SetRowCellValue(dataIndex, "sampleSizeNo", _val);
                myView.SetRowCellValue(dataIndex, "sampleSizeName", _txt);
                gvMx1.SetRowCellValue(dataIndex, "sampleSizeNo", _val);
                gvMx1.SetRowCellValue(dataIndex, "sampleSizeName", _txt);
            }
        }
        private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            gvMx1.CloseEditor();
            gvMx1.UpdateCurrentRow();
            var rowhandle = gvMx1.FocusedRowHandle;
            if (rowhandle < 0)
                return;
            if (e.Button.Index == 0)
            {
                var dr = gvMx1.GetDataRow(rowhandle);
                var mxGuid = dr["guid"].ToString();
                if (!MsgHelper.AskQuestion("你选择了1条数据,确定删除吗?"))
                    return;
                if (string.IsNullOrEmpty(mxGuid))
                {
                    gvMx1.DeleteRow(rowhandle);
                    return;
                }
                var strJson = "";
                var lst = new List<string>();
                lst.Add(mxGuid);
                try
                {
                    strJson = UtilityHelper.HttpPost("",
                        _webServiceName + "DeleteModelMx",
                        JsonConvert.SerializeObject(lst));
                    var _rtn = UtilityHelper.ReturnToDynamic(strJson);
                    if (_rtn.rtnCode > 0) getModel(lbGuid.Text, true, 1);
                    MsgHelper.Warning("提示:" + _rtn.rtnMsg);
                }
                catch (Exception ex)
                {
                    MsgHelper.Warning("提示:" + ex.Message);
                }
            }
        }
        #endregion
    }
}