Ejemplo n.º 1
0
        public vmNotificationMail GetNotificationMailObject(NotificationEntity model, string message)
        {
            vmNotificationMail obj = new vmNotificationMail();

            try
            {
                using (var db = new ABS.Models.ERP_Entities())
                {
                    // if (model.NextWFUserID==null)
                    obj.nextUser             = db.CmnUsers.Where(x => x.UserID == model.NextWFUserID).FirstOrDefault().UserFullName;
                    obj.companyName          = db.CmnCompanies.Where(x => x.CompanyID == model.LoggedCompanyID).FirstOrDefault().CompanyName;
                    obj.menuName             = db.CmnMenus.Where(x => x.MenuID == model.MenuID).FirstOrDefault().MenuName;
                    obj.customCode           = model.TransactionID.ToString();
                    obj.customCode           = db.CmnWorkFlowTransactions.Where(x => x.UserID == model.NextWFUserID && x.IsDeleted == false && x.StatusID == 1).FirstOrDefault().CustomCode;
                    obj.message              = message;
                    obj.currentUser          = db.CmnUsers.Where(x => x.UserID == model.CreatorID).FirstOrDefault().UserFullName;
                    obj.comments             = model.Comments;
                    obj.nextUserEmailAddress = db.CmnUserAuthentications.Where(x => x.UserID == model.NextWFUserID).FirstOrDefault().LoginEmail;
                }
            }
            catch (Exception ex)
            {
                throw;
            }
            return(obj);
        }
Ejemplo n.º 2
0
        public List <vmNotificationMail> GetNotificationMailObjectListDeclined(NotificationEntity model, string message)
        {
            List <vmNotificationMail> objList = new List <vmNotificationMail>();

            try
            {
                using (var db = new ABS.Models.ERP_Entities())
                {
                    List <CmnWorkFlowTransactionTran> list = new List <CmnWorkFlowTransactionTran>();
                    list = db.CmnWorkFlowTransactionTrans.Where(x => x.TransactionID == model.TransactionID && x.IsActve == true &&
                                                                x.WFMID == model.WorkFlowID && x.IsDeleted == false).ToList();
                    foreach (CmnWorkFlowTransactionTran item in list)
                    {
                        vmNotificationMail obj = new vmNotificationMail();
                        obj.nextUser    = db.CmnUsers.Where(x => x.UserID == item.TUserID).FirstOrDefault().UserFullName;
                        obj.companyName = db.CmnCompanies.Where(x => x.CompanyID == item.CompanyID).FirstOrDefault().CompanyName;
                        obj.menuName    = db.CmnMenus.Where(x => x.MenuID == item.MenuID).FirstOrDefault().MenuName;
                        obj.customCode  = item.CustomCode.ToString();
                        obj.message     = db.CmnWorkFlowTransactionTrans.Where(x => x.TransactionID == item.TransactionID && x.WFMID == item.WFMID &&
                                                                               x.IsDeleted == false && x.Ccomment == "1").FirstOrDefault().Notification;

                        obj.currentUser          = db.CmnUsers.Where(x => x.UserID == item.UserID).FirstOrDefault().UserFullName;
                        obj.comments             = item.Notification;
                        obj.nextUserEmailAddress = db.CmnUserAuthentications.Where(x => x.UserID == item.TUserID).FirstOrDefault().LoginEmail;
                        obj.isApproved           = false;
                        objList.Add(obj);
                    }
                }
            }
            catch (Exception ex)
            {
            }
            return(objList);
        }