/// <summary> /// store information /// </summary> /// <param name="sender"></param> /// <param name="e"></param> /// 基础表新增列视图单击确定事件 modi by chao.pang private void btnOk_Click(object sender, EventArgs e) { //判定弹出窗体“是否保存”的返回值 if (MessageService.AskQuestion(StringParser.Parse("${res:FanHai.Hemera.Addins.Msg.SaveRemind}"), StringParser.Parse("${res:Global.SystemInfo}"))) { DataSet dsColumnCheck = new DataSet(); DataSet dsReturn = new DataSet(); //check data 检查填入数据是否为空 modi by chao.pang if (!CheckNewColumnInfo()) { return; } #region detail deal try { //set value to entity MapValueToEntity(); //判定变量deal的值为add则是添加,为edit则是编辑 modi by chao.pang if (deal == "add") { //save data 调用保存数据SaveBaseAttribute方法 modi by chao.pang baseAttributeEntity.SaveBaseAttribute(); //check result 错误信息为空执行 modi by chao.pang if (baseAttributeEntity.ErrorMsg == "") { //set outdataset value 将值添加到数据表中显示 modi by chao.pang outDataSet.Tables[0].Rows.Add(); outDataSet.Tables[0].Rows[0]["ATTRIBUTE_KEY"] = baseAttributeEntity.AttributeKey; outDataSet.Tables[0].Rows[0]["ATTRIBUTE_NAME"] = baseAttributeEntity.AttributeName; outDataSet.Tables[0].Rows[0]["DATA_TYPE"] = baseAttributeEntity.DataType; outDataSet.Tables[0].Rows[0]["DESCRIPTION"] = baseAttributeEntity.Descriptions; //提示添加成功 modi by chao.pang MessageService.ShowMessage("${res:FanHai.Hemera.Addins.BasicData.ColumnAddOrEdit.MsgEditDataSuccessfully}"); this.Close(); } //错误信息返回值不为空,提示错误信息 modi by chao.pang else { MessageService.ShowError(baseAttributeEntity.ErrorMsg); } } else { //set entity's attribute_key baseAttributeEntity.AttributeKey = attributeId; //save data 调用修改数据UpdateBaseAttribute的方法 modi by chao.pang baseAttributeEntity.UpdateBaseAttribute(); //check result 返回错误信息为空 modi by chao.pang if (baseAttributeEntity.ErrorMsg == "") { //set outdataset value to return outDataSet.Tables[0].Rows.Add(); outDataSet.Tables[0].Rows[0]["ATTRIBUTE_KEY"] = baseAttributeEntity.AttributeKey; outDataSet.Tables[0].Rows[0]["ATTRIBUTE_NAME"] = baseAttributeEntity.AttributeName; outDataSet.Tables[0].Rows[0]["DATA_TYPE"] = baseAttributeEntity.DataType; outDataSet.Tables[0].Rows[0]["DESCRIPTION"] = baseAttributeEntity.Descriptions; MessageService.ShowMessage("${res:FanHai.Hemera.Addins.BasicData.ColumnAddOrEdit.MsgEditDataSuccessfully}"); this.Close(); } else { MessageService.ShowError(baseAttributeEntity.ErrorMsg); } } } catch (Exception ee) { MessageService.ShowError(ee.Message); } } #endregion }