//保存按钮操作 private void save_Product_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(this.tb_productNO.Text.Trim())) { MessageBox.Show("半成品编号不能为空"); return; } HYPDM.Entities.PDM_ALL_PRODUCT temp_product = new HYPDM.Entities.PDM_ALL_PRODUCT(); temp_product.PRODUCTID = Guid.NewGuid().ToString(); temp_product.PRODUCTNO = this.tb_productNO.Text; temp_product.MODELTYPE = this.tb_modeType.Text; temp_product.PRODUCTTYPE = this.tb_productType.Text; temp_product.PRODUCTLEVEL = this.m_type; temp_product.VERSION = "V" + DateTime.Now.ToString("yyyyMMddHHmm"); temp_product.STATUS = "已创建"; temp_product.CREATER = CommonVar.userName; //temp_product.MODIFIER = ""; temp_product.CREATETIME = DateTime.Now.ToString(); //temp_product.MODIFYTIME ; temp_product.MEMO_ZH = this.tb_memoZH.Text; temp_product.MEMO_EN = this.tb_memoEN.Text; temp_product.MEMO = this.rtb_memo.Text; temp_product.Save(); MessageBox.Show("保存成功"); this.Product = temp_product; this.DialogResult = DialogResult.OK; }
/// /// 页面控件初始化******************************************************** /// //dgv_Change表格数据初始化 private void dgv_Change_init(HYPDM.Entities.PDM_ALL_PRODUCT t) { if (t != null) { this.dgv_Change.DataSource = _pjtChangeService.GetAssoList(t.PRODUCTID); } }
/// <summary> /// 基本信息--新建按钮操作 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void toolBaseReg_Click(object sender, EventArgs e) { //1.判断产品编号是否为空 if (string.IsNullOrEmpty(this.tb_productNo.Text.Trim())) { MessageBox.Show("产品编号不能为空"); return; } DataTable dt = m_AllProductService.GetListByNoDetail(this.tb_productNo.Text.Trim()); //1.判断产品是否存在,如果存在是否生产新版本 if (dt.Rows.Count > 0) { if (MessageBox.Show("该产品已存在,是否生产新版本?\n如果不是请更改产品编号!", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No) { return; } } //3.保存新的产品记录 HYPDM.Entities.PDM_ALL_PRODUCT temp_product = new HYPDM.Entities.PDM_ALL_PRODUCT(); temp_product.PRODUCTID = Guid.NewGuid().ToString(); temp_product.PRODUCTNO = this.tb_productNo.Text; temp_product.MODELTYPE = this.tb_modelType.Text; temp_product.PRODUCTTYPE = this.tb_productType.Text; temp_product.PRODUCTLEVEL = this.m_type; temp_product.VERSION = "V" + DateTime.Now.ToString("yyyyMMddHHmmss"); temp_product.STATUS = "已创建"; temp_product.CREATER = LoginInfo.LoginID; //temp_product.MODIFIER = ""; temp_product.CREATETIME = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"); //temp_product.MODIFYTIME ; temp_product.MEMO_ZH = this.tb_memoZh.Text; temp_product.MEMO_EN = this.tb_memoEn.Text; temp_product.MEMO = this.rtbMemo.Text; temp_product.DEL_FLAG = "N"; temp_product.Save(); MessageBox.Show("保存成功"); //4. 判断显示状态 if (this.opStatus) { //a.显示(派生历史记录,ERC,文档,图纸,技术任务单,产品结构,版本)等tab页面 this.tabControl.TabPages.Add(tab_ProRecord); // this.tabControl.TabPages.Add(tab_Change); this.tabControl.TabPages.Add(tab_Doc); this.tabControl.TabPages.Add(tab_Drawing); this.tabControl.TabPages.Add(tab_productStruct); //this.tabControl.TabPages.Add(tab_TelTask); this.tabControl.TabPages.Add(tab_Version); this.tabControl.TabPages.Add(tab_ExtPro); //b.改变显示属性(产品清空状态 ,产品配置状态) this.opStatus = false; } //5.更新(派生历史记录,ERC,文档,图纸,技术任务单,产品结构,版本)等tab页面列表显示,更新基本属性信息 this.m_product = temp_product; allinit(); }
/// <summary> /// 基本信息--清空按钮的操作 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void toolBaseClear_Click(object sender, EventArgs e) { this.m_product = null; //1.清空基本信息显示 this.tb_productNo.Text = ""; this.tb_modelType.Text = ""; this.tb_productType.Text = ""; this.tb_version.Text = ""; this.tb_status.Text = ""; this.tb_creater.Text = ""; this.tb_modifier.Text = ""; this.tb_createTime.Text = ""; this.tb_modifyTime.Text = ""; this.tb_memoZh.Text = ""; this.tb_memoEn.Text = ""; this.rtbMemo.Text = ""; //2.移除(派生历史记录,ERC,文档,图纸,技术任务单,产品结构,版本)等tab 页面 this.tabControl.TabPages.Remove(tab_ProRecord); //this.tabControl.TabPages.Remove(tab_Change); this.tabControl.TabPages.Remove(tab_Doc); this.tabControl.TabPages.Remove(tab_Drawing); this.tabControl.TabPages.Remove(tab_productStruct); //this.tabControl.TabPages.Remove(tab_TelTask); this.tabControl.TabPages.Remove(tab_Version); this.tabControl.TabPages.Remove(tab_ExtPro); //3.改变显示属性(产品清空状态 ,产品配置状态) this.opStatus = true; }
//保存按钮操作 private void save_Product_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(this.tb_productNO.Text.Trim())) { MessageBox.Show("半成品编号不能为空"); return; } HYPDM.Entities.PDM_ALL_PRODUCT temp_product = new HYPDM.Entities.PDM_ALL_PRODUCT(); temp_product.PRODUCTID = Guid.NewGuid().ToString(); temp_product.PRODUCTNO = this.tb_productNO.Text; temp_product.MODELTYPE = this.tb_modeType.Text; temp_product.PRODUCTTYPE = this.tb_productType.Text; temp_product.PRODUCTLEVEL = this.m_type; temp_product.VERSION = "V"+DateTime.Now.ToString("yyyyMMddHHmm"); temp_product.STATUS = "已创建"; temp_product.CREATER = CommonVar.userName; //temp_product.MODIFIER = ""; temp_product.CREATETIME = DateTime.Now.ToString(); //temp_product.MODIFYTIME ; temp_product.MEMO_ZH = this.tb_memoZH.Text; temp_product.MEMO_EN = this.tb_memoEN.Text; temp_product.MEMO = this.rtb_memo.Text; temp_product.Save(); MessageBox.Show("保存成功"); this.Product = temp_product; this.DialogResult = DialogResult.OK; }
public ProductsConfForm(string t_productId, int p_type) { InitializeComponent(); this.tabControl.TabPages.Remove(tab_TelTask); this.tabControl.TabPages.Remove(tab_Change); this.m_type = p_type; this.opStatus = false; service_Init(); this.m_product = m_AllProductService.GetById(t_productId); allinit(); }
//结构体初始化 public PartsStructAddForm(HYPDM.Entities.PDM_ALL_PRODUCT t, String p_assoID, Enum_AssOpType p_assoType) { InitializeComponent(); this.Text = "结构添加--" + t.PRODUCTNO; this.copy_Product = t; m_assoID = p_assoID; m_assoType = p_assoType; tv_struct_init(); toolProComb_init(selectType.Matieral); toolVersionComb_init(); this.dgvgridInit(); }
//结构体初始化 public ProductsStructAddForm(HYPDM.Entities.PDM_ALL_PRODUCT t,String p_assoID,Enum_AssOpType p_assoType) { InitializeComponent(); this.Text = "结构添加--" + t.PRODUCTNO; this.copy_Product = t; m_assoID = p_assoID; m_assoType = p_assoType; tv_struct_init(); toolProComb_init(selectType.Matieral); toolVersionComb_init(); this.dgvgridInit(); }
/// <summary> /// /// </summary> /// <param name="t_productId"></param> /// <param name="p_type"></param> /// <param name="ISWFDetailView">是否是在工作流中预览</param> public ProductsConfForm(string t_productId, int p_type,Boolean ISWFDetailView) { InitializeComponent(); this.tabControl.TabPages.Remove(tab_TelTask); this.tabControl.TabPages.Remove(tab_Change); this.m_type = p_type; this.opStatus = false; service_Init(); this.m_product = m_AllProductService.GetById(t_productId); allinit(); if (ISWFDetailView) { this.toolBase.Enabled = false; this.toolProRecord.Enabled = false; this.toolChange.Enabled = false; this.toolStrip4.Enabled = false; this.toolDraw.Enabled = false; this.toolStrip6.Enabled = false; this.toolStruct.Enabled = false; } }
/// <summary> /// 基本信息--修改按钮操作 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void toolBaseEdit_Click(object sender, EventArgs e) { // if (this.m_product == null) { MessageBox.Show("该产品不存在,无法修改!"); return; } //判断是否需要修改 if (MessageBox.Show("您确认要修改此产品基本信息?", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No) { return; } //1.更新数据库产品基本信息记录 PDM_ALL_PRODUCT t_product = new PDM_ALL_PRODUCT(); t_product.PRODUCTID = this.m_product.PRODUCTID; t_product.PRODUCTNO = this.tb_productNo.Text; t_product.MODELTYPE = this.tb_modelType.Text; t_product.PRODUCTTYPE = this.tb_productType.Text; t_product.MEMO_ZH = this.tb_memoZh.Text; t_product.MEMO_EN = this.tb_memoEn.Text; t_product.MEMO = this.rtbMemo.Text; t_product.MODIFYTIME = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"); t_product.MODIFIER = this.LoginInfo.LoginID; m_AllProductService.UpdateByID(t_product); //2.基本信息改变后更新基本信息显示 this.tb_modifyTime.Text = t_product.MODIFYTIME; this.tb_modifier.Text = t_product.MODIFIER; //3.更新(派生历史记录,ERC,文档,图纸,技术任务单,产品结构,版本)等tab页面列表显示,更新基本属性信息 this.m_product = m_AllProductService.GetById(t_product.PRODUCTID); allinit(); }
/// <summary> /// 基本信息--新建按钮操作 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void toolBaseReg_Click(object sender, EventArgs e) { //1.判断产品编号是否为空 if (string.IsNullOrEmpty(this.tb_productNo.Text.Trim())) { MessageBox.Show("产品编号不能为空"); return; } DataTable dt = m_AllProductService.GetListByNoDetail(this.tb_productNo.Text.Trim()); //1.判断产品是否存在,如果存在是否生产新版本 if (dt.Rows.Count>0) { if (MessageBox.Show("该产品已存在,是否生产新版本?\n如果不是请更改产品编号!", "确认", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2) == DialogResult.No) { return; } } //3.保存新的产品记录 HYPDM.Entities.PDM_ALL_PRODUCT temp_product = new HYPDM.Entities.PDM_ALL_PRODUCT(); temp_product.PRODUCTID = Guid.NewGuid().ToString(); temp_product.PRODUCTNO = this.tb_productNo.Text; temp_product.MODELTYPE = this.tb_modelType.Text; temp_product.PRODUCTTYPE = this.tb_productType.Text; temp_product.PRODUCTLEVEL = this.m_type; temp_product.VERSION = "V" + DateTime.Now.ToString("yyyyMMddHHmmss"); temp_product.STATUS = "已创建"; temp_product.CREATER = LoginInfo.LoginID; //temp_product.MODIFIER = ""; temp_product.CREATETIME = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"); //temp_product.MODIFYTIME ; temp_product.MEMO_ZH = this.tb_memoZh.Text; temp_product.MEMO_EN = this.tb_memoEn.Text; temp_product.MEMO = this.rtbMemo.Text; temp_product.DEL_FLAG ="N"; temp_product.Save(); MessageBox.Show("保存成功"); //4. 判断显示状态 if (this.opStatus) { //a.显示(派生历史记录,ERC,文档,图纸,技术任务单,产品结构,版本)等tab页面 this.tabControl.TabPages.Add(tab_ProRecord); // this.tabControl.TabPages.Add(tab_Change); this.tabControl.TabPages.Add(tab_Doc); this.tabControl.TabPages.Add(tab_Drawing); this.tabControl.TabPages.Add(tab_productStruct); //this.tabControl.TabPages.Add(tab_TelTask); this.tabControl.TabPages.Add(tab_Version); this.tabControl.TabPages.Add(tab_ExtPro); //b.改变显示属性(产品清空状态 ,产品配置状态) this.opStatus = false; } //5.更新(派生历史记录,ERC,文档,图纸,技术任务单,产品结构,版本)等tab页面列表显示,更新基本属性信息 this.m_product = temp_product; allinit(); }