public void EditDefaultMessage(T_WF_DEFAULTMESSAGE entity) { try { string updSql = @"UPDATE T_WF_DEFAULTMESSAGE SET SYSTEMCODE=:SYSTEMCODE,SYSTEMNAME=:SYSTEMNAME,MODELCODE=: MODELCODE,MODELNAME=:MODELNAME,AUDITSTATE=:AUDITSTATE,MESSAGECONTENT=:MESSAGECONTENT,APPLICATIONURL=:APPLICATIONURL,UPDATEUSERID=:UPDATEUSERID, UPDATEUSERNAME=:UPDATEUSERNAME,UPDATEDATE=:UPDATEDATE WHERE MESSAGEID=:MESSAGEID"; OracleParameter[] pageparm = { new OracleParameter(":SYSTEMCODE", dal.GetValue(entity.SYSTEMCODE)), new OracleParameter(":SYSTEMNAME", dal.GetValue(entity.SYSTEMNAME)), new OracleParameter(":MODELCODE", dal.GetValue(entity.MODELCODE)), new OracleParameter(":SYSTEMCODE", dal.GetValue(entity.SYSTEMCODE)), new OracleParameter(":MODELNAME", dal.GetValue(entity.MODELNAME)), new OracleParameter(":AUDITSTATE", dal.GetValue(entity.AUDITSTATE)), new OracleParameter(":MESSAGECONTENT", dal.GetValue(entity.MESSAGECONTENT)), new OracleParameter(":APPLICATIONURL", dal.GetValue(entity.APPLICATIONURL)), new OracleParameter(":UPDATEUSERID", dal.GetValue(entity.CREATEUSERID)), new OracleParameter(":UPDATEUSERNAME", dal.GetValue(entity.CREATEUSERNAME)), new OracleParameter(":UPDATEDATE", dal.GetValue(DateTime.Now)), new OracleParameter(":MESSAGEID", dal.GetValue(entity.MESSAGEID)) }; dal.ExecuteSql(updSql, pageparm); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
/// <summary> /// 新增默认消息 /// </summary> /// <param name="entity"></param> public void AddDefaultMessage(T_WF_DEFAULTMESSAGE entity) { try { if (string.IsNullOrWhiteSpace(entity.MESSAGEID)) { entity.MESSAGEID = Guid.NewGuid().ToString(); } string insSql = @"INSERT INTO T_WF_DEFAULTMESSAGE (MESSAGEID,SYSTEMCODE,SYSTEMNAME,MODELCODE,MODELNAME,AUDITSTATE, MESSAGECONTENT,APPLICATIONURL,CREATEUSERID,CREATEUSERNAME) VALUES (:MESSAGEID,:SYSTEMCODE,:SYSTEMNAME,:MODELCODE, :MODELNAME,:AUDITSTATE,:MESSAGECONTENT,:APPLICATIONURL,:CREATEUSERID,:CREATEUSERNAME)"; OracleParameter[] pageparm = { new OracleParameter(":MESSAGEID", dal.GetValue(entity.MESSAGEID)), new OracleParameter(":SYSTEMCODE", dal.GetValue(entity.SYSTEMCODE)), new OracleParameter(":SYSTEMNAME", dal.GetValue(entity.SYSTEMNAME)), new OracleParameter(":MODELCODE", dal.GetValue(entity.MODELCODE)), new OracleParameter(":MODELNAME", dal.GetValue(entity.MODELNAME)), new OracleParameter(":AUDITSTATE", dal.GetValue(entity.AUDITSTATE)), new OracleParameter(":MESSAGECONTENT", dal.GetValue(entity.MESSAGECONTENT)), new OracleParameter(":APPLICATIONURL", dal.GetValue(entity.APPLICATIONURL)), new OracleParameter(":CREATEUSERID", dal.GetValue(entity.CREATEUSERID)), new OracleParameter(":CREATEUSERNAME", dal.GetValue(entity.CREATEUSERNAME)) }; dal.ExecuteSql(insSql, pageparm); } catch (Exception ex) { throw new Exception(ex.Message, ex); } }
private void btnSave_Click(object sender, RoutedEventArgs e) { if (txtMSGCONTENT.Text.Trim() == "") { ComfirmWindow.ConfirmationBox("提示信息", "消息内容不能为空!", "确定"); return; } AppSystem system = cobSYSTEMCODE.SelectedItem as AppSystem; AppModel model = cobMODELCODE.SelectedItem as AppModel; if (system.Name == "0" || model.Name == "0") { ComfirmWindow.ConfirmationBox("提示信息", "请正确选择 [系统]和[模块]!", "确定"); return; } if (this.cbCondition.SelectedIndex < 1) { ComfirmWindow.ConfirmationBox("提示信息", "请选择审核条件!", "确定"); return; } if (ActionType == "0") { T_WF_DEFAULTMESSAGE ent = new T_WF_DEFAULTMESSAGE(); ent.MESSAGEID = Guid.NewGuid().ToString(); ent.MESSAGECONTENT = txtMSGCONTENT.Text.Trim(); ent.APPLICATIONURL = txtURL.Text.Trim(); ent.AUDITSTATE = this.cbCondition.SelectedIndex; ent.SYSTEMCODE = (cobSYSTEMCODE.SelectedItem as AppSystem).Name; ent.SYSTEMNAME = (cobSYSTEMCODE.SelectedItem as AppSystem).Description; ent.MODELCODE = (cobMODELCODE.SelectedItem as AppModel).Name; ent.MODELNAME = (cobMODELCODE.SelectedItem as AppModel).Description; //entity.CREATEUSERNAME = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeName; //entity.CREATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID; client.AddMessageAsync(ent); } else { T_WF_DEFAULTMESSAGE ent = new T_WF_DEFAULTMESSAGE(); ent.MESSAGEID = entity.MESSAGEID; ent.MESSAGECONTENT = txtMSGCONTENT.Text.Trim(); ent.APPLICATIONURL = txtURL.Text.Trim(); ent.AUDITSTATE = this.cbCondition.SelectedIndex; ent.SYSTEMCODE = (cobSYSTEMCODE.SelectedItem as AppSystem).Name; ent.SYSTEMNAME = (cobSYSTEMCODE.SelectedItem as AppSystem).Description; ent.MODELCODE = (cobMODELCODE.SelectedItem as AppModel).Name; ent.MODELNAME = (cobMODELCODE.SelectedItem as AppModel).Description; ent.CREATEUSERNAME = entity.CREATEUSERNAME; ent.CREATEUSERID = entity.CREATEUSERID; //ent.UPDATEUSERNAME = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeName; //ent.UPDATEUSERID = SMT.SAAS.Main.CurrentContext.Common.CurrentLoginUserInfo.EmployeeID; client.EditMessageAsync(ent); } }
public void InitDefaultMessage() { //using (TransactionScope scope = new TransactionScope()) //{ try { List <AppSystem> ListSystemCode = ListSystem(); foreach (var item in ListSystemCode) { List <AppModel> ListModel = AppModel(item.ObjectFolder); foreach (var detail in ListModel) { for (int i = 1; i <= 3; i++) { T_WF_DEFAULTMESSAGE entity = new T_WF_DEFAULTMESSAGE(); entity.MODELCODE = detail.Name; entity.SYSTEMCODE = item.Name; entity.SYSTEMNAME = item.Description; entity.MODELNAME = detail.Description; entity.APPLICATIONURL = GetMessageUrl(item.ObjectFolder, detail.Name); entity.AUDITSTATE = i; entity.CREATEUSERID = "系统初始化"; entity.CREATEUSERNAME = "******"; switch (i) { case 1: entity.MESSAGECONTENT = "您有一条[" + detail.Description + "]的单据需要审核!"; break; case 2: entity.MESSAGECONTENT = "您的[" + detail.Description + "]已审核通过!"; break; case 3: entity.MESSAGECONTENT = "您的[" + detail.Description + "]审核不通过!"; break; } AddDefaultMessage(entity); } } } //scope.Complete(); } catch (Exception ex) { throw new Exception(ex.Message, ex); } finally { //释放资源 //scope.Dispose(); } //} }
public bool GetBool(T_WF_DEFAULTMESSAGE message) { string sql = "select * from T_WF_DEFAULTMESSAGE where SYSTEMCODE='" + message.SYSTEMCODE + "' and MODELCODE='" + message.MODELCODE + "' and AUDITSTATE='" + message.AUDITSTATE + "'"; sql += " and MESSAGEID!='" + message.MESSAGEID + "'"; if (dal.GetDataTable(sql).Rows.Count > 0) { return(false); } return(true); }
void btnDelete_Click(object sender, RoutedEventArgs e) { if (dgDefaultMessage.SelectedItems.Count == 1) { string Result = ""; ComfirmWindow com = new ComfirmWindow(); com.OnSelectionBoxClosed += (obj, result) => { T_WF_DEFAULTMESSAGE ent = dgDefaultMessage.SelectedItem as T_WF_DEFAULTMESSAGE; client.DeleteMessageAsync(ent.MESSAGEID); }; com.SelectionBox("删除确定", "你确定删除选中信息吗?", ComfirmWindow.titlename, Result); } else { ComfirmWindow.ConfirmationBox("提示信息", "请先选择一条需要删除的记录", "确定"); } }
public string EditMessage(T_WF_DEFAULTMESSAGE entity) { try { if (bll.GetBool(entity)) { bll.EditDefaultMessage(entity); } else { return("2"); } return("1"); } catch (Exception ex) { return(ex.Message); } }
public EditDefaultMessage(T_WF_DEFAULTMESSAGE Entity) { InitializeComponent(); if (Entity == null) { ActionType = "0"; entity = new T_WF_DEFAULTMESSAGE(); } else { ActionType = "1"; entity = Entity; txtMSGCONTENT.Text = entity.MESSAGECONTENT == null ? "" : entity.MESSAGECONTENT;; //this.cobSYSTEMCODE.Selected<AppSystem>("Name", entity.SYSTEMCODE); //this.cobMODELCODE.Selected<AppModel>("Name", entity.MODELCODE); this.cbCondition.SelectedIndex = entity.AUDITSTATE == null ? 0 : (int)entity.AUDITSTATE; this.txtURL.Text = entity.APPLICATIONURL == null ? "" : entity.APPLICATIONURL; } InitWCFCompleted(); }