Exemplo n.º 1
0
        public List <FollowupModel> GetAllFollowups(APP_ENTITIES entity, int refID)
        {
            List <FollowupModel> lst = new List <FollowupModel>();

            try
            {
                string strRefType = string.Empty;
                switch (entity)
                {
                case APP_ENTITIES.SALES_QUOTATION: strRefType = "Sales Quotation";  break;
                }
                string strSQL = string.Format("EXEC MXD_FOLLOWUPS '{0}',{1}", strRefType, refID);

                lst = _dbContext.Database.SqlQuery <FollowupModel>(strSQL).ToList();
            }
            catch (Exception ex)
            {
                string errMessage = ex.Message;
                if (ex.InnerException != null)
                {
                    errMessage += string.Format("\n{0}", ex.InnerException.Message);
                }
                MessageBox.Show(errMessage, "ServiceFollowUps::GetAllFollowups", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            return(lst);
        }
Exemplo n.º 2
0
 public ctrlAttachments(APP_ENTITIES _entitry)
 {
     _UNIT = new ServiceUOW();
     InitializeComponent();
     this.ENTITY = _entitry;
     Gnostice.Documents.Framework.ActivateLicense("1DD5-DBE6-E25F-15E6-7BFC-5062-64E8-58CE-71B6-CBA3-9ADF-F55A");
 }
Exemplo n.º 3
0
 public frmGridMultiSelect(APP_ENTITIES entity, int sourceEntityID)
 {
     _UOM = new ServiceUOW();
     InitializeComponent();
     _ENTITY          = entity;
     SOURCE_ENTITY_ID = sourceEntityID;
 }
        public List <SelectListItem> GetPastScheduleCallsFor(APP_ENTITIES entity, int entityID)
        {
            List <SelectListItem> lstCalls = new List <SelectListItem>();

            try
            {
                int STATUS = CALL_STATUS_CLOSE_ID;
                List <TBL_MP_CRM_ScheduleCallLog> callLogs = (
                    from xx in _dbContext.TBL_MP_CRM_ScheduleCallLog
                    where xx.EntityType == (int)entity && xx.EntityID == entityID && xx.ScheduleStatus == STATUS
                    orderby xx.CreatedDatetime descending
                    select xx

                    ).ToList();
                List <SelectListItem> actions = (new ServiceMASTERS(_dbContext)).GetAllScheduleCallActions();
                foreach (TBL_MP_CRM_ScheduleCallLog log in callLogs)
                {
                    SelectListItem item = new SelectListItem()
                    {
                        ID = log.ScheduleID
                    };
                    item.Description = string.Format("{0} - {1}\n{2}\nInbetween {3} - {4}",
                                                     actions.Where(x => x.ID == log.ActionID).FirstOrDefault().Description,
                                                     log.Subject, log.CustomerName, log.StartAt.Value.ToString("ddMMMyy hh:mmtt"), log.EndsAt.Value.ToString("ddMMMyy hh:mmtt"));

                    lstCalls.Add(item);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "GetActiveScheduleCallsFor", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            return(lstCalls);
        }
Exemplo n.º 5
0
 public ctrlDocumentViewer(APP_ENTITIES entity, int entityID)
 {
     _UOM = new ServiceUOW();
     InitializeComponent();
     this.EntityType     = entity;
     this.EntityID       = entityID;
     btnDownload.Enabled = btnEmail.Enabled = ComponentFactory.Krypton.Toolkit.ButtonEnabled.False;
 }
Exemplo n.º 6
0
 public ctrlDocumentViewer(string fileName, APP_ENTITIES entity, int entityID, int attachmentID)
 {
     _UOM = new ServiceUOW();
     InitializeComponent();
     this.FileName       = fileName;
     this.AttachmentID   = attachmentID;
     this.EntityType     = entity;
     this.EntityID       = entityID;
     btnDownload.Enabled = btnEmail.Enabled = ComponentFactory.Krypton.Toolkit.ButtonEnabled.False;
 }
        public List <SelectListItem> GetActiveScheduleCallsFor(APP_ENTITIES entity, int entityID)
        {
            List <SelectListItem> lstCalls = new List <SelectListItem>();

            try
            {
                int Status = _dbContext.APP_DEFAULTS.Where(x => x.ID == (int)APP_DEFAULT_VALUES.ScheduleCallStatusInProgress).FirstOrDefault().DEFAULT_VALUE;
                List <TBL_MP_CRM_ScheduleCallLog> callLogs = (
                    from xx in _dbContext.TBL_MP_CRM_ScheduleCallLog
                    where xx.EntityType == (int)entity && xx.EntityID == entityID && xx.ScheduleStatus == Status && xx.IsDeleted == false
                    orderby xx.CreatedDatetime descending
                    select xx

                    ).ToList();
                callLogs = callLogs.OrderByDescending(x => x.Priority).ToList();
                List <SelectListItem> actions    = (new ServiceMASTERS(_dbContext)).GetAllScheduleCallActions();
                List <SelectListItem> priorities = (new ServiceMASTERS(_dbContext)).GetAllScheduleCallPriorities();
                foreach (TBL_MP_CRM_ScheduleCallLog log in callLogs)
                {
                    SelectListItem item = new SelectListItem()
                    {
                        ID = log.ScheduleID
                    };
                    string strDescription = string.Empty;
                    if (log.ActionID != null)
                    {
                        strDescription = string.Format("{0}", actions.Where(x => x.ID == log.ActionID).FirstOrDefault().Description);
                    }
                    if (log.Priority != null)
                    {
                        strDescription = string.Format("  ({0})", priorities.Where(x => x.ID == log.Priority).FirstOrDefault().Description);
                    }

                    strDescription += string.Format("\n{0}\n{1}", log.Subject.ToUpper(), log.CustomerName);
                    strDescription += string.Format("\nInbetween {0} - {1}", log.StartAt.Value.ToString("ddMMMyy hh:mmtt"), log.EndsAt.Value.ToString("ddMMMyy hh:mmtt"));
                    strDescription += string.Format("\n\nCreated: {0}", log.CreatedDatetime.Value.ToString("ddMMMyy hh:mmtt"));
                    if (log.ModifiedDatetime != null)
                    {
                        strDescription += string.Format("\nModified: {0}", log.ModifiedDatetime.Value.ToString("ddMMMyy hh:mmtt"));
                    }

                    item.Description = strDescription;
                    lstCalls.Add(item);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.InnerException.Message, "ServiceScheduleCallLog::GetActiveScheduleCallsFor", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            return(lstCalls);
        }
Exemplo n.º 8
0
        public frmEntityInfo(APP_ENTITIES enumEntity, int entityID)
        {
            ENTITY         = enumEntity;
            this.ENTITY_ID = entityID;
            InitializeComponent();

            this.Cursor = Cursors.WaitCursor;
            switch (ENTITY)
            {
            case APP_ENTITIES.INVENTORY_ITEM:
                PopulateInventoryItemInfo();
                break;
            }
            this.Cursor = Cursors.Default;
        }
Exemplo n.º 9
0
 public frmDelete(APP_ENTITIES entity, int ID)
 {
     InitializeComponent();
     this.ENTITY    = entity;
     this.ENTITY_ID = ID;
 }
Exemplo n.º 10
0
 public ctrlSuspectInfo(APP_ENTITIES currEntity)
 {
     InitializeComponent();
     this.ENTITY = currEntity;
 }
Exemplo n.º 11
0
 public List <TBL_MP_CRM_SM_DocumentHistory> GetDocumentHistory(int attachmentID, APP_ENTITIES entity)
 {
     return(_dbContext.TBL_MP_CRM_SM_DocumentHistory
            .Where(x => x.AttachmentID == attachmentID)
            .Where(x => x.EntityType == (int)entity)
            .OrderByDescending(x => x.CreateDatetime)
            .ToList());
 }
Exemplo n.º 12
0
 public ctrlAssociates(APP_ENTITIES EntityToAssociate)
 {
     _UOM = new ServiceUOW();
     InitializeComponent();
     this.ENTITY = EntityToAssociate;
 }
Exemplo n.º 13
0
 public ctrlScheduleCallLog(APP_ENTITIES entity)
 {
     InitializeComponent();
     this.SOURCE_ENTITY = entity;
 }
Exemplo n.º 14
0
        public int GenerateNotificationFor(APP_ENTITIES entity, int selectedID, int empID, string titleText, string bodyText)
        {
            int newNotificationID = 0;

            try
            {
                string notificationURL   = string.Empty;
                string notificationTitle = string.Empty;
                string notificatrionBody = string.Empty;
                int    notificationType  = 0;
                switch (entity)
                {
                case APP_ENTITIES.SALES_LEAD:
                    TBL_MP_CRM_SM_SalesLead lead = _dbContext.TBL_MP_CRM_SM_SalesLead.Where(x => x.PK_SalesLeadID == selectedID).FirstOrDefault();
                    if (lead != null)
                    {
                        notificationTitle = titleText;
                        notificatrionBody = bodyText;
                        notificationURL   = string.Format("../CRM/FrmMP_CRM_SM_SalesLead_AddEdit.aspx?LID={0}", selectedID);
                        notificationType  = (int)NOTIFICATION_CATEGORIES.NOTIFICATION_CRM;
                    }
                    break;

                case APP_ENTITIES.SALES_ENQUIRY:
                    TBL_MP_CRM_SM_SalesLead enquiry = _dbContext.TBL_MP_CRM_SM_SalesLead.Where(x => x.PK_SalesLeadID == selectedID).FirstOrDefault();
                    if (enquiry != null)
                    {
                        notificationTitle = titleText;
                        notificatrionBody = bodyText;
                        notificationURL   = string.Format("../CRM/FrmMP_CRM_SM_SalesLead_AddEdit.aspx?LID={0}", selectedID);
                        notificationType  = (int)NOTIFICATION_CATEGORIES.NOTIFICATION_CRM;
                    }
                    break;

                case APP_ENTITIES.SALES_QUOTATION:
                    TBL_MP_CRM_SM_SalesLead quotation = _dbContext.TBL_MP_CRM_SM_SalesLead.Where(x => x.PK_SalesLeadID == selectedID).FirstOrDefault();
                    if (quotation != null)
                    {
                        notificationTitle = titleText;
                        notificatrionBody = bodyText;
                        notificationType  = (int)NOTIFICATION_CATEGORIES.NOTIFICATION_CRM;
                    }
                    break;

                case APP_ENTITIES.SALES_ORDER:
                    TBL_MP_CRM_SM_SalesLead order = _dbContext.TBL_MP_CRM_SM_SalesLead.Where(x => x.PK_SalesLeadID == selectedID).FirstOrDefault();
                    if (order != null)
                    {
                        notificationTitle = titleText;
                        notificatrionBody = bodyText;
                        notificationType  = (int)NOTIFICATION_CATEGORIES.NOTIFICATION_CRM;
                    }
                    break;
                }
                //insert this notification in notification table
                TBL_MP_COMMON_Notification model = new TBL_MP_COMMON_Notification();
                model.NotificationTitle = notificationTitle;
                model.NotificationBody  = notificatrionBody;
                model.FK_EMPLOYEEID     = empID;
                model.URL = notificationURL;
                model.FK_NotificationType = notificationType;

                _dbContext.TBL_MP_COMMON_Notification.Add(model);
                _dbContext.SaveChanges();

                newNotificationID = model.PK_NotificationID;
            }
            catch (Exception ex)
            {
                string errMessage = ex.Message;
                if (ex.InnerException != null)
                {
                    errMessage += string.Format("\n{0}", ex.InnerException.Message);
                }
                MessageBox.Show(errMessage, "", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }

            return(newNotificationID);
        }
Exemplo n.º 15
0
 public frmGridMultiSelect(APP_ENTITIES entity)
 {
     _UOM = new ServiceUOW();
     InitializeComponent();
     _ENTITY = entity;
 }
Exemplo n.º 16
0
 public ctrlTermsAndCondition(APP_ENTITIES currEntity)
 {
     InitializeComponent();
     this.ENTITY = currEntity;
 }
Exemplo n.º 17
0
 public ctrlScheduler(APP_ENTITIES currentEntity)
 {
     InitializeComponent();
     this.ENTITY = currentEntity;
 }