protected virtual void Import() { if (!this.ValidateImport()) { return; } DataTable excelTable = this.grdData.DataSource as DataTable; int rowCount = excelTable.Rows.Count; m_TimePk = DateTime.Now.ToString("yyyyMMddHHmmss"); XImportResultInfo resultInfo = this.ImportOperate(excelTable); resultInfo.Count = rowCount; if (resultInfo.FailureCount > 0) { int failueCount = resultInfo.FailureCount; int successCount = resultInfo.SuccessCount; int notExecCount = resultInfo.Count - successCount - failueCount; XMessageBox.ShowRemindMessage("成功导入" + successCount + "条,失败" + failueCount + "条,未执行" + notExecCount + "条!"); frmOperateResult frm = new frmOperateResult(resultInfo.Results); frm.ShowDialog(); } else { XMessageBox.ShowRemindMessage("成功导入" + rowCount + "条!"); } }
/// <summary> /// 修改 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnModify_Click(object sender, EventArgs e) { string selectrid = GetSelectRow(); if (!(IsCheck(selectrid))) { XMessageBox.ShowRemindMessage("请选择记录信息!"); return; } DataTable dt = new DataTable(); string sql = "select * from V_EquipmentReceive where rid in(" + selectrid + ")"; dt = SQLHelper.GetDataSet(sql); if (dt == null) { XMessageBox.ShowRemindMessage("数据提取异常!"); return; } if (dt.Rows.Count <= 0) { XMessageBox.ShowRemindMessage("数据提取异常!"); return; } string cust = ""; string invoiceno = ""; if (dt.Rows.Count > 0) { cust = dt.Rows[0]["CustName"] + ""; invoiceno = dt.Rows[0]["InvoiceNo"] + ""; for (int i = 0; i < dt.Rows.Count; i++) { if (dt.Rows[i]["InvoiceNo"] + "" == "") { XMessageBox.ShowRemindMessage("所选数据中存在接收单代码为空的!"); return; } if (cust != dt.Rows[i]["CustName"] + "") { XMessageBox.ShowRemindMessage("所选数据中单位不一致!"); return; } if (invoiceno != dt.Rows[i]["InvoiceNo"] + "") { XMessageBox.ShowRemindMessage("所选数据中接收单代码不一致!"); return; } } } frmBillPrint frm = new frmBillPrint("M", selectrid, dt); frm.ShowDialog(); this.Query(); }
/// <summary> /// 检查是否有复选框选中的记录 /// </summary> /// <returns></returns> protected virtual bool IsSelectedRowByCheckBox() { int selectedRowsCount = 0; m_SelectedDeleteIds = ""; m_SelectedModels = new List <XModelBase>(); foreach (Janus.Windows.GridEX.GridEXRow gridRow in this.grdData.GetRows()) { if (gridRow.IsChecked) { selectedRowsCount += 1; XModelBase currentModel = gridRow.DataRow as XModelBase; m_SelectedModels.Add(currentModel); string id = currentModel.ID; m_SelectedDeleteIds += "'" + id + "',"; } } m_SelectedDeleteIds = m_SelectedDeleteIds.TrimEnd(','); if (selectedRowsCount > 0) { return(true); } else { string showMessage = this.GetShowNotSelectRowMessage(); XMessageBox.ShowRemindMessage(showMessage); return(false); } }
private void Update() { try { //(RID,Rno,Bno,Unitname,Linkname,Linktel,DevNameDesc,DevSpecDesc,MnoDesc,AttachmentDesc,NumDesc,PriceDesc,TotaleDesc,WriteTime,GetTime,Total,Createtime,Creator) string sql = "update TemplateBill "; sql = sql + " set Bno='" + this.txtno.Text.Trim() + "',Unitname='" + this.txt_sjdwmc.Text.Trim() + "',Linkname='" + this.txt_sjr.Text.Trim() + "',Linktel='" + this.txt_lxdh.Text.Trim() + "', "; sql = sql + " DevNameDesc='" + this.txt_jlqjmc.Text + "',DevSpecDesc='" + this.txt_xhgg.Text + "',MnoDesc='" + this.txt_ccbh.Text + "',AttachmentDesc='" + this.txt_sdfj.Text + "',NumDesc='" + this.txt_sl.Text + "',PriceDesc='" + this.txt_wgjc.Text + "',TotaleDesc='" + this.txt_xspjf.Text + "', "; sql = sql + " WriteTime='" + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "',GetTime='" + System.DateTime.Parse(this.txt_sjxyqdrq.Text).ToString("yyyy-MM-dd HH:mm:ss") + "',"; sql = sql + " Total=" + decimal.Parse(this.txt_sfzj.Text.Trim()).ToString() + ","; // "Desc_wgjc,Fee_xspjf,Fee_xspjf_num,Fee_jdjyf,Fee_jdjyf_num,Fee_jdf,Fee_jdf_num,Fee_jzf,Fee_jzf_num,Fee_csf,Fee_csf_num, Fee_jcf,Fee_jcf_num,Fee_qtsf,Fee_qtsf_num,Person_jc,Time_year,Time_month,Time_day,Memo_bill,Memo_else)" sql = sql + " Desc_wgjc='" + txt_wgjc.Text + "',Fee_xspjf='" + txt_xspjf.Text + "',Fee_xspjf_num=" + GetValue(txt_xspjf_num.Text) + ",Fee_jdjyf='" + txt_jdjyf.Text + "',Fee_jdjyf_num=" + GetValue(txt_jdjyf_num.Text) + ",Fee_jdf='" + txt_jdf.Text + "',Fee_jdf_num=" + GetValue(txt_jdf_num.Text) + ","; sql = sql + " Fee_jzf='" + txt_jzf.Text + "',Fee_jzf_num=" + GetValue(txt_jzf_num.Text) + ",Fee_csf='" + txt_csf.Text + "',Fee_csf_num=" + GetValue(txt_csf_num.Text) + ",Fee_jcf='" + txt_jcf.Text + "',Fee_jcf_num=" + GetValue(txt_jcf_num.Text) + ","; sql = sql + " Fee_qtsf='" + txt_qtsf.Text + "',Fee_qtsf_num=" + GetValue(txt_qtsf_num.Text) + ",Person_jc='" + txt_jcry.Text + "',Time_year='" + txt_syqn.Text + "',Time_month='" + txt_syqy.Text + "',Time_day='" + txt_syqr.Text + "',Memo_bill='" + txt_memo.Text + "',Memo_else='" + txt_memoelse.Text + "',"; //sql = sql + " '" + txt_xxdz.Text + "','" + txt_yzbm.Text + "','" + txt_yqjsrqz.Text + "'"; sql = sql + " Bill_dizhi='" + txt_xxdz.Text + "',Bill_youbian='" + txt_yzbm.Text + "',Bill_jieshouren='" + txt_yqjsrqz.Text + "',memo4='" + GetNewDevName() + "',memo3='" + this.txteqtype.Text + "'"; sql = sql + " where Rno='" + txtRno.Text + "'"; if (SQLHelper.ExecuteCommand(sql) > 0) { XMessageBox.ShowRemindMessage("保存成功!"); } } catch (Exception ex) { XMessageBox.ShowRemindMessage("保存异常!" + Environment.NewLine + ex.Message); } }
/// <summary> /// 新增 /// </summary> private void Insert() { try { string sql = "insert into TemplateBill(RID,Rno,Bno,Unitname,Linkname,Linktel,DevNameDesc,DevSpecDesc,MnoDesc,AttachmentDesc,NumDesc,PriceDesc,TotaleDesc,WriteTime,GetTime,Total,Createtime,Creator,"; sql += "Desc_wgjc,Fee_xspjf,Fee_xspjf_num,Fee_jdjyf,Fee_jdjyf_num,Fee_jdf,Fee_jdf_num,Fee_jzf,Fee_jzf_num,Fee_csf,Fee_csf_num, Fee_jcf,Fee_jcf_num,Fee_qtsf,Fee_qtsf_num,Person_jc,Time_year,Time_month,Time_day,Memo_bill,Memo_else,Bill_dizhi,Bill_youbian,Bill_jieshouren,memo4,memo3)"; sql = sql + " values('" + System.Guid.NewGuid() + "','" + txtRno.Text + "','" + this.txtno.Text.Trim() + "','" + this.txt_sjdwmc.Text.Trim() + "','" + this.txt_sjr.Text.Trim() + "','" + this.txt_lxdh.Text.Trim() + "', "; sql = sql + " '" + this.txt_jlqjmc.Text + "','" + this.txt_xhgg.Text + "','" + this.txt_ccbh.Text + "','" + this.txt_sdfj.Text + "','" + this.txt_sl.Text + "','" + this.txt_wgjc.Text + "','" + this.txt_xspjf.Text + "', "; sql = sql + " '" + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" + System.DateTime.Parse(this.txt_sjxyqdrq.Text).ToString("yyyy-MM-dd HH:mm:ss") + "',"; sql = sql + " " + decimal.Parse(this.txt_sfzj.Text.Trim()).ToString() + ",'" + System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','" + XCommon.LoginUsersInfo.RealName + "',"; sql = sql + " '" + txt_wgjc.Text + "','" + txt_xspjf.Text + "'," + GetValue(txt_xspjf_num.Text) + ",'" + txt_jdjyf.Text + "'," + GetValue(txt_jdjyf_num.Text) + ",'" + txt_jdf.Text + "'," + GetValue(txt_jdf_num.Text) + ","; sql = sql + " '" + txt_jzf.Text + "'," + GetValue(txt_jzf_num.Text) + ",'" + txt_csf.Text + "'," + GetValue(txt_csf_num.Text) + ",'" + txt_jcf.Text + "'," + GetValue(txt_jcf_num.Text) + ","; sql = sql + " '" + txt_qtsf.Text + "'," + GetValue(txt_qtsf_num.Text) + ",'" + txt_jcry.Text + "','" + txt_syqn.Text + "','" + txt_syqy.Text + "','" + txt_syqr.Text + "','" + txt_memo.Text + "','" + txt_memoelse.Text + "',"; sql = sql + " '" + txt_xxdz.Text + "','" + txt_yzbm.Text + "','" + txt_yqjsrqz.Text + "','" + GetNewDevName() + "','" + this.txteqtype.Text + "'"; sql = sql + " )"; if (SQLHelper.ExecuteCommand(sql) > 0) { string updatemainsql = "update EquipmentReceive set InvoiceNo='" + txtRno.Text + "' where RID in (" + SelectRowId + ")"; SQLHelper.ExecuteCommand(updatemainsql); XMessageBox.ShowRemindMessage("保存成功!"); } } catch (Exception ex) { XMessageBox.ShowRemindMessage("保存异常!" + Environment.NewLine + ex.Message); } }
void cmdFinishTask_Click(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e) { TreeNode selectedNode = this.tvTask.SelectedNode; if (selectedNode == null) { XMessageBox.ShowError("请选择要结束的任务!"); return; } XTaskInfo taskInfo = selectedNode.Tag as XTaskInfo; if (taskInfo == null) { XMessageBox.ShowError("请选择要结束的任务!"); return; } if (XMessageBox.ShowQuestion("确定要结束选中的任务吗?") == System.Windows.Forms.DialogResult.No) { return; } if (this.m_TaskBusiness.UpdateTaskStatus("结束", taskInfo.ID)) { XMessageBox.ShowRemindMessage("结束任务成功!"); } else { XMessageBox.ShowError("结束任务失败!"); } }
void cmdDownload_Click(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e) { if (this.tvTask.SelectedNode != null) { XTaskFilesInfo model = this.tvTask.SelectedNode.Tag as XTaskFilesInfo; string mainId = model.RID; bool isExist = this.m_FileAttachBusiness.IsFileExist(mainId); if (!isExist) { XMessageBox.ShowError("未找到附件!"); return; } FolderBrowserDialog fbd = new FolderBrowserDialog(); if (fbd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { string fileName = this.m_FileAttachBusiness.DownloadFile(mainId, fbd.SelectedPath); if (fileName != string.Empty) { XMessageBox.ShowRemindMessage("下载完成!"); } else { XMessageBox.ShowError("下载失败!"); } } } else { XMessageBox.ShowError("请选择要下载附件的记录!"); } }
private void btnExport_Click(object sender, EventArgs e) { try { SaveFileDialog sfd = new SaveFileDialog(); sfd.Filter = "Excel文件(*.xls)|*.xls"; if (sfd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { this.grdExporter.SheetName = this.Text; //this.grdData.RootTable.Columns["select"].Visible = false; System.IO.Stream stream = new System.IO.FileStream(sfd.FileName, System.IO.FileMode.CreateNew); this.grdExporter.Export(stream); stream.Close(); //this.grdData.RootTable.Columns["select"].Visible = true; XMessageBox.ShowRemindMessage("导出完成!"); } } catch (Exception ex) { XErrorLogTool.WriteLog(ex.ToString()); XMessageBox.ShowError("导出失败!"); } finally { //this.grdData.RootTable.Columns["select"].Visible = true; } }
/// <summary> /// 删除 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnDel_Click(object sender, EventArgs e) { string selectrid = GetSelectRow(); if (!(IsCheck(selectrid))) { XMessageBox.ShowRemindMessage("请选择记录信息!"); return; } DataTable dt = new DataTable(); string sql = "select * from V_EquipmentReceive where rid in(" + selectrid + ")"; dt = SQLHelper.GetDataSet(sql); if (dt == null) { XMessageBox.ShowRemindMessage("数据提取异常!"); return; } if (dt.Rows.Count <= 0) { XMessageBox.ShowRemindMessage("数据提取异常!"); return; } if (dt.Rows.Count > 1) { XMessageBox.ShowRemindMessage("请选择一条数据!"); return; } string invoiceno = dt.Rows[0]["InvoiceNo"] + ""; if (invoiceno == "") { XMessageBox.ShowRemindMessage("所选数据未打印接收单!"); return; } if (MessageBox.Show("是否删除接收单号为:" + invoiceno + "的接收单信息?", "提醒!", MessageBoxButtons.YesNo, MessageBoxIcon.Information) == System.Windows.Forms.DialogResult.Yes) { string sqldel = "delete from TemplateBill where Rno='" + invoiceno + "'"; string sqlupdate = "update EquipmentReceive set InvoiceNo='' where InvoiceNo='" + invoiceno + "'"; if (SQLHelper.ExecuteCommand(sqldel) > 0) { if (SQLHelper.ExecuteCommand(sqlupdate) > 0) { XMessageBox.ShowRemindMessage("执行成功!"); } } } this.Query(); }
/// <summary> /// 校验是否选中记录 /// </summary> /// <returns></returns> protected virtual bool IsSelectedRow() { if (this.grdData.CurrentRow == null || this.grdData.CurrentRow.RowType != Janus.Windows.GridEX.RowType.Record) { string showMessage = this.GetShowNotSelectRowMessage(); XMessageBox.ShowRemindMessage(showMessage); return(false); } this.m_CurrentModel = this.grdData.CurrentRow.DataRow as XModelBase; return(true); }
protected override void SaveFunction() { XSystemConfigInfo configInfo = new XSystemConfigInfo(); configInfo.SignWidht = XHelper.GetInt(this.nebWidth.Value); configInfo.SignHeight = XHelper.GetInt(this.nebHeight.Value); configInfo.RefreshMinutes = XHelper.GetInt(this.nebRefreshMinutes.Value); if (this.m_ConfigTool.SaveConfigInfo(configInfo)) { XUICommon.SystemConfigInfo = configInfo; XMessageBox.ShowRemindMessage("保存成功!"); this.Close(); } }
private void btnSave_Click(object sender, EventArgs e) { XRemindConfigInfo remindConfigInfo = this.grdData.CurrentRow.DataRow as XRemindConfigInfo; IList <XRoleInfo> selectedRoles = this.GetSelectedRoles(); IList <XUsersInfo> selectedUsers = this.GetSelectedUsers(); if (this.m_RemindConfigBusiness.SaveRemindConfig(remindConfigInfo, selectedUsers, selectedRoles)) { XMessageBox.ShowRemindMessage("保存成功!"); } else { XMessageBox.ShowError("保存失败!"); } }
void cmdDeleteTask_Click(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e) { TreeNode selectedNode = this.tvTask.SelectedNode; if (selectedNode != null) { XModelBase model = selectedNode.Tag as XModelBase; if (!this.m_TaskBusiness.IsEndModel(model)) { XMessageBox.ShowError("该任务下有子任务,不能删除!"); return; } if (this.m_TaskBusiness.IsHaveFile(model.ID)) { XMessageBox.ShowError("该任务下已有任务提交,不能删除!"); return; } if (XMessageBox.ShowQuestion("确定要删除选中的任务吗?") == System.Windows.Forms.DialogResult.No) { return; } if (this.m_TaskBusiness.Delete(model, XCommon.LoginUsersInfo.RID)) { XMessageBox.ShowRemindMessage("删除成功!"); if (selectedNode.Parent == null) { this.tvTask.Nodes.Remove(selectedNode); } else { selectedNode.Parent.Nodes.Remove(selectedNode); } } else { XMessageBox.ShowError("删除失败!"); } } else { XMessageBox.ShowError("请选择要删除的任务!"); } }
/// <summary> /// 同步合同订单的设备名称 /// 2016-11-24 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void label6_Click(object sender, EventArgs e) { int savenum = 0; try { string sqlget = "select RID, DevNameDesc,Rno from TemplateBill "; DataTable dt = new DataTable(); dt = SQLHelper.GetDataSet(sqlget); string typename = ""; string sqltype = ""; DataTable dtt = new DataTable(); string sql = ""; for (int i = 0; i < dt.Rows.Count; i++) { sqltype = "select EquipmentTypeName from V_EquipmentReceive where InvoiceNo='" + dt.Rows[i][2].ToString() + "' "; dtt = new DataTable(); dtt = SQLHelper.GetDataSet(sqltype); typename = ""; if (dtt != null) { if (dtt.Rows != null) { for (int j = 0; j < dtt.Rows.Count; j++) { typename = typename + dtt.Rows[j][0].ToString() + " "; } } } sql = "update TemplateBill set memo4='" + GetNewDevNameT(dt.Rows[i][1].ToString()) + "', memo3='" + GetNewDevType(typename) + "' where rid='" + dt.Rows[i][0].ToString() + "'"; savenum = savenum + SQLHelper.ExecuteCommand(sql); } XMessageBox.ShowRemindMessage("更新" + savenum.ToString() + "条信息!", "提示"); } catch (Exception ex) { XMessageBox.ShowError(ex.Message.ToString(), "提示!"); } }
/// <summary> /// 2016-11-21,mxj,add /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btndevlp_Click(object sender, EventArgs e) { try { string sqlget = "select EquipmentCheckId from EquipmentReceive where InvoiceNo='" + txtRno.Text + "'"; DataTable dt = new DataTable(); dt = SQLHelper.GetDataSet(sqlget); if (dt != null) { if (dt.Rows.Count > 0) { string where = " "; for (int i = 0; i < dt.Rows.Count; i++) { if (i == dt.Rows.Count - 1) { where += " rid='" + dt.Rows[i][0].ToString() + "' "; } else { where += " rid='" + dt.Rows[i][0].ToString() + "' or "; } } string sql = "update EquipmentCheck set LinkMan='" + txt_sjr.Text + "', Tel='" + txt_lxdh.Text + "' where " + where; if (SQLHelper.ExecuteCommand(sql) > 0) { //XMessageBox.ShowRemindMessage("更新成功!"); //同时保存单据 if (EditFlag == "M") { Update(); } } } } } catch (Exception ex) { XMessageBox.ShowRemindMessage("更新异常!" + Environment.NewLine + ex.Message); } }
private void DeleteFiles() { if (this.grdFiles.GetCheckedRows().Length == 0) { XMessageBox.ShowError("请选择要删除的记录!"); return; } IList <XModelBase> deletedModels = new List <XModelBase>(); foreach (Janus.Windows.GridEX.GridEXRow gridExRow in this.grdFiles.GetCheckedRows()) { XModelBase model = gridExRow.DataRow as XModelBase; XTaskFilesInfo taskFilesInfo = model as XTaskFilesInfo; if (taskFilesInfo.InputUserId != XCommon.LoginUsersInfo.RID) { XMessageBox.ShowError("不能删除非本人提交的任务文档!"); return; } deletedModels.Add(model); } if (this.m_TaskFilesBusiness.Delete(deletedModels, XCommon.LoginUsersInfo.RID)) { XMessageBox.ShowRemindMessage("删除成功!"); IList <XModelBase> modelLists = this.grdFiles.DataSource as IList <XModelBase>; foreach (XModelBase model in deletedModels) { Janus.Windows.GridEX.GridEXRow row = this.grdFiles.GetRow(model); row.Delete(); modelLists.Remove(model); } } else { XMessageBox.ShowError("删除失败!"); } }
protected override void SaveFunction() { if (this.txtPassword.Text.Trim() == string.Empty) { XMessageBox.ShowError("重置密码不能为空!"); return; } string password = XMD5EncodeTool.Encode(this.txtPassword.Text.Trim()); if (this.ResetOperate(password)) { XMessageBox.ShowRemindMessage("重置密码成功!"); this.Close(); } else { XMessageBox.ShowRemindMessage("重置密码失败!"); } }
private void btnSave_Click(object sender, EventArgs e) { if (this.grdData.CurrentRow == null || this.grdData.CurrentRow.RowType != Janus.Windows.GridEX.RowType.Record) { XMessageBox.ShowError("请选择用户!"); return; } XUsersInfo usersInfo = this.grdData.CurrentRow.DataRow as XUsersInfo; IList <XUseDeptInfo> selectedDepts = this.GetSelectedDepts(); if (this.m_UserDeptBusiness.SaveUserDepts(usersInfo.RID, selectedDepts, XCommon.LoginUsersInfo.RID)) { XMessageBox.ShowRemindMessage("保存成功!"); } else { XMessageBox.ShowError("保存失败!"); } }
protected virtual void ShowDeleteMessage(bool isSuccess) { string showMessage = ""; if (isSuccess) { showMessage = "删除成功!"; } else { showMessage = "删除失败"; } if (this.m_ErrorInfo.Trim() != string.Empty && isSuccess == false) { showMessage += this.m_ErrorInfo; } if (this.m_AppendDeleteMessage.Trim() != string.Empty) { showMessage += this.m_AppendDeleteMessage; } XMessageBox.ShowRemindMessage(showMessage); }
protected virtual void Download() { if (this.grdData.CurrentRow != null && this.grdData.CurrentRow.RowType == Janus.Windows.GridEX.RowType.Record) { XModelBase model = this.grdData.CurrentRow.DataRow as XModelBase; this.m_CurrentModel = model; string mainId = this.GetModelPKValue(model); bool isExist = this.m_FileAttachBusiness.IsFileExist(mainId); if (!isExist) { XMessageBox.ShowError("未找到附件!"); return; } FolderBrowserDialog fbd = new FolderBrowserDialog(); if (fbd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { string fileName = this.m_FileAttachBusiness.DownloadFile(mainId, fbd.SelectedPath); if (fileName != string.Empty) { XMessageBox.ShowRemindMessage("下载完成!"); this.DownloadAfter(); } else { XMessageBox.ShowError("下载失败!"); } } } else { XMessageBox.ShowError("请选择要下载附件的记录!"); } }
private void btnApplyPassword_Click(object sender, EventArgs e) { if (this.txtPassword.Text.Trim() == string.Empty) { XMessageBox.ShowError("请输入要申请的密码!"); return; } XPassWordTmpBusiness business = this.m_Business as XPassWordTmpBusiness; XPassWordTmpInfo passwordTmpInfo = business.GetTempPasswordInfo(XCommon.LoginUsersInfo.RID) as XPassWordTmpInfo; if (passwordTmpInfo != null) { XMessageBox.ShowError("已存在有效期内的密码,请不要重复申请!"); return; } int validDays = XHelper.GetInt(ConfigurationManager.AppSettings["PassworkValidDays"]); XPassWordTmpInfo newInfo = new XPassWordTmpInfo(); newInfo.RID = Guid.NewGuid().ToString(); newInfo.Password = this.txtPassword.Text.Trim(); newInfo.UseStartTime = XHelper.GetFormatedTime(DateTime.Now); newInfo.UseEndTime = XHelper.GetFormatedTime(DateTime.Now.AddDays(validDays)); newInfo.UserId = XCommon.LoginUsersInfo.RID; newInfo.UserName = XCommon.LoginUsersInfo.UserName; newInfo.UseIP = XNetHelper.GetLocalIP4Address(); if (business.Insert(newInfo)) { XMessageBox.ShowRemindMessage("密码申请成功,请等待审核!"); } else { XMessageBox.ShowError("密码申请失败!"); } }
/// <summary> /// 下载附件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void cmdDownloadAttach_Click(object sender, Janus.Windows.UI.CommandBars.CommandEventArgs e) { if (this.grdTaskAttach.CurrentRow != null && this.grdTaskAttach.CurrentRow.RowType != Janus.Windows.GridEX.RowType.Record) { XMessageBox.ShowError("请选择要下载附件的记录!"); return; } XTaskAttachmentInfo model = this.grdTaskAttach.CurrentRow.DataRow as XTaskAttachmentInfo; string mainId = model.RID; bool isExist = this.m_FileAttachBusiness.IsFileExist(mainId); if (!isExist) { XMessageBox.ShowError("未找到附件!"); return; } FolderBrowserDialog fbd = new FolderBrowserDialog(); if (fbd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { string fileName = this.m_FileAttachBusiness.DownloadFile(mainId, fbd.SelectedPath); if (fileName != string.Empty) { XMessageBox.ShowRemindMessage("下载完成!"); } else { XMessageBox.ShowError("下载失败!"); } } }
private void btnDownload_Click(object sender, EventArgs e) { if (this.grdData.CurrentRow != null && this.grdData.CurrentRow.RowType == Janus.Windows.GridEX.RowType.Record) { XModelBase model = this.grdData.CurrentRow.DataRow as XModelBase; FolderBrowserDialog fbd = new FolderBrowserDialog(); if (fbd.ShowDialog() == System.Windows.Forms.DialogResult.OK) { string fileId = model.ID; if (this.m_Business.Download(fileId, fbd.SelectedPath)) { XMessageBox.ShowRemindMessage("下载完成!"); } else { XMessageBox.ShowError("下载失败!"); } } } else { XMessageBox.ShowError("请选择要下载的文件!"); } }
/// <summary> /// 显示保存的消息 /// </summary> /// <param name="isSuccess">是否保存成功</param> protected virtual void ShowSaveMessage(bool isSuccess) { string showMessage = ""; if (isSuccess) { showMessage = "保存成功!"; } else { showMessage = "保存失败"; } //获取追加的消息 this.GetAppendShowMessage(isSuccess); if (this.m_ErrorInfo.Trim() != string.Empty && isSuccess == false) { showMessage += this.m_ErrorInfo; } if (this.m_AppendShowMessage.Trim() != string.Empty) { showMessage += m_AppendShowMessage; } XMessageBox.ShowRemindMessage(showMessage); }
//EquipmentName //Model //FactoryNo // //Quanlity public frmBillPrint(string _editFlag, string _selectRowId, DataTable _outTb) { InitializeComponent(); try { EditFlag = _editFlag; SelectRowId = _selectRowId; OutTable = _outTb; btndevlp.Visible = false; if (EditFlag == "A") { this.txtRno.Text = System.DateTime.Now.ToString("yyyyMMddHHmmssffff"); string EquipmentName = ""; string Model = ""; string FactoryNo = ""; string Quanlity = ""; string cust = ""; string custid = ""; string equipmentType = ""; for (int i = 0; i < _outTb.Rows.Count; i++) { if (i == 0) { cust = _outTb.Rows[i]["CustName"] + ""; custid = _outTb.Rows[i]["EquipmentCustId"] + ""; this.txt_sjxyqdrq.Text = _outTb.Rows[i]["LastCheckDate"] + ""; } EquipmentName = EquipmentName + _outTb.Rows[i]["EquipmentName"] + "" + Environment.NewLine + Environment.NewLine; Model = Model + _outTb.Rows[i]["Model"] + "" + Environment.NewLine + Environment.NewLine; FactoryNo = FactoryNo + _outTb.Rows[i]["FactoryNo"] + "" + Environment.NewLine + Environment.NewLine; Quanlity = Quanlity + _outTb.Rows[i]["Quanlity"] + "" + Environment.NewLine + Environment.NewLine; //2016-11-25,mxj,add equipmentType = equipmentType + _outTb.Rows[i]["EquipmentTypeName"] + "" + " "; } this.txt_sjdwmc.Text = cust; this.txt_jlqjmc.Text = EquipmentName; this.txt_xhgg.Text = Model; this.txt_ccbh.Text = FactoryNo; this.txt_sl.Text = Quanlity; this.txteqtype.Text = GetNewDevType(equipmentType); if (custid != "") { string sqlget = "select * from V_EquipmentCust where rid='" + custid + "'"; DataTable dt = new DataTable(); dt = SQLHelper.GetDataSet(sqlget); if (dt != null) { if (dt.Rows.Count > 0) { this.txt_xxdz.Text = dt.Rows[0]["CustAddress"] + ""; //地址 this.txt_sjr.Text = dt.Rows[0]["LinkPeople"] + ""; //联系人 this.txt_lxdh.Text = dt.Rows[0]["MobileNo"] + ""; //电话 this.txt_memo.Text = dt.Rows[0]["Remark"] + ""; //备注 } } } if (this.txt_sjxyqdrq.Text.Trim() == "") { this.txt_sjxyqdrq.Text = System.DateTime.Now.ToString("yyyy-MM-dd"); } } else if (EditFlag == "M") { btndevlp.Visible = true; string rno = ""; for (int i = 0; i < _outTb.Rows.Count; i++) { if (i == 0) { rno = _outTb.Rows[i]["InvoiceNo"] + ""; } } string sqlget = "select * from TemplateBill where Rno='" + rno + "'"; DataTable dt = new DataTable(); dt = SQLHelper.GetDataSet(sqlget); if (dt == null) { XMessageBox.ShowRemindMessage("获取接收单信息异常"); this.Close(); } if (dt.Rows.Count <= 0) { XMessageBox.ShowRemindMessage("获取接收单信息异常"); this.Close(); } DataRow dr = dt.Rows[0]; this.txtRno.Text = dr["Rno"] + ""; this.txtno.Text = dr["Bno"] + ""; this.txt_sjdwmc.Text = dr["Unitname"] + ""; this.txt_sjr.Text = dr["Linkname"] + ""; this.txt_lxdh.Text = dr["Linktel"] + ""; this.txt_jlqjmc.Text = dr["DevNameDesc"] + ""; this.txt_xhgg.Text = dr["DevSpecDesc"] + ""; this.txt_ccbh.Text = dr["MnoDesc"] + ""; this.txt_sdfj.Text = dr["AttachmentDesc"] + ""; this.txt_sl.Text = dr["NumDesc"] + ""; this.txt_wgjc.Text = dr["PriceDesc"] + ""; this.txt_xspjf.Text = dr["TotaleDesc"] + ""; this.txteqtype.Text = dr["Memo3"] + ""; if (dr["Total"] != null) { this.txt_sfzj.Text = decimal.Parse(dr["Total"].ToString()).ToString("0.00"); } this.txt_sjrqz.Text = dr["Linkmanw"] + ""; this.txt_yqjsrqz.Text = dr["Accnamw"] + ""; //if (dr["WriteTime"] != null) //{ // this.txt_sjxyqdrq.Text = System.DateTime.Parse(dr["WriteTime"].ToString()).ToString("yyyy-MM-dd"); //} //if (dr["GetTime"] != null) //{ // this.txt_tqzsjyqrq.Text = System.DateTime.Parse(dr["GetTime"].ToString()).ToString("yyyy-MM-dd"); //} if (dr["GetTime"] != null) { this.txt_sjxyqdrq.Text = System.DateTime.Parse(dr["GetTime"].ToString()).ToString("yyyy-MM-dd"); } txt_xxdz.Text = dr["Bill_dizhi"] + ""; txt_yzbm.Text = dr["Bill_youbian"] + ""; txt_yqjsrqz.Text = dr["Bill_jieshouren"] + ""; txt_wgjc.Text = dr["Desc_wgjc"] + ""; txt_xspjf.Text = dr["Fee_xspjf"] + ""; if (dr["Fee_xspjf_num"] != null) { this.txt_xspjf_num.Text = dr["Fee_xspjf_num"].ToString(); } txt_jdjyf.Text = dr["Fee_jdjyf"] + ""; if (dr["Fee_jdjyf_num"] != null) { this.txt_jdjyf_num.Text = dr["Fee_jdjyf_num"].ToString(); } txt_jdf.Text = dr["Fee_jdf"] + ""; if (dr["Fee_jdf_num"] != null) { this.txt_jdf_num.Text = dr["Fee_jdf_num"].ToString(); } txt_jzf.Text = dr["Fee_jzf"] + ""; if (dr["Fee_jzf_num"] != null) { this.txt_jzf_num.Text = dr["Fee_jzf_num"].ToString(); } txt_csf.Text = dr["Fee_csf"] + ""; if (dr["Fee_csf_num"] != null) { this.txt_csf_num.Text = dr["Fee_csf_num"].ToString(); } txt_jcf.Text = dr["Fee_jcf"] + ""; if (dr["Fee_jcf_num"] != null) { this.txt_jcf_num.Text = dr["Fee_jcf_num"].ToString(); } txt_qtsf.Text = dr["Fee_qtsf"] + ""; if (dr["Fee_qtsf_num"] != null) { this.txt_qtsf_num.Text = dr["Fee_qtsf_num"].ToString(); } txt_jcry.Text = dr["Person_jc"] + ""; txt_syqn.Text = dr["Time_year"] + ""; txt_syqy.Text = dr["Time_month"] + ""; txt_syqr.Text = dr["Time_day"] + ""; txt_memo.Text = dr["Memo_bill"] + ""; txt_memoelse.Text = dr["Memo_else"] + ""; } //XMessageBox.ShowRemindMessage(SelectRowId); } catch (Exception ex) { XMessageBox.ShowRemindMessage(ex.Message); } }