| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585 |
- using Core.Mes.Client.Comm.Format;
- using Core.Mes.Client.Comm.Server;
- using Core.Mes.Client.Comm.Tool;
- using Core.StlMes.Client.PnCost.Models;
- using CoreFS.CA06;
- using Infragistics.Win.UltraWinGrid;
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace Core.StlMes.Client.PnCost
- {
- public partial class frmBaseProcesscostC : FrmBase
- {
- #region 定义变量
- public frmBaseProcesscostC()
- {
- InitializeComponent();
- }
- private DataTable dtpline;
- #endregion
- #region 初始化
- private void frmBaseProcesscostC_Load(object sender, EventArgs e)
- {
- EntityHelper.ShowGridCaption<CostBaseProcesscostCEntity>(ultraGrid1.DisplayLayout.Bands[0]);
- dtpline = ServerHelper.GetData("com.steering.pss.pncost.base.ComBaseProcesscostC.queryPliao",
- new object[] { }, ob);
- ultraComboEditor1.DisplayMember = "PLINE_NAME";
- ultraComboEditor1.ValueMember = "PLINE_CODE";
- ultraComboEditor1.DataSource = dtpline;
- ultraComboEditor2.DisplayMember = "PLINE_NAME";
- ultraComboEditor2.ValueMember = "PLINE_CODE";
- ultraComboEditor2.DataSource = dtpline;
- ultraCheckEditor1.Checked = false;//模糊
- ultraTextEditor1.Enabled = false;//模糊
- ultraCheckEditor3.Checked = false;
- ultraComboEditor2.Enabled = false;
- Query();
- }
- #endregion
- #region 方法
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- base.ToolBar_Click(sender, ToolbarKey);
- switch (ToolbarKey)
- {
- case "Query":
- Query();
- break;
- case "Update":
- Save();
- break;
- case "Delete":
- Delete();
- break;
- case "Resume":
- Resume();
- break;
- case "Close":
- this.Close();
- break;
- }
- }
- /// 查询方法
- /// <summary>
- /// 查询方法
- /// </summary>
- private void Query()
- {
- #region 条件验证
- //产线
- string strPei = "";
- if (ultraCheckEditor1.Checked)//产线是否选择
- {
- if (ultraTextEditor1.Text == "")//产线是否输入
- {
- MessageUtil.ShowWarning("请输入产线!");
- return;
- }
- else
- {
- strPei = ultraTextEditor1.Text.Trim();//产线
- }
- }
- //产线
- if (ultraCheckEditor3.Checked)//产线是否选择
- {
- strPei = ultraComboEditor2.Text;//产线
- }
- #endregion
- List<CostBaseProcesscostCEntity> data = EntityHelper.GetData<CostBaseProcesscostCEntity>(
- "com.steering.pss.pncost.base.ComBaseProcesscostC.query", new object[] { strPei }, ob);
- costBaseProcesscostCEntityBindingSource.DataSource = data;
- if (ultraGrid1.Rows.Count == 0)
- {
- return;
- }
- for (int i = 0; i < ultraGrid1.Rows.Count; i++)
- {
- if (ultraGrid1.Rows[i].Cells["VALIDFLAG"].Value.ToString() == "无效")
- {
- ultraGrid1.Rows[i].Appearance.ForeColor = Color.Red;
- }
- ultraGrid1.Rows[i].Cells["PLINENAMENEW"].Value = ultraGrid1.Rows[i].Cells["PLINENAME"].Value;
- ultraGrid1.Rows[i].Cells["SCHEDULEMINNEW"].Value = ultraGrid1.Rows[i].Cells["SCHEDULEMIN"].Value;
- ultraGrid1.Rows[i].Cells["SCHEDULEMAXNEW"].Value = ultraGrid1.Rows[i].Cells["SCHEDULEMAX"].Value;
- ultraGrid1.Rows[i].Cells["CHK"].Value = false;
- GridEdite(ultraGrid1.Rows[i]);
- }
- ultraGrid1.UpdateData();
- ultraGrid1.ActiveRow = ultraGrid1.Rows[0];
- }
- /// 保存方法
- /// <summary>
- /// 保存方法
- /// </summary>
- private void Save()
- {
- string stringnew = "";
- string min = "";
- string max = "";
- string xuanze = "false";
- try
- {
- #region 验证信息
- ultraGrid1.UpdateData();
- for (int i = 0; i < ultraGrid1.Rows.Count; i++)
- {
- if (ultraGrid1.Rows[i].Cells["CHK"].Value.ToString() == "True")
- {
- if (ultraGrid1.Rows[i].Cells["PLINENAME"].Value.ToString2() == "")
- {
- MessageUtil.ShowWarning("产线不能为空!请选择产线");
- return;
- }
- if (ultraGrid1.Rows[i].Cells["SCHEDULEMIN"].Value.ToString2() == "")
- {
- MessageUtil.ShowWarning("排产量下限不能为空!请重新输入");
- return;
- }
- if (ultraGrid1.Rows[i].Cells["SCHEDULEMAX"].Value.ToString2() == "")
- {
- MessageUtil.ShowWarning("排产量上限不能为空!请重新输入");
- return;
- }
- if (Convert.ToDecimal(ultraGrid1.Rows[i].Cells["SCHEDULEMAX"].Value.ToString3()) <=
- Convert.ToDecimal(ultraGrid1.Rows[i].Cells["SCHEDULEMIN"].Value.ToString3()))
- {
- MessageUtil.ShowWarning("排产量上限<=下限!请重新输入");
- return;
- }
- if (ultraGrid1.Rows[i].Cells["COSTPRICE"].Value.ToString2() == "")
- {
- MessageUtil.ShowWarning("吨加工费不能为空!请重新输入");
- return;
- }
- if (ultraGrid1.Rows[i].Cells["CREATENAME"].Value.ToString2() == "")//判断是新增还是修改的保存
- {
- stringnew = ultraGrid1.Rows[i].Cells["PLINENAME"].Text.ToString2();
- min = ultraGrid1.Rows[i].Cells["SCHEDULEMIN"].Value.ToString3();
- max = ultraGrid1.Rows[i].Cells["SCHEDULEMAX"].Value.ToString3();
- DataTable dt = ServerHelper.GetData("com.steering.pss.pncost.base.ComBaseProcesscostC.queryNum", new Object[] { stringnew, min, max }, ob);
- if (Convert.ToInt32(dt.Rows[0][0].ToString()) > 0)
- {
- MessageUtil.ShowWarning("排产量上下限范围有重合!,请重新输入");
- return;
- }
- for (int index = 0; index < ultraGrid1.Rows.Count; index++)
- {
- if (ultraGrid1.Rows[index].Cells["CHK"].Value.ToString() == "True" && i != index &&
- ultraGrid1.Rows[index].Cells["PLINENAME"].Text.ToString() == stringnew)
- {
- if (Convert.ToDecimal(ultraGrid1.Rows[index].Cells["SCHEDULEMIN"].Value.ToString()) < Convert.ToDecimal(min) &&
- Convert.ToDecimal(ultraGrid1.Rows[index].Cells["SCHEDULEMAX"].Value.ToString()) > Convert.ToDecimal(min))
- {
- MessageUtil.ShowWarning("排产量上下限范围有重合!,请重新输入");
- return;
- }
- if (Convert.ToDecimal(ultraGrid1.Rows[index].Cells["SCHEDULEMIN"].Value.ToString()) < Convert.ToDecimal(max) &&
- Convert.ToDecimal(ultraGrid1.Rows[index].Cells["SCHEDULEMAX"].Value.ToString()) > Convert.ToDecimal(max))
- {
- MessageUtil.ShowWarning("排产量上下限范围有重合!,请重新输入");
- return;
- }
- if (Convert.ToDecimal(ultraGrid1.Rows[index].Cells["SCHEDULEMIN"].Value.ToString()) > Convert.ToDecimal(min) &&
- Convert.ToDecimal(ultraGrid1.Rows[index].Cells["SCHEDULEMAX"].Value.ToString()) < Convert.ToDecimal(max))
- {
- MessageUtil.ShowWarning("排产量上下限范围有重合!,请重新输入");
- return;
- }
- }
- }
- }
- else //修改
- {
- stringnew = ultraGrid1.Rows[i].Cells["PLINENAME"].Text.ToString2();
- min = ultraGrid1.Rows[i].Cells["SCHEDULEMIN"].Value.ToString3();
- max = ultraGrid1.Rows[i].Cells["SCHEDULEMAX"].Value.ToString3();
- if (ultraGrid1.Rows[i].Cells["PLINENAME"].Value.ToString2() != ultraGrid1.Rows[i].Cells["PLINENAMENEW"].Value.ToString2() ||
- ultraGrid1.Rows[i].Cells["SCHEDULEMIN"].Value.ToString2() != ultraGrid1.Rows[i].Cells["SCHEDULEMINNEW"].Value.ToString2() ||
- ultraGrid1.Rows[i].Cells["SCHEDULEMAX"].Value.ToString2() != ultraGrid1.Rows[i].Cells["SCHEDULEMAXNEW"].Value.ToString2())
- {
- //DataTable dt = ServerHelper.GetData("com.steering.pss.pncost.base.ComBaseProcesscostC.queryNum", new Object[] { stringnew, min, max }, ob);
- //DataTable dtnew = ServerHelper.GetData("com.steering.pss.pncost.base.ComBaseProcesscostC.queryshangxia", new Object[] { stringnew, min, max }, ob);
- //if (Convert.ToInt32(dt.Rows[0][0].ToString()) > 0)
- //{
- // for (int j = 0; j < dtnew.Rows.Count; j++)//修改的时候 要剔除本身那条数据
- // {
- // if (!(dtnew.Rows[j]["PLINE_NAME"].ToString2() == ultraGrid1.Rows[i].Cells["PLINENAMENEW"].Text.ToString2() &&
- // dtnew.Rows[j]["SCHEDULE_MIN"].ToString2() == ultraGrid1.Rows[i].Cells["SCHEDULEMINNEW"].Text.ToString2() &&
- // dtnew.Rows[j]["SCHEDULE_MAX"].ToString2() == ultraGrid1.Rows[i].Cells["SCHEDULEMAXNEW"].Text.ToString2()))
- // {
- // MessageUtil.ShowWarning("排产量上下限范围有重合!,请重新输入");
- // return;
- // }
- // }
- //}
- for (int index = 0; index < ultraGrid1.Rows.Count; index++)
- {
- if ( i != index &&
- ultraGrid1.Rows[index].Cells["PLINENAME"].Text.ToString() == stringnew)
- {
- if (Convert.ToDecimal(ultraGrid1.Rows[index].Cells["SCHEDULEMIN"].Value.ToString()) < Convert.ToDecimal(min) &&
- Convert.ToDecimal(ultraGrid1.Rows[index].Cells["SCHEDULEMAX"].Value.ToString()) > Convert.ToDecimal(min))
- {
- MessageUtil.ShowWarning("排产量上下限范围有重合!,请重新输入");
- return;
- }
- if (Convert.ToDecimal(ultraGrid1.Rows[index].Cells["SCHEDULEMIN"].Value.ToString()) < Convert.ToDecimal(max) &&
- Convert.ToDecimal(ultraGrid1.Rows[index].Cells["SCHEDULEMAX"].Value.ToString()) > Convert.ToDecimal(max))
- {
- MessageUtil.ShowWarning("排产量上下限范围有重合!,请重新输入");
- return;
- }
- if (Convert.ToDecimal(ultraGrid1.Rows[index].Cells["SCHEDULEMIN"].Value.ToString()) > Convert.ToDecimal(min) &&
- Convert.ToDecimal(ultraGrid1.Rows[index].Cells["SCHEDULEMAX"].Value.ToString()) < Convert.ToDecimal(max))
- {
- MessageUtil.ShowWarning("排产量上下限范围有重合!,请重新输入");
- return;
- }
- }
- }
- }
- }
- xuanze = "true";
- }
- }
- if (xuanze == "false")
- {
- MessageUtil.ShowWarning("请选择你要保存的记录!");
- return;
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否确认保存?") == System.Windows.Forms.DialogResult.No)
- {
- return;
- }
- #endregion
- for (int i = 0; i < ultraGrid1.Rows.Count; i++)
- {
- if (ultraGrid1.Rows[i].Cells["CHK"].Value.ToString() == "True")
- {
- CostBaseProcesscostCEntity parm = new CostBaseProcesscostCEntity();
- parm.PlineName = ultraGrid1.Rows[i].Cells["PLINENAME"].Text.ToString();
- parm.ProcessCode = ultraGrid1.Rows[i].Cells["PROCESSCODE"].Value.ToString();
- parm.ProcessDesc = ultraGrid1.Rows[i].Cells["PROCESSDESC"].Value.ToString();
- parm.ScheduleMax = Convert.ToDecimal(ultraGrid1.Rows[i].Cells["SCHEDULEMAX"].Value.ToString3());
- parm.ScheduleMin = Convert.ToDecimal(ultraGrid1.Rows[i].Cells["SCHEDULEMIN"].Value.ToString3());
- parm.CostPrice = Convert.ToDecimal(ultraGrid1.Rows[i].Cells["COSTPRICE"].Value.ToString3());
- parm.Memo = ultraGrid1.Rows[i].Cells["MEMO"].Value.ToString();
- if (ultraGrid1.Rows[i].Cells["CREATENAME"].Value.ToString() == "")//判断是新增还是修改的保存
- {
- parm.PlineCode = ultraGrid1.Rows[i].Cells["PLINENAME"].Value.ToString2();
- parm.CreateName = this.UserInfo.GetUserName();//新增保存
- string JsonStr = JSONFormat.Format(parm);
- ServerHelper.SetData("com.steering.pss.pncost.base.ComBaseProcesscostC.isave", new object[] { JsonStr }, ob);
- }
- else
- {
- if (ultraGrid1.Rows[i].Cells["PLINENAME"].Text.ToString2() != ultraGrid1.Rows[i].Cells["PLINENAMENEW"].Value.ToString2())
- {
- parm.PlineCode = ultraGrid1.Rows[i].Cells["PLINENAME"].Value.ToString();
- }
- else
- {
- parm.PlineCode = ultraGrid1.Rows[i].Cells["PLINECODE"].Value.ToString();
- }
- parm.UpdateName = this.UserInfo.GetUserName();//修改保存
- string JsonStr = JSONFormat.Format(parm);
- string plinenamenew = "";
- min = ultraGrid1.Rows[i].Cells["SCHEDULEMINNEW"].Value.ToString3();
- max = ultraGrid1.Rows[i].Cells["SCHEDULEMAXNEW"].Value.ToString3();
- plinenamenew = ultraGrid1.Rows[i].Cells["PLINENAMENEW"].Value.ToString();
- ServerHelper.SetData("com.steering.pss.pncost.base.ComBaseProcesscostC.usave", new object[] { JsonStr, plinenamenew, min, max }, ob);
- }
- }
- }
- }
- catch (Exception ex)
- {
- MessageUtil.ShowError("保存失败!'" + ex.Message + "'");
- return;
- }
- MessageUtil.ShowTips("保存成功!");
- Query();
- for (int i = 0; i < ultraGrid1.Rows.Count; i++)
- {
- if (ultraGrid1.Rows[i].Cells["PLINENAME"].Text.ToString() == stringnew)
- {
- ultraGrid1.Rows[i].Activate();
- }
- }
- }
- /// 删除方法
- /// <summary>
- /// 删除方法
- /// </summary>
- private void Delete()
- {
- string stringnew = "";
- string xuanze = "false";
- try
- {
- #region 验证信息
- ultraGrid1.UpdateData();
- for (int i = 0; i < ultraGrid1.Rows.Count; i++)
- {
- if (ultraGrid1.Rows[i].Cells["CHK"].Value.ToString() == "True")
- {
- //是否已经是无效方案
- if (ultraGrid1.Rows[i].Cells["VALIDFLAG"].Value.ToString() != "有效")
- {
- MessageUtil.ShowWarning("选择了已经作废的数据!");
- return;
- }
- xuanze = "true";
- }
- }
- if (xuanze == "false")
- {
- MessageUtil.ShowWarning("请选择你要删除的记录!");
- return;
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否确认删除?") == System.Windows.Forms.DialogResult.No)
- {
- return;
- }
- #endregion
- for (int i = 0; i < ultraGrid1.Rows.Count; i++)
- {
- if (ultraGrid1.Rows[i].Cells["CHK"].Value.ToString() == "True")
- {
- stringnew = ultraGrid1.Rows[i].Cells["PLINENAME"].Text.ToString();
- CostBaseProcesscostCEntity parm = new CostBaseProcesscostCEntity();
- parm.PlineCode = ultraGrid1.Rows[i].Cells["PLINECODE"].Value.ToString();
- parm.ScheduleMax = Convert.ToDecimal(ultraGrid1.Rows[i].Cells["SCHEDULEMAX"].Value.ToString3());
- parm.ScheduleMin = Convert.ToDecimal(ultraGrid1.Rows[i].Cells["SCHEDULEMIN"].Value.ToString3());
- parm.CostPrice = Convert.ToDecimal(ultraGrid1.Rows[i].Cells["COSTPRICE"].Value.ToString3());
- parm.UpdateName = this.UserInfo.GetUserName();
- parm.DeleteName = this.UserInfo.GetUserName();
- string JsonStr = JSONFormat.Format(parm);
- ServerHelper.SetData("com.steering.pss.pncost.base.ComBaseProcesscostC.delete", new object[] { JsonStr }, ob);
- }
- }
- }
- catch (Exception ex)
- {
- MessageUtil.ShowError("删除失败!'" + ex.Message + "'");
- return;
- }
- MessageUtil.ShowTips("删除成功!");
- Query();
- for (int i = 0; i < ultraGrid1.Rows.Count; i++)
- {
- if (ultraGrid1.Rows[i].Cells["PLINENAME"].Text.ToString() == stringnew)
- {
- ultraGrid1.Rows[i].Activate();
- }
- }
- }
- /// 恢复方法
- /// <summary>
- /// 恢复方法
- /// </summary>
- private void Resume()
- {
- string stringnew = "";
- string min = "";
- string max = "";
- string xuanze = "false";
- try
- {
- #region 验证信息
- ultraGrid1.UpdateData();
- for (int i = 0; i < ultraGrid1.Rows.Count; i++)
- {
- if (ultraGrid1.Rows[i].Cells["CHK"].Value.ToString() == "True")
- {
- stringnew = ultraGrid1.Rows[i].Cells["PLINENAME"].Text.ToString2();
- min = ultraGrid1.Rows[i].Cells["SCHEDULEMIN"].Value.ToString3();
- max = ultraGrid1.Rows[i].Cells["SCHEDULEMAX"].Value.ToString3();
- DataTable dt = ServerHelper.GetData("com.steering.pss.pncost.base.ComBaseProcesscostC.queryNum", new Object[] { stringnew, min, max }, ob);
- if (Convert.ToInt32(dt.Rows[0][0].ToString()) > 0)
- {
- MessageUtil.ShowWarning("排产量上下限范围有重合!,不允许恢复");
- return;
- }
- //是否是无效方案
- if (ultraGrid1.Rows[i].Cells["VALIDFLAG"].Value.ToString() != "无效")
- {
- MessageUtil.ShowWarning("选择了没有作废的数据!");
- return;
- }
- xuanze = "true";
- }
- }
- if (xuanze == "false")
- {
- MessageUtil.ShowWarning("请选择你要恢复的记录!");
- return;
- }
- if (MessageUtil.ShowYesNoAndQuestion("是否确认恢复?") == System.Windows.Forms.DialogResult.No)
- {
- return;
- }
- #endregion
- for (int i = 0; i < ultraGrid1.Rows.Count; i++)
- {
- if (ultraGrid1.Rows[i].Cells["CHK"].Value.ToString() == "True")
- {
- stringnew = ultraGrid1.Rows[i].Cells["PLINENAME"].Text.ToString();
- CostBaseProcesscostCEntity parm = new CostBaseProcesscostCEntity();
- parm.PlineCode = ultraGrid1.Rows[i].Cells["PLINECODE"].Value.ToString();
- parm.ScheduleMax = Convert.ToDecimal(ultraGrid1.Rows[i].Cells["SCHEDULEMAX"].Value.ToString3());
- parm.ScheduleMin = Convert.ToDecimal(ultraGrid1.Rows[i].Cells["SCHEDULEMIN"].Value.ToString3());
- parm.CostPrice = Convert.ToDecimal(ultraGrid1.Rows[i].Cells["COSTPRICE"].Value.ToString3());
- parm.UpdateName = this.UserInfo.GetUserName();
- string JsonStr = JSONFormat.Format(parm);
- ServerHelper.SetData("com.steering.pss.pncost.base.ComBaseProcesscostC.resume", new object[] { JsonStr }, ob);
- }
- }
- }
- catch (Exception ex)
- {
- MessageUtil.ShowError("恢复失败!'" + ex.Message + "'");
- return;
- }
- MessageUtil.ShowTips("恢复成功!");
- Query();
- for (int i = 0; i < ultraGrid1.Rows.Count; i++)
- {
- if (ultraGrid1.Rows[i].Cells["PLINENAME"].Text.ToString() == stringnew)
- {
- ultraGrid1.Rows[i].Activate();
- }
- }
- }
- #endregion
- #region 事件
- /// 选择事件
- /// <summary>
- /// 选择事件
- /// </summary>
- private void ultraGrid1_CellChange(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs e)
- {
- ultraGrid1.UpdateData();
- if (e.Cell.Column.Key == "CHK")
- {
- GridEdite(e.Cell.Row);
- }
- if (e.Cell.Column.Key == "PlineName")
- {
- for (int i = 0; i < dtpline.Rows.Count; i++)
- {
- if (e.Cell.Row.GetText("PlineName").ToString2() == dtpline.Rows[i]["PLINE_NAME"].ToString2())
- {
- ultraGrid1.ActiveRow.Cells["PROCESSCODE"].Value = dtpline.Rows[i]["PROCESS_CODE"].ToString2();
- ultraGrid1.ActiveRow.Cells["PROCESSDESC"].Value = dtpline.Rows[i]["PROCESS_DESC"].ToString2();
- }
- }
- }
- }
- /// 选择判断
- /// <summary>
- /// 选择判断
- /// </summary>
- private void GridEdite(UltraGridRow row)
- {
- if (row.GetValue("CHK") == "True")
- {
- foreach (UltraGridCell cell in row.Cells)
- {
- if (cell.Column.CellActivation == Activation.AllowEdit)
- {
- cell.Activation = Activation.AllowEdit;
- }
- }
- }
- else
- {
- foreach (UltraGridCell cell in row.Cells)
- {
- if (cell.Column.Key == "CHK") continue;
- if (cell.Column.CellActivation == Activation.AllowEdit)
- {
- cell.Activation = Activation.ActivateOnly;
- }
- }
- }
- }
- /// 新增行事件
- /// <summary>
- /// 新增行事件
- /// </summary>
- private void ultraGrid1_InitializeTemplateAddRow(object sender, InitializeTemplateAddRowEventArgs e)
- {
- e.TemplateAddRow.Cells["CHK"].Value = false;
- foreach (UltraGridCell cell in e.TemplateAddRow.Cells)
- {
- if (cell.Column.CellActivation == Activation.AllowEdit)
- {
- cell.Activation = Activation.ActivateOnly;
- }
- }
- e.TemplateAddRow.Cells["CHK"].Activation = Activation.AllowEdit;
- //GridEdite(e.TemplateAddRow);
- }
- /// 模糊查询事件
- /// <summary>
- /// 模糊查询事件
- /// </summary>
- private void ultraCheckEditor1_CheckedChanged(object sender, EventArgs e)
- {
- if (ultraCheckEditor1.Checked == false)
- {
- ultraTextEditor1.Enabled = this.ultraCheckEditor1.Checked;
- }
- else {
- ultraTextEditor1.Enabled = this.ultraCheckEditor1.Checked;
- if (ultraCheckEditor3.Checked==true)
- {
- ultraCheckEditor3.Checked = ultraComboEditor2.Enabled = false;
- }
- }
-
- }
- /// 新增行事件
- /// <summary>
- /// 新增行事件
- /// </summary>
- private void ultraCheckEditor3_CheckedChanged(object sender, EventArgs e)
- {
- if (ultraCheckEditor3.Checked == false)
- {
- ultraComboEditor2.Enabled = this.ultraCheckEditor3.Checked;
- }
- else
- {
- ultraComboEditor2.Enabled = this.ultraCheckEditor3.Checked;
- if (ultraCheckEditor1.Checked == true)
- {
- ultraCheckEditor1.Checked = ultraTextEditor1.Enabled = false;
- }
- }
- }
- #endregion
-
- }
- }
|