| | |
| | | { |
| | | |
| | | InitializeComponent(); |
| | | //toolBarMenu1.btnAddClick += ToolBarMenu1_btnAddClick; |
| | | //toolBarMenu1.btnEdtClick += ToolBarMenu1_btnEdtClick; |
| | | //toolBarMenu1.btnSaveClick += ToolBarMenu1_btnSaveClick; |
| | | //toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick; |
| | | //toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick1; |
| | | //toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick; |
| | | //toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick; |
| | | //toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick; |
| | | this.toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick; |
| | | this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick; |
| | | tlMenu.DoubleClick += TlMenu_DoubleClick; |
| | |
| | | { |
| | | Gs.DevApp.ToolBox.MsgHelper.ShowInformation("该窗体不支持查询,若想更新页面,请点击 刷新"); |
| | | } |
| | | /// <summary> |
| | | /// 查询回调 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void Frm_UpdateParent(object sender, UpdateParentEventArgs e) |
| | | { |
| | | _filterList = e.FilterList; |
| | | getTree(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 刷新事件 |
| | | /// </summary> |
| | |
| | | getModel(rowGuid, false, 999); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 反审核 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | /// <exception cref="NotImplementedException"></exception> |
| | | private void ToolBarMenu1_btnFChkClick(object sender, EventArgs e) |
| | | { |
| | | toolBarMenu1.guidKey = ""; |
| | | string rowGuid, rowName; |
| | | (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, |
| | | lbGuid, txt_name, tlMenu); |
| | | toolBarMenu1.guidKey = rowGuid; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 审核事件 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void ToolBarMenu1_btnChkClick(object sender, EventArgs e) |
| | | { |
| | | toolBarMenu1.guidKey = ""; |
| | | string rowGuid, rowName; |
| | | (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, |
| | | lbGuid, txt_name, tlMenu); |
| | | toolBarMenu1.guidKey = rowGuid; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 取消事件 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void ToolBarMenu1_btnEscClick(object sender, EventArgs e) |
| | | { |
| | | UtilityHelper.JumpToTab(xtraTabControl1, 0); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 删除事件 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void ToolBarMenu1_btnDelClick1(object sender, EventArgs e) |
| | | { |
| | | string rowGuid, rowName; |
| | | (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, |
| | | lbGuid, txt_name, tlMenu); |
| | | if (string.IsNullOrEmpty(rowGuid)) |
| | | { |
| | | MsgHelper.Warning("请先选择你要删除的行!"); |
| | | return; |
| | | } |
| | | |
| | | if (!MsgHelper.AskQuestion("你选择了【" + rowName + "】,确定删除吗?")) return; |
| | | var lst = new List<string>(); |
| | | lst.Add(rowGuid); |
| | | var _obj = lst; |
| | | try |
| | | { |
| | | var strJson = UtilityHelper.HttpPost("", |
| | | "Organization/DeleteModel", |
| | | JsonConvert.SerializeObject(_obj)); |
| | | var _rtn = UtilityHelper.ReturnToDynamic(strJson); |
| | | if (_rtn.rtnCode > 0) |
| | | { |
| | | UtilityHelper.JumpToTab(xtraTabControl1, 0); |
| | | getTree(); |
| | | } |
| | | |
| | | MsgHelper.Warning("提示:" + _rtn.rtnMsg); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MsgHelper.Warning("提示:" + ex.Message); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /// <summary> |
| | | /// 修改事件 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void ToolBarMenu1_btnEdtClick(object sender, EventArgs e) |
| | | { |
| | | string rowGuid, rowName; |
| | | (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, |
| | | lbGuid, txt_name, tlMenu); |
| | | if (string.IsNullOrEmpty(rowGuid)) |
| | | { |
| | | MsgHelper.Warning("请先选择你要操作的行!"); |
| | | return; |
| | | } |
| | | |
| | | getModel(rowGuid, true, 1); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 新增事件 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void ToolBarMenu1_btnAddClick(object sender, EventArgs e) |
| | | { |
| | | UtilityHelper.JumpToTab(xtraTabControl1, 1); |
| | | lbGuid.Text = ""; |
| | | UtilityHelper.CleanValueByControl(panel1.Controls, true); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 保存事件 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |
| | | /// <param name="e"></param> |
| | | private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e) |
| | | { |
| | | toolBarMenu1.isSetBtn = false; |
| | | if (string.IsNullOrEmpty(txt_fNumber.Text.Trim())) |
| | | { |
| | | MsgHelper.Warning("编号不能为空!"); |
| | | txt_fNumber.Focus(); |
| | | return; |
| | | } |
| | | |
| | | if (string.IsNullOrEmpty(txt_name.Text.Trim())) |
| | | { |
| | | MsgHelper.Warning("名称不能为空!"); |
| | | txt_name.Focus(); |
| | | return; |
| | | } |
| | | |
| | | if (string.IsNullOrEmpty(txt_conPeople.Text.Trim())) |
| | | { |
| | | MsgHelper.Warning("联系人不能为空!"); |
| | | txt_conPeople.Focus(); |
| | | return; |
| | | } |
| | | |
| | | if (string.IsNullOrEmpty(txt_conTel.Text.Trim())) |
| | | { |
| | | MsgHelper.Warning("联系电话不能为空!"); |
| | | txt_conTel.Focus(); |
| | | return; |
| | | } |
| | | |
| | | var _upGuid = txt_upGuid.Text.Trim().Length > 0 |
| | | ? txt_upGuid.SelectedValue.ToString() |
| | | : ""; |
| | | var _obj = new |
| | | { |
| | | guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //主建 |
| | | upGuid = _upGuid, //上级的主建 |
| | | name = txt_name.Text.Trim(), //名称 |
| | | conPeople = txt_conPeople.Text, //联系人 |
| | | conTel = txt_conPeople.Text, //联系电话 |
| | | isStatus = txt_isStatus.Checked, //状态 |
| | | factory = txt_fNumber.Text //组织编号 |
| | | }; |
| | | try |
| | | { |
| | | var strJson = UtilityHelper.HttpPost("", |
| | | "Organization/EditModel", |
| | | JsonConvert.SerializeObject(_obj)); |
| | | var _rtn = UtilityHelper.ReturnToDynamic(strJson); |
| | | MsgHelper.Warning("提示:" + _rtn.rtnMsg); |
| | | if (_rtn.rtnCode > 0) |
| | | { |
| | | lbGuid.Text = _rtn.rtnData; |
| | | toolBarMenu1.isSetBtn = true; |
| | | UtilityHelper.ChangeEnableByControl(panel1.Controls, false); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | MsgHelper.Warning("提示:" + ex.Message); |
| | | } |
| | | } |
| | | |
| | | private void getTree() |
| | | { |
| | | tlMenu.Nodes.Clear(); |
| | |
| | | MsgHelper.Warning("提示:" + ex.Message); |
| | | } |
| | | } |
| | | |
| | | private void getModel(string strGuid, bool isEdit, int tabIdx) |
| | | { |
| | | if (string.IsNullOrEmpty(strGuid)) |
| | |
| | | MsgHelper.Warning("提示:" + ex.Message); |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | } |