131 lines
4.4 KiB
C#
131 lines
4.4 KiB
C#
using DAL;
|
|
using System;
|
|
using System.Drawing;
|
|
using System.Windows.Forms;
|
|
using Telerik.WinControls.UI;
|
|
|
|
namespace NSAnalysis
|
|
{
|
|
public partial class FEditTolerance : Telerik.WinControls.UI.ShapedForm
|
|
{
|
|
#region 全局变量
|
|
|
|
private TMeasureMSSQLDAL tmdal = new TMeasureMSSQLDAL();
|
|
|
|
private FToleranceSetup gFTS;
|
|
|
|
#endregion 全局变量
|
|
|
|
#region 鼠标事件
|
|
|
|
private void btn_MouseHover(object sender, EventArgs e)
|
|
{
|
|
RadButton btn = sender as RadButton;
|
|
btn.BackColor = Color.FromArgb(0, 151, 186);
|
|
}
|
|
|
|
private void btn_MouseLeave(object sender, EventArgs e)
|
|
{
|
|
RadButton btn = sender as RadButton;
|
|
btn.BackColor = Color.FromArgb(19, 46, 53);
|
|
}
|
|
|
|
#endregion 鼠标事件
|
|
|
|
|
|
|
|
public FEditTolerance(FToleranceSetup fts)
|
|
{
|
|
InitializeComponent();
|
|
|
|
gFTS = fts;
|
|
}
|
|
|
|
private void FEditTolerance_Load(object sender, EventArgs e)
|
|
{
|
|
|
|
rtbCarName.Text = gFTS.dgvTolList.Rows[gFTS.idgvSelectRowNumber].Cells["modelsName"].Value.ToString();
|
|
rtbCarType.Text = gFTS.dgvTolList.Rows[gFTS.idgvSelectRowNumber].Cells["modelsCode"].Value.ToString();
|
|
rtb_sourceFilePath.Text = gFTS.dgvTolList.Rows[gFTS.idgvSelectRowNumber].Cells["sourceFile"].Value.ToString();
|
|
rtb_targetFilePath.Text = gFTS.dgvTolList.Rows[gFTS.idgvSelectRowNumber].Cells["targetFile"].Value.ToString();
|
|
|
|
rddl_ReadType.Text = gFTS.dgvTolList.Rows[gFTS.idgvSelectRowNumber].Cells["readType"].Value.ToString();
|
|
rddl_Position.Text = gFTS.dgvTolList.Rows[gFTS.idgvSelectRowNumber].Cells["position"].Value.ToString();
|
|
rddl_Status.Text = gFTS.dgvTolList.Rows[gFTS.idgvSelectRowNumber].Cells["status"].Value.ToString();
|
|
}
|
|
|
|
private void rbtnOK_Click(object sender, EventArgs e)
|
|
{
|
|
#region 防愚操作
|
|
|
|
string strCarType = rtbCarType.Text.Trim();
|
|
//string strMesPointName = rtbMesPointName.Text.Trim();
|
|
|
|
//string strDimensionName = rddlDimensionName.Text.Trim();
|
|
//if (string.IsNullOrEmpty(rtbCarType.Text.Trim()))
|
|
//{
|
|
// MessageBox.Show("车身类型不能为空,请重新输入! ", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
|
// return;
|
|
//}
|
|
|
|
//if (string.IsNullOrEmpty(rtbMesPointName.Text.Trim()))
|
|
//{
|
|
// MessageBox.Show("测量点位名称不能为空,请重新输入! ", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
|
// return;
|
|
//}
|
|
//if (string.IsNullOrEmpty(rtbLower.Text.Trim()))
|
|
//{
|
|
// MessageBox.Show("下限值不能为空,请重新输入! ", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
|
// return;
|
|
//}
|
|
//if (string.IsNullOrEmpty(rtbUpper.Text.Trim()))
|
|
//{
|
|
// MessageBox.Show("上限值不能为空,请重新输入! ", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
|
// return;
|
|
//}
|
|
|
|
//if (rtbCarType.Text != gFTS.dgvTolList.Rows[gFTS.idgvSelectRowNumber].Cells["CarType"].Value.ToString() || rtbMesPointName.Text != gFTS.dgvTolList.Rows[gFTS.idgvSelectRowNumber].Cells["MeasurePointName"].Value.ToString() || rddlDimensionName.Text != gFTS.dgvTolList.Rows[gFTS.idgvSelectRowNumber].Cells["DimensionName"].Value.ToString())
|
|
//{
|
|
// if (tmdal.CheckTaskExit(strCarType, strMesPointName, strDimensionName))
|
|
// {
|
|
// MessageBox.Show("该车身类型下,已经存在该测量点位名称和尺寸名称,请修改!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
|
|
|
// return;
|
|
// }
|
|
//}
|
|
|
|
#endregion 防愚操作
|
|
|
|
//try
|
|
//{
|
|
// TToleranceModel ttm = new TToleranceModel();
|
|
// ttm.Id = int.Parse(gFTS.dgvTolList.Rows[gFTS.idgvSelectRowNumber].Cells["Id"].Value.ToString());
|
|
// ttm.CarType = strCarType;
|
|
// ttm.MeasurePointName = strMesPointName;
|
|
// ttm.DimensionName = strDimensionName;
|
|
// ttm.TolLower = double.Parse(rtbLower.Text.Trim());
|
|
// ttm.TolUpper = double.Parse(rtbUpper.Text.Trim());
|
|
// //ttm.Remark = rtbRemark.Text.Trim();
|
|
// ttm.CreateTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
|
// tmdal.UpdateTTolerance(ttm);
|
|
//}
|
|
//catch (Exception ex)
|
|
//{
|
|
// MessageBox.Show("修改公差带信息失败,原因:" + ex.ToString(), "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
|
|
|
// return;
|
|
//}
|
|
|
|
//MessageBox.Show("修改公差带信息成功! ", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
|
|
|
//gFTS.rtbnSearch_Click(null, null);
|
|
|
|
//this.Close();
|
|
}
|
|
|
|
private void rbtnCancel_Click(object sender, EventArgs e)
|
|
{
|
|
this.Close();
|
|
}
|
|
}
|
|
} |