| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Text;
- using System.Windows.Forms;
- using System.Collections;
- using System.IO;
- using System.Diagnostics;
- using Infragistics.Win.UltraWinGrid;
- using CoreFS.CA06;
- namespace Core.StlMes.Client.LgResMgt
- {
- public partial class frmCutInfoAssit : FrmBase
- {
- private bool ok_flag = false;
- private string WorkShopNo = "";
- public frmCutInfoAssit()
- {
- InitializeComponent();
- }
- private void frmCutInfoAssit_Load(object sender, EventArgs e)
- {
- //WorkShopNo = this.CustomInfo;
- //this.ultraDateTimeEditor1.Value = DateTime.Today.ToString("yyyy-MM-dd") + " 00:00";
- //this.ultraDateTimeEditor2.Value = DateTime.Today.ToString("yyyy-MM-dd") + " 23:59"; ;
- }
- // 查询
- /// <summary>
- /// 查询
- /// </summary>
- private void proc_Query()
- {
- //this.dataSet1.Tables[0].Clear();
- //try
- //{
- // string strWhere = " where workshopno='"+WorkShopNo+"'";
- // string strFrom = ultraDateTimeEditor1.DateTime.ToString("yyyy-MM-dd");
- // string strTo = ultraDateTimeEditor2.DateTime.ToString("yyyy-MM-dd");
- // strWhere += " and to_char(OPTDATE, 'yyyy-MM-dd') between '" + strFrom + "' and '" + strTo + "'";
- // string str = ultraTextEditor2.Text.Trim();
- // if (checkBox2.Checked)
- // {
- // if (str.Length > 0)
- // {
- // strWhere += " and HEATNO = '" + str + "'";
- // }
- // else
- // {
- // MessageBox.Show("炉号条件不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- // ultraTextEditor2.Focus();
- // return;
- // }
- // }
- // if (checkBox1.Checked)
- // {
- // if (isUp.SelectedIndex >= 0)
- // {
- // strWhere += " and UPSTATUS = '" + isUp.Value.ToString() + "'";
- // }
- // else
- // {
- // MessageBox.Show("上传状态不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- // isUp.Focus();
- // return;
- // }
- // }
- // string strErr = "";
- // ArrayList arry = new ArrayList();
- // ArrayList sqlList = new ArrayList();
- // arry.Add("IncisionAssist.Query");//此ID为XML文件ID
- // sqlList.Add(strWhere);
- // CoreClientParam ccp= new CoreClientParam();
- // DataTable dt = new DataTable();
- // ccp.ServerName = "Core.LgMes.Server.Common.ComDBQuery";
- // ccp.MethodName = "doQuery";
- // ccp.ServerParams = new object[] { arry, sqlList };
- // ccp.SourceDataTable = dt;
- // this.ExecuteSortResultByQueryToDataTable(ccp, CoreInvokeType.Internal);
- // strErr = ccp.ReturnInfo;
- // if (strErr != "" || dt.Rows.Count==0 ) return;
- // DataSet ds = new DataSet();
- // ds.Tables.Add(dt);
- // if (ds != null && ds.Tables.Count > 0)
- // {
- // this.dataTable1.Rows.Clear();
- // DataRow dr;
- // string column_name = "";
- // for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
- // {
- // dr = this.dataTable1.NewRow();
- // for (int j = 0; j < dataTable1.Columns.Count; j++)
- // {
- // column_name = dataTable1.Columns[j].ColumnName;
- // dr[column_name] = ds.Tables[0].Rows[i][column_name].ToString();
- // }
- // this.dataTable1.Rows.Add(dr);
- // }
- // ultraGrid1.UpdateData();
- // //PublicMethod.RefreshAndAutoSize(ultraGrid1);
- // Hashtable htOperate = new Hashtable();
- // htOperate.Add("已上传", Color.LightGreen);
- // Core.StlMes.Client.LgDeviceManager.LadleCommonClass.SetGridBackColor(ultraGrid1, htOperate, "UPSTATUS", true);
- // }
- // if (ultraGrid1.Rows.Count > 0)
- // {
- // string isUpload = "";
- // for (int i = 0; i < ultraGrid1.Rows.Count; i++)
- // {
- // isUpload = ultraGrid1.Rows[i].Cells["UPSTATUS"].Value.ToString();
- // if (isUpload == "已上传")
- // {
- // ultraGrid1.Rows[i].Cells["FLAG"].Activation = Activation.NoEdit;
- // }
- // }
- // }
- //}
- //catch { }
- }
- // 新增
- /// <summary>
- /// 新增
- /// </summary>
- private void proc_Add()
- {
- //try
- //{
- // if (txtHeatNo.Text.Length != 8)
- // {
- // MessageBox.Show("炉号不正确!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- // txtHeatNo.Focus();
- // return;
- // }
- // string heatno = txtHeatNo.Text.Trim();
- // string strErr = "";
- // ArrayList arry = new ArrayList();
- // arry.Add("IncisionAssistInfo.Query"); // 位于 QueryLgIntegration.xml 中
- // arry.Add(heatno);
- // if (WorkShopNo == "1")
- // {
- // arry.Add("0");
- // arry.Add("1");
- // arry.Add("2");
- // }
- // else
- // {
- // arry.Add("3");
- // arry.Add("4");
- // arry.Add("5");
- // }
- // CommonClientToServer ccs = new CommonClientToServer();
- // ccs.ob = this.ob;
- // DataSet ds = ccs.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr);
- // if (ds.Tables[0].Rows.Count == 0)
- // {
- // MessageBox.Show("炉号【" + heatno + "】不存在切割信息!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- // return;
- // }
- // if (cboCutType.SelectedIndex < 0)
- // {
- // MessageBox.Show("切割类别不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- // cboCutType.Focus();
- // return;
- // }
- // if (ultraFlux.SelectedIndex < 0)
- // {
- // MessageBox.Show("流号不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- // ultraFlux.Focus();
- // return;
- // }
- // if (txtLength.Text.Length == 0)
- // {
- // MessageBox.Show("长度不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- // txtLength.Focus();
- // return;
- // }
- // if (txtWeight.Text.Length == 0)
- // {
- // MessageBox.Show("重量不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- // txtWeight.Focus();
- // return;
- // }
- // if (txtThickness.Text.Length == 0)
- // {
- // MessageBox.Show("厚度不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- // txtThickness.Focus();
- // return;
- // }
- // if (txtWidth.Text.Length == 0)
- // {
- // MessageBox.Show("宽度不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- // txtWidth.Focus();
- // return;
- // }
-
- // strErr = "";
- // string strSqlID = "IncisionAssist.Add";
- // object[] sArgs = new object[13];
- // sArgs[0] = txtHeatNo.Text.Trim(); //炉号
- // sArgs[1] = cboCutType.Text.Trim(); //切割类别
- // sArgs[2] = txtLength.Text.Trim(); //长度
- // sArgs[3] = txtWeight.Text.Trim(); //重量
- // sArgs[4] = txtThickness.Text.Trim(); //厚度
- // sArgs[5] = txtWidth.Text.Trim(); //宽度
- // sArgs[6] = (cutTime.Text.ToString() == "" ? DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") :
- // (Convert.ToDateTime(cutTime.Text.Trim())).ToString("yyyy-MM-dd HH:mm:ss")); //切割时间
- // sArgs[7] = this.UserInfo.GetUserName();
- // sArgs[8] = txtPro.Text.Trim();
- // sArgs[9] = textBox2.Text.Trim();
- // sArgs[10] = txtThweight.Text.Trim() == "" ? "0" : txtThweight.Text.Trim();
- // sArgs[11] = WorkShopNo;
- // sArgs[12] = ultraFlux.Value.ToString();
- // try
- // {
- // CommonClientToServer ccTs = new CommonClientToServer();
- // ccTs.ob = ob;
- // string strRCode = ccTs.ExecuteProcedureFunctions("Core.LgMes.Server.Common.ComDBProcedure",
- // "ExecProcWithCollParam", strSqlID, sArgs, out strErr);
- // if (strErr != "")
- // {
- // MessageBox.Show("新增失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
- // return;
- // }
- // else
- // {
- // this.proc_Query();
- // ok_flag = true;
- // MessageBox.Show("新增成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- // }
- // }
- // catch { }
- //}
- //catch { }
- }
- // 修改
- /// <summary>
- /// 修改
- /// </summary>
- private void proc_Edit()
- {
- //try
- //{
-
-
- // string heatno = txtHeatNo.Text.Trim();
- // string strErr = "";
- // ArrayList arry = new ArrayList();
- // arry.Add("IncisionAssistInfo.Query"); // 位于 QueryLgIntegration.xml 中
- // arry.Add(heatno);
- // if (WorkShopNo == "1")
- // {
- // arry.Add("0");
- // arry.Add("1");
- // arry.Add("2");
- // }
- // else
- // {
- // arry.Add("3");
- // arry.Add("4");
- // arry.Add("5");
- // }
- // CommonClientToServer ccs = new CommonClientToServer();
- // ccs.ob = this.ob;
- // DataSet ds = ccs.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr);
- // if (ds.Tables[0].Rows.Count == 0)
- // {
- // MessageBox.Show("炉号【" + heatno + "】不存在切割信息!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- // return;
- // }
-
- // if (txtHeatNo.Text.Length != 8)
- // {
- // MessageBox.Show("炉号不正确!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- // txtHeatNo.Focus();
- // return;
- // }
- // if (cboCutType.SelectedIndex < 0)
- // {
- // MessageBox.Show("切割类别不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- // cboCutType.Focus();
- // return;
- // }
- // if (ultraFlux.SelectedIndex < 0)
- // {
- // MessageBox.Show("流号不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- // ultraFlux.Focus();
- // return;
- // }
- // if (txtLength.Text.Length == 0)
- // {
- // MessageBox.Show("长度不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- // txtLength.Focus();
- // return;
- // }
- // if (txtWeight.Text.Length == 0)
- // {
- // MessageBox.Show("重量不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- // txtWeight.Focus();
- // return;
- // }
- // if (txtThickness.Text.Length == 0)
- // {
- // MessageBox.Show("厚度不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- // txtThickness.Focus();
- // return;
- // }
- // if (txtWidth.Text.Length == 0)
- // {
- // MessageBox.Show("宽度不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- // txtWidth.Focus();
- // return;
- // }
- // strErr = "";
- // string strSqlID = "IncisionAssist.Update";
- // object[] sArgs = new object[14];
- // sArgs[0] = txtHeatNo.Text.Trim(); //炉号
- // sArgs[1] = cboCutType.Text.Trim(); //切割类别
- // sArgs[2] = txtLength.Text.Trim(); //长度
- // sArgs[3] = txtWeight.Text.Trim(); //重量
- // sArgs[4] = txtThickness.Text.Trim(); //厚度
- // sArgs[5] = txtWidth.Text.Trim(); //宽度
- // sArgs[6] = (cutTime.Text.ToString() == "" ? DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") :
- // (Convert.ToDateTime(cutTime.Text.Trim())).ToString("yyyy-MM-dd HH:mm:ss")); //切割时间
- // sArgs[7] = this.UserInfo.GetUserName();
- // sArgs[8] = txtPro.Text.Trim();
- // sArgs[9] = WorkShopNo; //体系号
- // sArgs[10] = ultraGrid1.ActiveRow.Cells["ID"].Value.ToString(); //ID
- // sArgs[11] = textBox2.Text.Trim();
- // sArgs[12] = txtThweight.Text.Trim() == "" ? "0" : txtThweight.Text.Trim();
- // sArgs[13] = ultraFlux.Value.ToString();
- // try
- // {
- // CommonClientToServer ccTs = new CommonClientToServer();
- // ccTs.ob = ob;
- // string strRCode = ccTs.ExecuteProcedureFunctions("Core.LgMes.Server.Common.ComDBProcedure",
- // "ExecProcWithCollParam", strSqlID, sArgs, out strErr);
- // if (strErr != "")
- // {
- // MessageBox.Show("修改失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
- // return;
- // }
- // else
- // {
- // this.proc_Query();
- // ok_flag = true;
- // MessageBox.Show("修改成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- // }
- // }
- // catch { }
- //}
- //catch { }
- }
- // 删除
- /// <summary>
- /// 删除
- /// </summary>
- private void proc_Delete()
- {
- //try
- //{
- // if (ultraGrid1.Rows.Count == 0)
- // {
- // MessageBox.Show("没有可删除的信息!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- // return;
- // }
- // if (ultraGrid1.ActiveRow == null)
- // {
- // MessageBox.Show("请选择要删除的信息!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- // return;
- // }
- // if (ultraGrid1.ActiveRow.Cells["UPSTATUS"].Value.ToString().Trim() == "已上传")
- // {
- // MessageBox.Show("选中的信息已上传,不能删除!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- // return;
- // }
- // DialogResult dr = MessageBox.Show("是否确认删除信息?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
- // if (dr == DialogResult.No) return;
- // string ID = ultraGrid1.ActiveRow.Cells["ID"].Value.ToString().Trim();
- // string strErr = "";
- // string strSqlID = "IncisionAssist.Delete";
- // object[] sArgs = new object[1];
- // sArgs[0] = ID; //ID
- // try
- // {
- // CommonClientToServer ccTs = new CommonClientToServer();
- // ccTs.ob = ob;
- // string strRCode = ccTs.ExecuteProcedureFunctions("Core.LgMes.Server.Common.ComDBProcedure",
- // "ExecProcWithCollParam", strSqlID, sArgs, out strErr);
- // if (strErr != "")
- // {
- // MessageBox.Show("删除失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
- // return;
- // }
- // else
- // {
- // this.proc_Query();
- // MessageBox.Show("删除成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- // }
- // }
- // catch { }
- //}
- //catch { }
- }
- // 设置编辑区域是否可编辑
- /// <summary>
- /// 设置编辑区域是否可编辑
- /// </summary>
- /// <param name="t_Enable"></param>
- private void setToolEnable(bool t_Enable)
- {
- //try
- //{
- // txtHeatNo.ReadOnly = t_Enable;
- // txtLength.ReadOnly = t_Enable;
- // txtWeight.ReadOnly = t_Enable;
- // cboCutType.ReadOnly = t_Enable;
- // ultraFlux.ReadOnly = t_Enable;
- //}
- //catch { }
- }
- // 清空编辑区域
- /// <summary>
- /// 清空编辑区域
- /// </summary>
- private void clearWidget()
- {
- //txtPro.Text = "";
- //txtWidth.Text = "";
- //txtThickness.Text = "";
- //txtLength.Text = "";
- //txtWeight.Text = "";
- //txtHeatNo.Text = "";
- //txtThweight.Text = "";
- //cboCutType.SelectedIndex = -1;
- //ultraFlux.SelectedIndex = -1;
- }
- public override void ToolBar_Click(object sender, string ToolbarKey)
- {
- //base.ToolBar_Click(sender, ToolbarKey);
- //switch (ToolbarKey)
- //{
- // case "Query":
- // this.proc_Query();
- // break;
- // case "Add":
- // this.proc_Add();
- // break;
- // case "Update":
- // this.proc_Edit();
- // break;
- // case "Delete":
- // this.proc_Delete();
- // break;
- // case "Export":
- // try
- // {
- // //Core.Mes.Client.Common.Globals.ulGridToExcel(ultraGrid1, Text);
- // }
- // catch (Exception ex)
- // {
- // MessageBox.Show(ex.Message);
- // }
- // break;
- // case "Upload":
-
- // this.proc_Query();
- // break;
- // case "Exit":
- // this.Close();
- // break;
- // default:
- // break;
- // }
- }
- private void checkBox2_CheckedChanged(object sender, EventArgs e)
- {
- //ultraTextEditor2.Enabled = checkBox2.Checked;
- }
- private void checkBox1_CheckedChanged(object sender, EventArgs e)
- {
- //isUp.Enabled = checkBox1.Checked;
- }
- private void txtHeatNo_TextChanged(object sender, EventArgs e)
- {
- //try
- //{
- // string heatno = txtHeatNo.Text.Trim();
- // string strErr = "";
- // ArrayList arry = new ArrayList();
- // arry.Add("IncisionAssistInfo.Query"); // 位于 QueryLgIntegration.xml 中
- // arry.Add(heatno);
- // if (WorkShopNo == "1")
- // {
- // arry.Add("0");
- // arry.Add("1");
- // arry.Add("2");
- // }
- // else
- // {
- // arry.Add("3");
- // arry.Add("4");
- // arry.Add("5");
- // }
- // CommonClientToServer ccs = new CommonClientToServer();
- // ccs.ob = this.ob;
- // DataSet ds = ccs.ExecuteQueryFunctions("Core.LgMes.Server.Common.ComDBQuery", "doSimpleQuery", arry, out strErr);
- // if (strErr == "" && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
- // {
- // txtThickness.Text = ds.Tables[0].Rows[0]["THICKNESS"].ToString();
- // txtWidth.Text = ds.Tables[0].Rows[0]["WIDTH"].ToString();
- // cutTime.Value = ds.Tables[0].Rows[0]["CUTTIME"].ToString();
- // txtPro.Text = ds.Tables[0].Rows[0]["SAPPRODORDERNO"].ToString();
- // }
- // else
- // {
- // txtPro.Text = "";
- // txtWidth.Text = "";
- // txtThickness.Text = "";
- // }
- //}
- //catch { }
- }
- private void WidthInput_KeyPress(object sender, KeyPressEventArgs e)
- {
- //if (!(Char.IsNumber(e.KeyChar) || e.KeyChar == '\b' || e.KeyChar == '.'))
- //{
- // e.Handled = true;
- //}
- //char[] arrary = ((TextBox)sender).Text.ToCharArray();
- //if (e.KeyChar == '.')
- //{
- // if (arrary.Length == 0)
- // {
- // ((TextBox)sender).Text = "0.";
- // ((TextBox)sender).SelectionStart = ((TextBox)sender).Text.Trim().Length;
- // e.Handled = true;
- // }
- // else
- // {
- // for (int i = 0; i < arrary.Length; i++)
- // {
- // if (arrary[i] == '.')
- // e.Handled = true;
- // }
- // }
- //}
- //if (arrary.Length == 1)
- //{
- // if (e.KeyChar == '0')
- // {
- // if (arrary[0] == '0')
- // e.Handled = true;
- // }
- // if (arrary[0] == '0' && e.KeyChar != '.' && e.KeyChar != '\b' && e.KeyChar != '0')
- // {
- // ((TextBox)sender).Text = "0." + e.KeyChar.ToString();
- // ((TextBox)sender).SelectionStart = ((TextBox)sender).Text.Trim().Length;
- // e.Handled = true;
- // }
- //}
- }
- private void LengthInput_KeyPress(object sender, KeyPressEventArgs e)
- {
- //if (!(Char.IsNumber(e.KeyChar) || e.KeyChar == '\b' ))
- //{
- // e.Handled = true;
- //}
- //char[] arrary = ((TextBox)sender).Text.ToCharArray();
- //if (arrary.Length == 0)
- //{
- // if (e.KeyChar == '0')
- // {
- // e.Handled = true;
- // }
- //}
- }
- private void HeatNoInput_KeyPress(object sender, KeyPressEventArgs e)
- {
- //if (!(Char.IsNumber(e.KeyChar) || e.KeyChar == '\b'))
- //{
- // e.Handled = true;
- //}
- }
- private void ultraGrid1_AfterRowActivate(object sender, EventArgs e)
- {
- try
- {
- //SetDetailToolBarEnable(false, "");
- //setToolEnable(true);
- //txtID.Text = ultraGrid1.ActiveRow.Cells["ID"].Value.ToString();
- //txtHeatNo.Text = ultraGrid1.ActiveRow.Cells["HEATNO"].Value.ToString();
- //cboCutType.Text = ultraGrid1.ActiveRow.Cells["CATEGORY"].Value.ToString();
- //txtLength.Text = ultraGrid1.ActiveRow.Cells["LENGTH"].Value.ToString();
- //txtWeight.Text = ultraGrid1.ActiveRow.Cells["WEIGHT"].Value.ToString();
- //txtThickness.Text = ultraGrid1.ActiveRow.Cells["THICKNESS"].Value.ToString();
- //txtWidth.Text = ultraGrid1.ActiveRow.Cells["WIDTH"].Value.ToString();
- //cutTime.Value = ultraGrid1.ActiveRow.Cells["CUTTIME"].Value.ToString();
- //txtPro.Text = ultraGrid1.ActiveRow.Cells["PRODORDERNO"].Value.ToString();
- //ultraFlux.Text = ultraGrid1.ActiveRow.Cells["FLUXCODE"].Value.ToString();
- }
- catch { }
- }
- // 点击修改或删除时显示确认和取消按钮
- /// <summary>
- /// 点击修改或删除时显示确认和取消按钮
- /// </summary>
- /// <param name="bEnable"></param>
- private void SetDetailToolBarEnable(bool bEnable, string flag)
- {
- //int count = this.uTbMTool.Tools.Count;
- //for (int i = 0; i < count; i++)
- //{
- // this.uTbMTool.Tools[i].SharedProps.Enabled = !bEnable;
- //}
- //this.uTbMTool.Tools["ok"].SharedProps.Enabled = bEnable;
- //this.uTbMTool.Tools["cancel"].SharedProps.Enabled = bEnable;
- //this.uTbMTool.Tools["ok"].SharedProps.Visible = bEnable;
- //this.uTbMTool.Tools["cancel"].SharedProps.Visible = bEnable;
- }
- private void ultraToolbarsManager_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs e)
- {
- //switch (e.Tool.Key)
- //{
- // case "add":
- // //SetDetailToolBarEnable(true, "add");
- // //setToolEnable(false);
- // //this.uTbMTool.Tools["ok"].Tag = "add";
- // //clearWidget();
- // //cutTime.Value = DateTime.Now;
- // //ok_flag = false;
- // break;
- // case "edit":
- // if (ultraGrid1.Rows.Count == 0)
- // {
- // MessageBox.Show("没有可修改的信息!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- // return;
- // }
- // if (ultraGrid1.ActiveRow == null)
- // {
- // MessageBox.Show("请选择要修改的信息!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- // return;
- // }
- // if (ultraGrid1.ActiveRow.Cells["UPSTATUS"].Value.ToString().Trim() == "已上传")
- // {
- // MessageBox.Show("选中的信息已上传,不能修改!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- // return;
- // }
- // SetDetailToolBarEnable(true, "edit");
- // setToolEnable(false);
- // this.uTbMTool.Tools["ok"].Tag = "edit";
- // ok_flag = false;
- // break;
- // case "del":
- // proc_Delete();
- // break;
- // case "ok":
- // string flag = this.uTbMTool.Tools["ok"].Tag.ToString();
- // if (flag == "edit")
- // {
- // proc_Edit();
- // }
- // if (flag == "add")
- // {
- // proc_Add();
- // }
- // if (ok_flag)
- // {
- // SetDetailToolBarEnable(false, "");
- // setToolEnable(true);
- // }
- // break;
- // case "cancel":
- // SetDetailToolBarEnable(false, "");
- // setToolEnable(true);
- // ultraGrid1_AfterRowActivate(null, null);
- // break;
- // case "left":
- // if (ultraGrid1.Rows.Count == 0) return;
- // //将位置移动到前一条记录
- // try
- // {
- // if (ultraGrid1.ActiveRow == null)
- // {
- // ultraGrid1.Rows[0].Activate();
- // }
- // else
- // {
- // int nIndex = ultraGrid1.ActiveRow.Index;
- // nIndex = nIndex - 1;
- // if (nIndex < 0) nIndex = ultraGrid1.Rows.Count - 1;
- // ultraGrid1.Rows[nIndex].Activate();
- // }
- // }
- // catch { }
- // break;
- // case "right":
- // if (ultraGrid1.Rows.Count == 0) return;
- // //将位置移动到后一条记录
- // try
- // {
- // if (ultraGrid1.ActiveRow == null)
- // {
- // ultraGrid1.Rows[0].Activate();
- // }
- // else
- // {
- // int nIndex = ultraGrid1.ActiveRow.Index;
- // nIndex = nIndex + 1;
- // if (nIndex >= ultraGrid1.Rows.Count) nIndex = 0;
- // ultraGrid1.Rows[nIndex].Activate();
- // }
- // }
- // catch { }
- // break;
- //}
- }
- private void txtLength_TextChanged(object sender, EventArgs e)
- {
- //try
- //{
- // if (txtLength.Text.Length == 0 || txtThickness.Text.Length == 0 || txtWidth.Text.Length == 0)
- // {
- // return;
- // }
- // double n_len = Convert.ToDouble(txtLength.Text.Trim()); //长度
- // double n_thi = Convert.ToDouble(txtThickness.Text.Trim()); //厚度
- // double n_wid = Convert.ToDouble(txtWidth.Text.Trim()); //宽度
- // double n_wei = 0; //理论重量
- // n_wei = (n_thi / 1000 * n_wid / 1000 * 7.85) * n_len / 1000;
- // txtThweight.Text = Math.Round(n_wei,3).ToString();
- //}
- //catch { }
- }
- }
- }
|