diff --git a/EuroTran/EasyBL.WEBAPP/SYS/MembersMaintain_UpdService.cs b/EuroTran/EasyBL.WEBAPP/SYS/MembersMaintain_UpdService.cs index baffd5f..a9337f2 100644 --- a/EuroTran/EasyBL.WEBAPP/SYS/MembersMaintain_UpdService.cs +++ b/EuroTran/EasyBL.WEBAPP/SYS/MembersMaintain_UpdService.cs @@ -88,6 +88,7 @@ namespace EasyBL.WEBAPP.WSM { var oEntity = _fetchEntity(i_crm); _setEntityBase(oEntity, i_crm); + //Yang 2019/01/25 判斷Password是否為空值,是直接給預序密碼加密;否取得密碼加密 if (!string.IsNullOrEmpty(oEntity.Password)) { @@ -116,6 +117,31 @@ namespace EasyBL.WEBAPP.WSM } iRel += db.Insertable(saRuleInsert).ExecuteCommand(); } + + string sError = null; + var sEmail = oEntity.Email; //取得信箱 + var oEmail = new Emails(); //寄件人 + var toEmail = new List(); //收件人 + var oEmailTo = new EmailTo //收件人資訊 + { + ToUserID = oEntity.MemberID, + ToUserName = oEntity.MemberName, + ToEmail = oEntity.Email, + Type = "to" + }; + toEmail.Add(oEmailTo); + oEmail.FromUserName = "系統自動發送";//取fonfig + oEmail.Title = "奕達運通管理系統信息派送";//取fonfig + oEmail.EmailBody = "新密碼為:123456"; + oEmail.IsCCSelf = false; + oEmail.Attachments = null; + oEmail.EmailTo = toEmail; + var bSend = new MailService(oEntity.OrgID, true).MailFactory(oEmail, out sError); + if (sError != null) + { + break; + } + rm = new SuccessResponseMessage(null, i_crm); rm.DATA.Add(BLWording.REL, iRel); } while (false); @@ -274,9 +300,10 @@ namespace EasyBL.WEBAPP.WSM do { var sMemberID = _fetchString(i_crm, @"MemberID"); - var oMembers = db.Queryable().Single(x => x.MemberID == sMemberID); - var iRel = db.Deleteable().Where(x => x.OrgID == i_crm.ORIGID && x.MemberID == sMemberID).ExecuteCommand(); - iRel += db.Deleteable().Where(x => x.OrgID == i_crm.ORIGID && x.MemberID == sMemberID).ExecuteCommand(); + var sOrgID = _fetchString(i_crm, @"OrgID"); + var oMembers = db.Queryable().Single(x => x.MemberID == sMemberID && x.OrgID == sOrgID); + var iRel = db.Deleteable().Where(x => x.OrgID == i_crm.ORIGID && x.MemberID == sMemberID && x.OrgID == sOrgID).ExecuteCommand(); + iRel += db.Deleteable().Where(x => x.OrgID == i_crm.ORIGID && x.MemberID == sMemberID && x.OrgID == sOrgID).ExecuteCommand(); i_crm.DATA.Add("FileID", oMembers.MemberPic); i_crm.DATA.Add("IDType", "parent"); new CommonService().DelFile(i_crm); diff --git a/EuroTran/WebApp/Scripts/pages/Sys/MembersMaintain_Upd.js b/EuroTran/WebApp/Scripts/pages/Sys/MembersMaintain_Upd.js index 8ac3cee..e2e386f 100644 --- a/EuroTran/WebApp/Scripts/pages/Sys/MembersMaintain_Upd.js +++ b/EuroTran/WebApp/Scripts/pages/Sys/MembersMaintain_Upd.js @@ -133,30 +133,30 @@ var fnPageInit = function () { * @param {Object} data 當前新增的資料 * @param {String} flag 新增 or 儲存后新增 */ - getInsertBack: function (pargs, data, flag) { - var fnCallBack = function () { - if (flag === 'add') { - showMsgAndGo(i18next.t("message.Insert_Success"), pargs.QueryPrgId); // ╠message.Insert_Success⇒新增成功╣ - } - else { - showMsgAndGo(i18next.t("message.Insert_Success"), pargs.ProgramId, '?Action=Add'); // ╠message.Insert_Success⇒新增成功╣ - } - }; + //getInsertBack: function (pargs, data, flag) { + // var fnCallBack = function () { + // if (flag === 'add') { + // showMsgAndGo(i18next.t("message.Insert_Success"), pargs.QueryPrgId); // ╠message.Insert_Success⇒新增成功╣ + // } + // else { + // showMsgAndGo(i18next.t("message.Insert_Success"), pargs.ProgramId, '?Action=Add'); // ╠message.Insert_Success⇒新增成功╣ + // } + // }; - layer.confirm(i18next.t('message.DefaultPassword').replace('{initpswd}', parent.SysSet['DefaultPassword'] || 123456), { icon: 3, title: i18next.t('common.Tips') }, function (index) { - if (parent.SysSet.IsOpenMail == 'Y') { - fnSendEmailToMember(flag); - } - else { - layer.alert(i18next.t('message.NotOpenMail'), { icon: 0 }, function () {// ╠message.NotOpenMail⇒系統沒有開放郵件發送功能,請聯絡管理員!╣ - fnCallBack(); - }); - } - layer.close(index); - }, function () { - fnCallBack(); - }); - }, + // layer.confirm(i18next.t('message.DefaultPassword').replace('{initpswd}', parent.SysSet['DefaultPassword'] || 123456), { icon: 3, title: i18next.t('common.Tips') }, function (index) { + // if (parent.SysSet.IsOpenMail == 'Y') { + // fnSendEmailToMember(flag); + // } + // else { + // layer.alert(i18next.t('message.NotOpenMail'), { icon: 0 }, function () {// ╠message.NotOpenMail⇒系統沒有開放郵件發送功能,請聯絡管理員!╣ + // fnCallBack(); + // }); + // } + // layer.close(index); + // }, function () { + // fnCallBack(); + // }); + //}, /** * 頁面初始化 * @param {Object} pargs CanDo 對象 diff --git a/EuroTran/WebSite/Web.config b/EuroTran/WebSite/Web.config index e754713..cb6c01e 100644 --- a/EuroTran/WebSite/Web.config +++ b/EuroTran/WebSite/Web.config @@ -24,7 +24,7 @@ - +