public override void tool1_Delete_Click(object sender, EventArgs e) { try { if (this.myDataGridViewHead.CurrentRow == null) { return; } int iOrderID = Convert.ToInt32(this.myDataGridViewHead.CurrentRow.Cells["报关产品表id"].Value); if (SysMessage.OKCancelMsg(string.Format("真的要删除 报关产品表id {0} 吗?", this.myDataGridViewHead.CurrentRow.Cells["报关产品表id"].Value)) == System.Windows.Forms.DialogResult.Cancel) { return; } IDataAccess data = DataAccessFactory.CreateDataAccess(DataAccessEnum.DataAccessName.DataAccessName_Manufacture); data.Open(); string strSQL = string.Format(@"delete from 报关产品表 where 报关产品表.报关产品表id={0} delete from 报关产品组成明细表 where 报关产品组成明细表.报关产品表id={0}", this.myDataGridViewHead.CurrentRow.Cells["报关产品表id"].Value); data.ExecuteNonQuery(strSQL, null); data.Close(); string strSuccess = string.Format("{0}[{1}]成功!", tool1_Delete.Text, this.myDataGridViewHead.CurrentRow.Cells["报关产品表id"].Value); this.myDataGridViewHead.Rows.Remove(this.myDataGridViewHead.CurrentRow); setTool1Enabled(); SysMessage.InformationMsg(strSuccess); } catch (Exception ex) { string strError = string.Format("{0} 出现错误:错误信息:{1}", tool1_Delete.Text, ex.Message); SysMessage.ErrorMsg(strError); } }
public ActionResult Edit(string id, SysMessage entity) { if (entity != null && ModelState.IsValid) { //数据校验 string currentPerson = GetCurrentPerson(); //entity.UpdateTime = DateTime.Now; //entity.UpdatePerson = currentPerson; string returnValue = string.Empty; if (m_BLL.Edit(ref validationErrors, entity)) { LogClassModels.WriteServiceLog(Suggestion.UpdateSucceed + ",短信发送记录信息的Id为" + id, "短信发送记录" ); //写入日志 return(Json(Suggestion.UpdateSucceed)); //提示更新成功 } else { if (validationErrors != null && validationErrors.Count > 0) { validationErrors.All(a => { returnValue += a.ErrorMessage; return(true); }); } LogClassModels.WriteServiceLog(Suggestion.UpdateFail + ",短信发送记录信息的Id为" + id + "," + returnValue, "短信发送记录" ); //写入日志 return(Json(Suggestion.UpdateFail + returnValue)); //提示更新失败 } } return(Json(Suggestion.UpdateFail + "请核对输入的数据的格式")); //提示输入的数据的格式不对 }
/// <summary> /// 加载表头数据 /// </summary> private void LoadDataSourceHead() { try { IDataAccess dataAccess = DataAccessFactory.CreateDataAccess(DataAccessEnum.DataAccessName.DataAccessName_Manufacture); dataAccess.Open(); string strSQL = string.Format("select * FROM 归并后料件清单 where 电子帐册号={0} ORDER BY 序号", StringTools.SqlQ(gstrManualNo)); DataTable dtHead = dataAccess.GetTable(strSQL, null); dataAccess.Close(); bTriggerGridViewHead_SelectionChanged = false; DataTableTools.AddEmptyRow(dtHead); this.myDataGridViewHead.DataSource = dtHead; bTriggerGridViewHead_SelectionChanged = true; //if (this.dataGridViewHead.RowCount > 0) //{ // this.dataGridViewHead.CurrentCell = this.dataGridViewHead.Rows[0].Cells["电子帐册号"]; // this.dataGridViewHead.Rows[0].Selected = true; //} this.myDataGridViewHead_SelectionChanged(null, null); } catch (Exception ex) { SysMessage.ErrorMsg(string.Format("加载数据出错LoadDataSourceHead,错误信息如下:{0}{1}", Environment.NewLine, ex.Message)); } }
//BOM结构 private void tool1_BOM_Click(object sender, EventArgs e) { if (rowHead.RowState == DataRowState.Added) { SysMessage.InformationMsg("新增配件资料未保存,不允许执行该操作!"); return; } #region 判断是否已经有打开的BOM窗体 foreach (Form childFrm in this.MdiParent.MdiChildren) { if (childFrm.Name == "FormFitBOM") { FormFitBOM orderBomForm = (FormFitBOM)childFrm; if (orderBomForm.mnFId == Convert.ToInt32(rowHead["配件id"])) { childFrm.Activate(); return; } } } #endregion FormFitBOM formBOM = new FormFitBOM(); formBOM.mbShow = false; formBOM.mnFId = Convert.ToInt32(rowHead["配件id"]); formBOM.mstrName = rowHead["配件型号"].ToString(); formBOM.mstrGroup = rowHead["配件组别"].ToString(); formBOM.MdiParent = this.MdiParent; formBOM.Show(); }
public override void tool1_Delete_Click(object sender, EventArgs e) { //base.tool1_Delete_Click(sender, e); try { if (this.myDataGridViewHead.CurrentRow == null) { return; } if (SysMessage.YesNoMsg(string.Format("真的要删除料件型号【{0}】,料件名称【{1}】吗?", this.myDataGridViewHead.CurrentRow.Cells["料件型号"].Value, this.myDataGridViewHead.CurrentRow.Cells["料件名称"].Value)) == System.Windows.Forms.DialogResult.No) { return; } string strSQL = string.Format("delete 料件资料表 where 料件id={0}", this.myDataGridViewHead.CurrentRow.Cells["料件id"].Value); IDataAccess dataAccess = DataAccessFactory.CreateDataAccess(DataAccessEnum.DataAccessName.DataAccessName_Manufacture); dataAccess.Open(); dataAccess.ExecuteNonQuery(strSQL, null); dataAccess.Close(); string strSuccess = string.Format("{0} 料件型号【{1}】,料件名称【{2}】成功!", tool1_Delete.Text, this.myDataGridViewHead.CurrentRow.Cells["料件型号"].Value, this.myDataGridViewHead.CurrentRow.Cells["料件名称"].Value); this.myDataGridViewHead.Rows.Remove(this.myDataGridViewHead.CurrentRow); setTool1Enabled(); SysMessage.InformationMsg(strSuccess); } catch (Exception ex) { string strError = string.Format("{0} 出现错误:错误信息:{1}", tool1_Delete.Text, ex.Message); SysMessage.ErrorMsg(strError); } }
private void btnDelete_Click(object sender, EventArgs e) { if (this.treeView1.SelectedNode == null || this.treeView1.SelectedNode.Name == "0") { SysMessage.InformationMsg("请选择产品类别!"); return; } if (this.treeView1.SelectedNode.Nodes.Count > 0) { SysMessage.InformationMsg("此产品包含子类产品,不能删除,可先删除子类产品再删除!"); return; } if (SysMessage.OKCancelMsg(string.Format("确定要删除产品类别【{0}】吗?", this.treeView1.SelectedNode.Text)) == System.Windows.Forms.DialogResult.Cancel) { return; } string strSQL = string.Format("DELETE [产品类别表] WHERE 产品类别={0} DELETE [产品类别表] WHERE 产品类别ID={0}", this.treeView1.SelectedNode.Name); IDataAccess dataAccess = DataAccessFactory.CreateDataAccess(DataAccessEnum.DataAccessName.DataAccessName_Manufacture); dataAccess.Open(); dataAccess.ExecuteNonQuery(strSQL, null); dataAccess.Close(); bModify = true; LoadDataSource(); }
/// <summary> /// 添加系统消息 /// </summary> /// <param name="userByType">消息类型</param> /// <param name="userBy">推送给选中用户</param> /// <param name="messageDesc">消息内容</param> /// <returns></returns> public int CreateSystemMessage(short userByType, string userBy, string messageDesc) { CheckUserId(); CheckUserByType(userByType); if (userByType != 3) { CheckUserBy(userBy); } CheckMessageDesc(messageDesc); Manage manage; CheckUserId(out manage); var systemMessage = new SysMessage() { CreateTime = DateTime.Now, CreateManageId = manage.Id, Content = messageDesc, SendType = userByType, EntityType = (short)SysMessageEnum.SystemMessage, EntityId = 0, ToUserIds = userBy }; this._sysMessageRepository.CreateEntity(systemMessage); return(systemMessage.Id); }
/// <summary> /// 检查数据是否有修改,并返回对应的操作选项 /// Yes:保存资料,并继续;;No:不保存资料,并继续;Cancel:取消操作,返回界面 /// </summary> /// <returns>Yes:保存资料,并继续;;No:不保存资料,并继续;Cancel:取消操作,返回界面</returns> public DialogResult CheckModify() { bool bModify = false; if (rowHead.RowState == DataRowState.Modified) { bModify = true; } else if (rowHead.RowState == DataRowState.Added) { //if (rowHead["手册编号"].ToString().Length > 0) //{ bModify = true; //} } if (bModify) { StringBuilder strBuilder = new StringBuilder(); strBuilder.AppendLine("当前资料未保存,请选择是否保存!"); strBuilder.AppendLine("是:保存资料,并继续"); strBuilder.AppendLine("否:不保存资料,并继续"); strBuilder.AppendLine("取消:取消操作,返回界面"); return(SysMessage.YesNoCancelMsg(strBuilder.ToString())); } return(DialogResult.No); }
private void btnExportExcel_Click(object sender, EventArgs e) { try { this.btnExportExcel.Enabled = false; if (this.myDataGridView1.DataSource == null) { SysMessage.InformationMsg("没有数据可导出!"); return; } DataTable dtData = (DataTable)this.myDataGridView1.DataSource; if (dtData.Rows.Count == 0) { SysMessage.InformationMsg("没有数据可导出!"); return; } ExcelCommonMethod.ExportIntoExcel(dtData, this.Text); } catch (Exception ex) { SysMessage.ErrorMsg(ex.Message); } finally { this.btnExportExcel.Enabled = true; } }
private void btnQuery_Click(object sender, EventArgs e) { try { this.btnQuery.Enabled = false; DateTime d1 = new DateTime(this.myDateTimePicker1.Value.Year, this.myDateTimePicker1.Value.Month, 1); DateTime dT = this.myDateTimePicker1.Value.AddMonths(1); DateTime d2 = new DateTime(dT.Year, dT.Month, 1); int days = ((TimeSpan)(d2 - d1)).Days; DateTime beginDT = new DateTime(this.myDateTimePicker1.Value.Year, this.myDateTimePicker1.Value.Month, 1, 00, 00, 00); DateTime endDT = new DateTime(this.myDateTimePicker1.Value.Year, this.myDateTimePicker1.Value.Month, days, 23, 59, 59); IDataAccess dataAccess = DataAccessFactory.CreateDataAccess(DataAccessEnum.DataAccessName.DataAccessName_Manufacture); dataAccess.Open(); DataTable dtData = dataAccess.GetTable(string.Format("exec 报关制造通知单料件月份统计 '{0}','{1}','{2}'", beginDT, endDT, ConfigurationManager.AppSettings["defaultManualCode"].ToString())); dataAccess.Close(); this.myDataGridView1.DataSource = dtData; } catch (Exception ex) { SysMessage.ErrorMsg(ex.Message); } finally { this.btnQuery.Enabled = true; } }
private void btnDelete_Click(object sender, EventArgs e) { DataGridViewRow dgv = null; int year = 0; int month = 0; if (this.myDataGridView1.CurrentRowNew != null) { if (this.myDataGridView1.Rows[this.myDataGridView1.CurrentRowNew.Index].Cells["年"].Value != DBNull.Value) { year = (int)this.myDataGridView1.Rows[this.myDataGridView1.CurrentRowNew.Index].Cells["年"].Value; month = (int)this.myDataGridView1.Rows[this.myDataGridView1.CurrentRowNew.Index].Cells["月"].Value; if (SysMessage.OKCancelMsg(string.Format("确定要删除【{0}年{1}月】的汇率吗?", year, month)) == DialogResult.OK) { IDataAccess dataAccess = DataAccessFactory.CreateDataAccess(DataAccessEnum.DataAccessName.DataAccessName_Uniquegrade); dataAccess.Open(); dataAccess.ExecuteNonQuery(string.Format("delete exchangerate where iyear={0} and imonth={1}", year, month)); dataAccess.Close(); LoadDataSource(); } } else { return; } } else { return; } }
public override void tool1_Delete_Click(object sender, EventArgs e) { base.tool1_Delete_Click(sender, e); if (this.myDataGridViewHead.CurrentRow == null) { return; } string strText = string.Format("真的要删除订单 【{0}】 吗?", this.myDataGridViewHead.CurrentRow.Cells["订单号码"].Value); if (SysMessage.OKCancelMsg(strText) == System.Windows.Forms.DialogResult.Cancel) { return; } try { StringBuilder strBuilder = new StringBuilder(); strBuilder.AppendLine(string.Format("delete from 装箱单明细表 where 订单id={0}", this.myDataGridViewHead.CurrentRow.Cells["订单id"].Value)); strBuilder.AppendLine(string.Format("delete from 装箱单表 where 订单id={0}", this.myDataGridViewHead.CurrentRow.Cells["订单id"].Value)); IDataAccess dataAccess = DataAccessFactory.CreateDataAccess(DataAccessEnum.DataAccessName.DataAccessName_Uniquegrade); dataAccess.Open(); dataAccess.ExecuteNonQuery(strBuilder.ToString(), null); dataAccess.Close(); string strSuccess = string.Format("{0}[{1}]成功!", tool1_Delete.Text, this.myDataGridViewHead.CurrentRow.Cells["订单号码"].Value); this.myDataGridViewHead.Rows.Remove(this.myDataGridViewHead.CurrentRow); setTool1Enabled(); SysMessage.InformationMsg(strSuccess); } catch (Exception ex) { string strError = string.Format("{0} 出现错误:错误信息:{1}", tool1_Delete.Text, ex.Message); SysMessage.ErrorMsg(strError); } }
public override void tool1_Delete_Click(object sender, EventArgs e) { base.tool1_Delete_Click(sender, e); if (this.myDataGridViewHead.CurrentRow == null) { return; } string strText = string.Format("真的要删除出库单号 【{0}】 吗?", this.myDataGridViewHead.CurrentRow.Cells["出库单号"].Value); if (SysMessage.OKCancelMsg(strText) == System.Windows.Forms.DialogResult.Cancel) { return; } try { IDataAccess dataAccess = DataAccessFactory.CreateDataAccess(DataAccessEnum.DataAccessName.DataAccessName_Manufacture); dataAccess.Open(); string strSQL = string.Format("删除指定的进口料件出库资料 {0}", this.myDataGridViewHead.CurrentRow.Cells["料件出库表id"].Value); dataAccess.ExecuteNonQuery(strSQL, null); dataAccess.Close(); string strSuccess = string.Format("{0}[{1}]成功!", tool1_Delete.Text, this.myDataGridViewHead.CurrentRow.Cells["出库单号"].Value); this.myDataGridViewHead.Rows.Remove(this.myDataGridViewHead.CurrentRow); setTool1Enabled(); SysMessage.InformationMsg(strSuccess); } catch (Exception ex) { string strError = string.Format("{0} 出现错误:错误信息:{1}", tool1_Delete.Text, ex.Message); SysMessage.ErrorMsg(strError); } }
/// <summary> /// 加载订单内容数据 /// </summary> private void LoadDataSourceDetails() { try { int iOrderID = 0; string strBooksNo = string.Empty; if (this.myDataGridViewHead.CurrentRowNew != null) { if (this.myDataGridViewHead.Rows[this.myDataGridViewHead.CurrentRowNew.Index].Cells["Pid"].Value != DBNull.Value) { iOrderID = (int)this.myDataGridViewHead.Rows[this.myDataGridViewHead.CurrentRowNew.Index].Cells["Pid"].Value; } } IDataAccess dataAccess = DataAccessFactory.CreateDataAccess(DataAccessEnum.DataAccessName.DataAccessName_Uniquegrade); dataAccess.Open(); string strSQL = string.Format("exec 出口装箱单录入查询 {0}", iOrderID); DataTable dtDetails = dataAccess.GetTable(strSQL, null); dataAccess.Close(); DataTableTools.AddEmptyRow(dtDetails); this.myDataGridViewDetails.DataSource = dtDetails; } catch (Exception ex) { SysMessage.ErrorMsg(string.Format("加载【PACKING LIST】出错,错误信息如下:{0}{1}", Environment.NewLine, ex.Message)); } }
/// <summary> /// 加载订单内容数据 /// </summary> private void LoadDataSourceDetails() { try { int iOrderID = 0; string strBooksNo = string.Empty; if (this.myDataGridViewHead.CurrentRowNew != null) { if (this.myDataGridViewHead.Rows[this.myDataGridViewHead.CurrentRowNew.Index].Cells["料件出库表id"].Value != DBNull.Value) { iOrderID = (int)this.myDataGridViewHead.Rows[this.myDataGridViewHead.CurrentRowNew.Index].Cells["料件出库表id"].Value; strBooksNo = this.myDataGridViewHead.CurrentRowNew.Cells["电子帐册号"].Value.ToString(); } } IDataAccess dataAccess = DataAccessFactory.CreateDataAccess(DataAccessEnum.DataAccessName.DataAccessName_Manufacture); dataAccess.Open(); //string strSQL = string.Format("select * from 报关预先订单明细表 where 订单id={0}", iOrderID); string strSQL = string.Format("exec 进口料件出库修改查询 {0},{1}", iOrderID, StringTools.SqlQ(strBooksNo)); DataTable dtDetails = dataAccess.GetTable(strSQL, null); dataAccess.Close(); DataTableTools.AddEmptyRow(dtDetails); this.myDataGridViewDetails.DataSource = dtDetails; } catch (Exception ex) { SysMessage.ErrorMsg(string.Format("加载【出库单明细】出错,错误信息如下:{0}{1}", Environment.NewLine, ex.Message)); } }
/// <summary> /// 获取系统管理模块友好提示信息 /// </summary> /// <param name="code"></param> /// <returns></returns> public static string ToMessage(this SysMessage code) { string message = ""; switch (code) { case SysMessage.AddSuccess: message = "添加成功!"; break; case SysMessage.AddError: message = "添加失败!"; break; case SysMessage.DeleteSuccess: message = "删除成功!"; break; case SysMessage.DeleteError: message = "删除失败!"; break; case SysMessage.LoadSuccess: message = "加载成功!"; break; case SysMessage.LoadError: message = "加载失败!"; break; case SysMessage.OperateSuccess: message = "操作成功!"; break; case SysMessage.OperateError: message = "操作失败!"; break; case SysMessage.UpdateSuccess: message = "更新成功!"; break; case SysMessage.UpdateError: message = "更新失败!"; break; case SysMessage.UnkownError: message = "未知错误!"; break; case SysMessage.ParamError: message = "参数错误!"; break; default: message = "错误"; break; } return(message); }
public override void tool1_Delete_Click(object sender, EventArgs e) { try { if (this.myDataGridViewHead.CurrentRow == null) { return; } int iOrderID = Convert.ToInt32(this.myDataGridViewHead.CurrentRow.Cells["手册id"].Value); if (SysMessage.OKCancelMsg(string.Format("真的要删除手册编号【{0}】吗?", this.myDataGridViewHead.CurrentRow.Cells["手册编号"].Value)) == System.Windows.Forms.DialogResult.Cancel) { return; } IDataAccess data = DataAccessFactory.CreateDataAccess(DataAccessEnum.DataAccessName.DataAccessName_Manufacture); data.Open(); DataTable dtList = data.GetTable(string.Format("删除指定的手册资料", iOrderID), null); data.Close(); string strSuccess = string.Format("{0}[{1}]成功!", tool1_Delete.Text, this.myDataGridViewHead.CurrentRow.Cells["手册编号"].Value); this.myDataGridViewHead.Rows.Remove(this.myDataGridViewHead.CurrentRow); setTool1Enabled(); SysMessage.InformationMsg(strSuccess); } catch (Exception ex) { string strError = string.Format("{0} 出现错误:错误信息:{1}", tool1_Delete.Text, ex.Message); SysMessage.ErrorMsg(strError); } }
public void Insert(string MsgCode,string VnMsgContent,string EnMsgContent,string VnMsgTitle,string EnMsgTitle,string MsgType,string ActionType,short SubsystemId,string SDesc) { SysMessage item = new SysMessage(); item.MsgCode = MsgCode; item.VnMsgContent = VnMsgContent; item.EnMsgContent = EnMsgContent; item.VnMsgTitle = VnMsgTitle; item.EnMsgTitle = EnMsgTitle; item.MsgType = MsgType; item.ActionType = ActionType; item.SubsystemId = SubsystemId; item.SDesc = SDesc; item.Save(UserName); }
public ActionResult Create(SysMessage entity) { if (entity != null && ModelState.IsValid) { string currentPerson = GetCurrentPerson(); entity.CreateTime = DateTime.Now; entity.Id = Result.GetNewId(); entity.CreatePerson = currentPerson; entity.Id = Result.GetNewId(); string returnValue = string.Empty; if (m_BLL.Create(ref validationErrors, entity)) { LogClassModels.WriteServiceLog(Suggestion.InsertSucceed + ",短信发送记录的信息的Id为" + entity.Id, "短信发送记录" );//写入日志 return(Json(Suggestion.InsertSucceed)); } else { if (validationErrors != null && validationErrors.Count > 0) { validationErrors.All(a => { returnValue += a.ErrorMessage; return(true); }); } LogClassModels.WriteServiceLog(Suggestion.InsertFail + ",短信发送记录的信息," + returnValue, "短信发送记录" ); //写入日志 return(Json(Suggestion.InsertFail + returnValue)); //提示插入失败 } } return(Json(Suggestion.InsertFail + ",请核对输入的数据的格式")); //提示输入的数据的格式不对 }
/// <summary> /// 加载订单内容数据 /// </summary> private void LoadDataSourceDetails() { try { int iManualID = 0; string strBooksNo = string.Empty; if (this.myDataGridViewHead.CurrentRowNew != null) { iManualID = (int)this.myDataGridViewHead.Rows[this.myDataGridViewHead.CurrentRowNew.Index].Cells["手册id"].Value; } IDataAccess dataAccess = DataAccessFactory.CreateDataAccess(DataAccessEnum.DataAccessName.DataAccessName_Uniquegrade); dataAccess.Open(); string strSQL = string.Format("exec 出口成品表录入查询 {0}" + Environment.NewLine, iManualID); strSQL += string.Format("exec 进口料件表录入查询 {0}", iManualID); DataSet ds = dataAccess.GetDataSet(strSQL, null); dataAccess.Close(); DataTable dtDetails = ds.Tables[0]; DataTable dtDetails2 = ds.Tables[1]; DataTableTools.AddEmptyRow(dtDetails); DataTableTools.AddEmptyRow(dtDetails2); this.myDataGridViewDetails.DataSource = dtDetails; this.myDataGridViewDetailsInput.DataSource = dtDetails2; } catch (Exception ex) { SysMessage.ErrorMsg(string.Format("加载【InvoiceOut】出错,错误信息如下:{0}{1}", Environment.NewLine, ex.Message)); } }
//文本控件值变化时验证 private void txt_Validating(object sender, CancelEventArgs e) { myTextBox txtBox = (myTextBox)sender; if (txtBox.Text.Trim().Length == 0) { return; } string fieldName = txtBox.Name.Replace("txt_", ""); string strSQL = string.Empty; IDataAccess dataAccess = null; switch (fieldName) { case "料件型号": #region 料件型号 if (rowHead.RowState == DataRowState.Added || (rowHead.RowState == DataRowState.Modified && rowHead["料件型号", DataRowVersion.Original].ToString() != txtBox.Text)) { strSQL = string.Format("SELECT 料件id FROM 料件资料表 WHERE 料件型号 = {0}", StringTools.SqlQ(txtBox.Text)); dataAccess = DataAccessFactory.CreateDataAccess(DataAccessEnum.DataAccessName.DataAccessName_Manufacture); dataAccess.Open(); DataTable dtManual = dataAccess.GetTable(strSQL.ToString(), null); dataAccess.Close(); if (dtManual.Rows.Count > 0) { SysMessage.InformationMsg("此料件型号已存在,请重新输入!"); e.Cancel = true; txtBox.Focus(); } } break; #endregion } }
private async void SaveAndQuit() { GameObject.Find("Canvas").transform.Find("SavingBgPanel").gameObject.SetActive(true); Pacient.Loaded.CalibrationManoDone = Pacient.Loaded.IsCalibrationManoDone; var pacientSendDto = Pacient.MapToPacientSendDto(); var responsePacient = await DataManager.Instance.UpdatePacient(pacientSendDto); var responseCalibration = await DataManager.Instance.SaveCalibrationOverview(_calibrationOverviewSendDto); GameObject.Find("Canvas").transform.Find("SavingBgPanel").gameObject.SetActive(false); if (responsePacient.ApiResponse == null) { SysMessage.Info("Erro ao atualizar os dados do paciente na nuvem!\n Os dados poderão ser enviados posteriormente.."); } if (responseCalibration.ApiResponse == null) { SysMessage.Info("Erro salvar os dados de calibração na nuvem!\n Os dados poderão ser enviados posteriormente.."); } FindObjectOfType <ManoLogger>().StopLogging(); ReturnToMainMenu(); }
//复制 private void btnClone_Click(object sender, EventArgs e) { FormBaseDialogInput objForm = new FormBaseDialogInput(); objForm.strDefault = txt_料件型号.Text; objForm.strFormText = "料件资料克隆(请输入源料件型号:)"; if (objForm.ShowDialog() == System.Windows.Forms.DialogResult.OK) { if (objForm.strReturn.Trim().Length > 0) { IDataAccess dataAccess = DataAccessFactory.CreateDataAccess(DataAccessEnum.DataAccessName.DataAccessName_Manufacture); dataAccess.Open(); string strSQL = string.Format("SELECT * FROM 料件资料表 WHERE 料件型号 = {0}", StringTools.SqlQ(objForm.strReturn)); DataTable dtTemp = dataAccess.GetTable(strSQL.ToString(), null); dataAccess.Close(); if (dtTemp.Rows.Count == 0) { SysMessage.InformationMsg("指定的料件不存存!"); } else { // "料件id", "料件型号", "料件建档日期" 不做处理 foreach (DataColumn col in dtTemp.Columns) { if (col.ColumnName != "料件id" && col.ColumnName != "料件型号" && col.ColumnName != "料件建档日期") { rowHead[col.ColumnName] = dtTemp.Rows[0][col.ColumnName]; } } fillControl(rowHead); } } } }
//编号生成 private void btnCreateNo_Click(object sender, EventArgs e) { if (txt_显示型号.Text.Trim().Length == 0) { SysMessage.InformationMsg(string.Format("【{0}】不能为空!", lab_显示型号.Text)); txt_显示型号.Focus(); return; } string strSQL = string.Format(@"declare @No varchar(10) set @No={0} exec [料件台北编号生成] @No out select @No as no", StringTools.SqlQ(txt_显示型号.Text.Trim())); IDataAccess dataAccess = DataAccessFactory.CreateDataAccess(DataAccessEnum.DataAccessName.DataAccessName_Manufacture); dataAccess.Open(); DataTable dtManual = dataAccess.GetTable(strSQL.ToString(), null); dataAccess.Close(); if (txt_料件名.Text.Trim().Length == 0) { txt_料件名.Text = txt_显示型号.Text; rowHead["料件名"] = txt_料件名.Text; } txt_显示型号.Text = dtManual.Rows[0][0].ToString(); rowHead["显示型号"] = dtManual.Rows[0][0].ToString(); }
private void btnOK_Click(object sender, EventArgs e) { if (dataGridView1.CurrentRow == null) { SysMessage.InformationMsg("选未选择数据,请先选择"); } returnRow = (dataGridView1.CurrentRow.DataBoundItem as DataRowView).Row; this.DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); }
private void btnExportMaterialSheet_Click(object sender, EventArgs e) { if (SysMessage.YesNoMsg("数据是否导入EXCEL文件?") == System.Windows.Forms.DialogResult.No) { return; } if (this.myDataGridView1.CurrentRow == null) { return; } string strSourceFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, @"Excel\归并关系表.xls"); string strDestFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, string.Format(@"ExcelTemp\归并关系表{0}.xls", DateTime.Now.ToString("yyyyMMddHHmmss"))); File.Copy(strSourceFile, strDestFile); File.SetAttributes(strDestFile, File.GetAttributes(strDestFile) | FileAttributes.ReadOnly); string fn = strDestFile; ExcelTools ea = new ExcelTools(); ea.SafeOpen(fn); ea.ActiveSheet(1); // 激活 int n = 6; //起始索引行 ea.SetValue("N2", DateTime.Now.ToString("yyyy-MM-dd")); //注释的列是不存在的 //ea.SetValue("J6",this.myDataGridView1.CurrentRow.Cells["序号"].Value==DBNull.Value ? "" : this.myDataGridView1.CurrentRow.Cells["序号"].Value.ToString()); //ea.SetValue("K6",this.myDataGridView1.CurrentRow.Cells["产品编号"].Value==DBNull.Value ? "" : this.myDataGridView1.CurrentRow.Cells["产品编号"].Value.ToString()); ea.SetValue("L6", this.myDataGridView1.CurrentRow.Cells["商品编码"].Value == DBNull.Value ? "" : this.myDataGridView1.CurrentRow.Cells["商品编码"].Value.ToString()); ea.SetValue("M6", this.myDataGridView1.CurrentRow.Cells["商品名称"].Value == DBNull.Value ? "" : this.myDataGridView1.CurrentRow.Cells["商品名称"].Value.ToString()); ea.SetValue("N6", this.myDataGridView1.CurrentRow.Cells["商品规格"].Value == DBNull.Value ? "" : this.myDataGridView1.CurrentRow.Cells["商品规格"].Value.ToString()); // ea.SetValue("O6",this.myDataGridView1.CurrentRow.Cells["单价"].Value==DBNull.Value ? "" : this.myDataGridView1.CurrentRow.Cells["单价"].Value.ToString()); //ea.SetValue("P6",this.myDataGridView1.CurrentRow.Cells["计量单位"].Value==DBNull.Value ? "" : this.myDataGridView1.CurrentRow.Cells["计量单位"].Value.ToString()); //ea.SetValue("Q6",this.myDataGridView1.CurrentRow.Cells["法定单位"].Value==DBNull.Value ? "" : this.myDataGridView1.CurrentRow.Cells["法定单位"].Value.ToString()); //ea.SetValue("R6",this.myDataGridView1.CurrentRow.Cells["换算因子"].Value==DBNull.Value ? "" : this.myDataGridView1.CurrentRow.Cells["换算因子"].Value.ToString()); DataTable dt2 = (DataTable)this.myDataGridView2.DataSource; foreach (DataRow row in dt2.Rows) { //ea.SetValue(string.Format("A{0}", n), row["序号"] == DBNull.Value ? "" : row["序号"].ToString()); //ea.SetValue(string.Format("B{0}",n), row["产品编号"] == DBNull.Value ? "" :row["产品编号"].ToString()); ea.SetValue(string.Format("C{0}", n), row["商品编码"] == DBNull.Value ? "" : row["商品编码"].ToString()); ea.SetValue(string.Format("D{0}", n), row["商品名称"] == DBNull.Value ? "" : row["商品名称"].ToString()); ea.SetValue(string.Format("E{0}", n), row["商品规格"] == DBNull.Value ? "" : row["商品规格"].ToString()); //ea.SetValue("F{0}", row["单价"] == DBNull.Value ? "" : row["单价"].ToString()); //ea.SetValue("G{0}", row["计量单位"] == DBNull.Value ? "" : row["计量单位"].ToString()); //ea.SetValue("H{0}", row["法定单位"] == DBNull.Value ? "" : row["法定单位"].ToString()); //ea.SetValue("I{0}", row["换算因子"] == DBNull.Value ? "" : row["换算因子"].ToString()); n++; } //ea.Save(saveFileDialog.FileName); ea.Visible = true; ea.Dispose(); }
private void btnDataImport_Click(object sender, EventArgs e) { if (this.myDataGridViewHead.CurrentRow == null) { return; } if (SysMessage.YesNoMsg("数据是否导出?") == System.Windows.Forms.DialogResult.No) { return; } DataRow mRs = (myDataGridViewHead.CurrentRow.DataBoundItem as DataRowView).Row; IDataAccess dataManufacture = DataAccessFactory.CreateDataAccess(DataAccessEnum.DataAccessName.DataAccessName_Manufacture); IDataAccess dataGWT = DataAccessFactory.CreateDataAccess(DataAccessEnum.DataAccessName.DataAccessName_GWT); dataManufacture.Open(); DataTable rs = dataManufacture.GetTable(string.Format("报关进口料件数量转换统计 @id={0},@电子帐册号='{1}',@类别=1", mRs["料件入库表id"], mRs["电子帐册号"]), null); dataManufacture.Close(); if (rs.Rows.Count > 0) { decimal PriceValue; int n = 1; dataManufacture.Open(); dataGWT.Open(); foreach (DataRow rsRow in rs.Rows) { DataTable crs = dataManufacture.GetTable(string.Format(@"SELECT H.单价 FROM 归并前料件清单 Q RIGHT OUTER JOIN 归并后料件清单 H ON Q.归并后料件id = H.归并后料件id WHERE H.电子帐册号='{0}' and Q.产品编号='{1}'", mRs["电子帐册号"], rsRow["料号"]), null); if (crs.Rows.Count > 0 && crs.Rows[0]["单价"] != DBNull.Value) { PriceValue = Convert.ToDecimal(Convert.ToDecimal(crs.Rows[0]["单价"]).ToString("N2")); } else { PriceValue = Convert.ToDecimal(Convert.ToDecimal(0).ToString("N2")); } dataGWT.ExecuteNonQuery(string.Format(@"INSERT INTO GWT_EMS_CL(Ems_No,owner_code, Cop_List_No, I_E_Mark, G_Mark,List_Declare_Date,List_G_No,Cop_G_No,Qty,Factor_1,Unit,Unit_1, Dec_Price,Use_Type,Duty_Mode,Country_Code,Curr) VALUES({0},'3502948415',{1},'I','3','{2}',{3},{4},{5},{6},'035','035', {7},{8},{9},{10},{11})", mRs["电子帐册号"] == DBNull.Value ? "NULL" :StringTools.SqlQ(mRs["电子帐册号"].ToString()), mRs["清单编号"] == DBNull.Value ? "NULL" : StringTools.SqlQ(mRs["清单编号"].ToString()), DateTime.Now.ToString("yyyy-MM-dd"), n, rsRow["料号"] == DBNull.Value ? "NULL" : StringTools.SqlQ(rsRow["料号"].ToString()), rsRow["入库数量"] == DBNull.Value ? "NULL" : rsRow["入库数量"], rsRow["入库数量"] == DBNull.Value ? "NULL" : rsRow["入库数量"], PriceValue, mRs["用途"] == DBNull.Value ? "NULL" : StringTools.SqlQ(mRs["用途"].ToString()), mRs["征免方式"] == DBNull.Value ? "NULL" : mRs["征免方式"], mRs["产销国"] == DBNull.Value ? "NULL" : StringTools.SqlQ(mRs["产销国"].ToString()), mRs["币制"] == DBNull.Value ? "NULL" : mRs["币制"]), null); n++; } dataGWT.ExecuteNonQuery("sp_get_gwt_ems_cl", null); dataManufacture.Close(); dataGWT.Close(); } }
public static int numberFailures; // Número de vezes que o paciente perdeu sequencialmente. private void OnEnable() { var scorer = FindObjectOfType <Scorer>(); if (scorer.Result == GameResult.Success) { finalResult.text = "GoGoGo!"; finalResult.color = Color.cyan; motivationText.text = "Muito bem! Você passou de nível. Continue assim!"; numberFailures = 0; // Caso ganhe uma partida, o número de falhas é zerado. Debug.Log($"numberFailures {numberFailures}"); SoundManager.Instance.PlaySound("StageClear"); } else { if (scorer.Score < scorer.MaxScore * 0.3f) { repeatStageButton.interactable = false; } nextStageButton.interactable = false; finalResult.text = "YOU BLEW IT"; finalResult.color = Color.red; motivationText.text = "Você não conseguiu pontos suficientes. Não desista!"; numberFailures += 1; // Caso perca, o número de falhas é incrementado. if (numberFailures >= ParametersDb.parameters.lostXtimes) // Se perdeu X vezes, então solicita recalibração... { SysMessage.Warning($"Você perdeu {numberFailures} vezes, pode haver algum problema com sua calibração, sugiro que recalibre os dispositivos"); } Debug.Log($"numberFailures {numberFailures}"); SoundManager.Instance.PlaySound("PlayerDamage"); } var score = scorer.Score; var maxScore = scorer.MaxScore; score = Mathf.Clamp(score, 0f, maxScore); pauseButton.interactable = false; scoreValue.text = scoreRatio.text = ""; GameObject.Find("Canvas").transform.Find("HUD").transform.localScale = Vector3.zero; resultInfo.text = $"• Score: {score:####} / {maxScore:####} ({((score / maxScore) * 100f):####}%)\n" + $"• Fase: {StageModel.Loaded.Phase}\n" + $"• Nível: {StageModel.Loaded.Level}\n" + $"• Jogador: {Pacient.Loaded.Name}"; }
/// <summary> /// 查看系统消息 /// </summary> /// <param name="id"></param> /// <returns></returns> public SysMessage GetSystemMessage(int id) { SysMessage systemMessage = new SysMessage(); if (id <= 0) { return(systemMessage); } systemMessage = this._sysMessageRepository.GetEntity(ConditionEqualId(id)); return(systemMessage); }
private void myTextBox2_TextChanged(object sender, EventArgs e) { try { int iCount = int.Parse(this.myTextBox2.Text); this.myTextBox3.Text = (Convert.ToInt64(myTextBox1.Text) + iCount - 1).ToString(); } catch (Exception ex) { SysMessage.ErrorMsg(ex.Message); } }
private void CheckSpaceCommentId(int messageId, User user, out SysMessage systemMessage) { systemMessage = (from sm in this._sysMessageRepository.GetEntityList() where sm.State == false && sm.Id == messageId && sm.EntityType == (int)SysMessageEnum.SpaceComment && SplitUserBy(sm.ToUserIds).Contains(user.Id) && sm.SendType == (int)SystemMessageEnum.ByUser //指定用户 orderby sm.CreateTime descending select sm).FirstOrDefault(); AssertUtil.IsNotNull(systemMessage, "消息不存在或者被禁用"); }
public void Insert(int MessageType,int MessageSellerID,string MessageSubject,string MessageReply,int MessageSalerID,DateTime MessageDateSubject,decimal MessageDateReply,int? CreatedBy,DateTime? CreatedOn,int? ModifiedBy,DateTime? ModifiedOn) { SysMessage item = new SysMessage(); item.MessageType = MessageType; item.MessageSellerID = MessageSellerID; item.MessageSubject = MessageSubject; item.MessageReply = MessageReply; item.MessageSalerID = MessageSalerID; item.MessageDateSubject = MessageDateSubject; item.MessageDateReply = MessageDateReply; item.CreatedBy = CreatedBy; item.CreatedOn = CreatedOn; item.ModifiedBy = ModifiedBy; item.ModifiedOn = ModifiedOn; item.Save(UserName); }
public void Update(int Id,int MessageType,int MessageSellerID,string MessageSubject,string MessageReply,int MessageSalerID,DateTime MessageDateSubject,decimal MessageDateReply,int? CreatedBy,DateTime? CreatedOn,int? ModifiedBy,DateTime? ModifiedOn) { SysMessage item = new SysMessage(); item.MarkOld(); item.IsLoaded = true; item.Id = Id; item.MessageType = MessageType; item.MessageSellerID = MessageSellerID; item.MessageSubject = MessageSubject; item.MessageReply = MessageReply; item.MessageSalerID = MessageSalerID; item.MessageDateSubject = MessageDateSubject; item.MessageDateReply = MessageDateReply; item.CreatedBy = CreatedBy; item.CreatedOn = CreatedOn; item.ModifiedBy = ModifiedBy; item.ModifiedOn = ModifiedOn; item.Save(UserName); }