Ejemplo n.º 1
0
        public IList <CMNEventInvitationInformationEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression)
        {
            IList <CMNEventInvitationInformationEntity> cMNEventInvitationInformationEntityList = new List <CMNEventInvitationInformationEntity>();

            try
            {
                if (pageSize == -1)
                {
                    pageSize = 1000000000;
                }

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = CMNEventInvitationInformationEntity.FLD_NAME_EventInvitationInformationID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

                startRowIndex = Convert.ToInt32(startRowIndex / pageSize) + 1;

                cMNEventInvitationInformationEntityList = FCCCMNEventInvitationInformation.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

                if (cMNEventInvitationInformationEntityList != null && cMNEventInvitationInformationEntityList.Count > 0)
                {
                    totalRowCount = cMNEventInvitationInformationEntityList[0].TotalRowCount;
                }
            }
            catch (Exception ex)
            {
            }

            return(cMNEventInvitationInformationEntityList ?? new List <CMNEventInvitationInformationEntity>());
        }
Ejemplo n.º 2
0
        private void SaveCMNEventInvitationInformationEntity()
        {
            if (IsValid)
            {
                try
                {
                    CMNEventInvitationInformationEntity cMNEventInvitationInformationEntity = BuildCMNEventInvitationInformationEntity();

                    Int64 result = -1;

                    if (cMNEventInvitationInformationEntity.IsNew)
                    {
                        result = FCCCMNEventInvitationInformation.GetFacadeCreate().Add(cMNEventInvitationInformationEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(CMNEventInvitationInformationEntity.FLD_NAME_EventInvitationInformationID, cMNEventInvitationInformationEntity.EventInvitationInformationID.ToString(), SQLMatchType.Equal);
                        result = FCCCMNEventInvitationInformation.GetFacadeCreate().Update(cMNEventInvitationInformationEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _EventInvitationInformationID        = 0;
                        _CMNEventInvitationInformationEntity = new CMNEventInvitationInformationEntity();
                        PrepareInitialView();
                        BindCMNEventInvitationInformationList();

                        if (cMNEventInvitationInformationEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Event Invitation Information Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Event Invitation Information Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (cMNEventInvitationInformationEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Event Invitation Information Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Event Invitation Information Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
Ejemplo n.º 3
0
        protected void lvCMNEventInvitationInformation_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 EventInvitationInformationID;

            Int64.TryParse(e.CommandArgument.ToString(), out EventInvitationInformationID);

            if (EventInvitationInformationID > 0)
            {
                if (string.Equals(e.CommandName, "EditItem"))
                {
                    _EventInvitationInformationID = EventInvitationInformationID;

                    PrepareEditView();
                }
                else if (string.Equals(e.CommandName, "DeleteItem"))
                {
                    try
                    {
                        Int64 result = -1;

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(CMNEventInvitationInformationEntity.FLD_NAME_EventInvitationInformationID, EventInvitationInformationID.ToString(), SQLMatchType.Equal);

                        CMNEventInvitationInformationEntity cMNEventInvitationInformationEntity = new CMNEventInvitationInformationEntity();


                        result = FCCCMNEventInvitationInformation.GetFacadeCreate().Delete(cMNEventInvitationInformationEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _EventInvitationInformationID        = 0;
                            _CMNEventInvitationInformationEntity = new CMNEventInvitationInformationEntity();
                            PrepareInitialView();
                            BindCMNEventInvitationInformationList();

                            MiscUtil.ShowMessage(lblMessage, "Event Invitation Information has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Event Invitation Information.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
Ejemplo n.º 4
0
        public IList <CMNEventInvitationInformationEntity> GetData()
        {
            IList <CMNEventInvitationInformationEntity> cMNEventInvitationInformationEntityList = new List <CMNEventInvitationInformationEntity>();

            try
            {
                cMNEventInvitationInformationEntityList = FCCCMNEventInvitationInformation.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

                if (cMNEventInvitationInformationEntityList != null && cMNEventInvitationInformationEntityList.Count > 0)
                {
                    totalRowCount = cMNEventInvitationInformationEntityList[0].TotalRowCount;
                }
            }
            catch (Exception ex)
            {
            }

            return(cMNEventInvitationInformationEntityList ?? new List <CMNEventInvitationInformationEntity>());
        }
Ejemplo n.º 5
0
        protected void odsCMNEvent_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
        {
            String fe1 = SqlExpressionBuilder.PrepareFilterExpression(CMNEventEntity.FLD_NAME_EventIdentityCategoryID, OverviewEventIdentityCategoryID.ToString(), SQLMatchType.Equal);
            String fe2 = SqlExpressionBuilder.PrepareFilterExpression(CMNEventEntity.FLD_NAME_CreatedByMemberID, CurrentMember.MemberID.ToString(), SQLMatchType.Equal);
            String fe  = SqlExpressionBuilder.PrepareFilterExpression(fe1, SQLJoinType.AND, fe2);

            String fe_invitation = SqlExpressionBuilder.PrepareFilterExpression(CMNEventInvitationInformationEntity.FLD_NAME_InitationGivenToMemberID, CurrentMember.MemberID.ToString(), SQLMatchType.Equal);
            IList <CMNEventInvitationInformationEntity> lstCMNEventInvitationInformationEntity = FCCCMNEventInvitationInformation.GetFacadeCreate().GetIL(null, null, String.Empty, fe_invitation, DatabaseOperationType.LoadWithFilterExpression);

            if (lstCMNEventInvitationInformationEntity != null && lstCMNEventInvitationInformationEntity.Count > 0)
            {
                String compositeEventID = String.Empty;

                foreach (CMNEventInvitationInformationEntity ent in lstCMNEventInvitationInformationEntity)
                {
                    compositeEventID += ent.EventID + ",";
                }
                compositeEventID = compositeEventID.Substring(0, compositeEventID.Length - 1);

                String fe_compsite = "EventID In(" + compositeEventID + ")";

                fe = SqlExpressionBuilder.PrepareFilterExpression(fe, SQLJoinType.AND, fe_compsite);
            }

            if (chbxFilter.Checked)
            {
                String fe3 = SqlExpressionBuilder.PrepareFilterExpression(CMNEventEntity.FLD_NAME_Title, txtSearchText.Text.ToString(), SQLMatchType.LikeWithBothMath);
                String fe4 = SqlExpressionBuilder.PrepareFilterExpression(CMNEventEntity.FLD_NAME_EventReferenceNo, txtSearchText.Text.ToString(), SQLMatchType.LikeWithBothMath);
                String fe5 = SqlExpressionBuilder.PrepareFilterExpression(fe3, SQLJoinType.OR, fe4);
                fe = SqlExpressionBuilder.PrepareFilterExpression(fe, SQLJoinType.AND, fe5);
            }

            e.InputParameters["filterExpression"] = fe;
        }
Ejemplo n.º 6
0
        protected void btnSendMailToGuest_Click(object sender, EventArgs e)
        {
            //Mail will implement here.

            #region Guest Invitation Mail

            CMNEventEntity cMNEventEntity = FCCCMNEvent.GetFacadeCreate().GetByID(OverviewEventID);

            String MailBody = String.Empty;
            String Subject  = String.Empty;

            StringBuilder sb = new StringBuilder();

            sb.Append("Dear Sir,");
            sb.Append("<br/>");
            sb.Append("This is a auto generated mail from the ERP.");
            sb.Append("<br/>");
            sb.Append("An Event has created.");
            sb.Append("<br/>");
            sb.Append("Dated : " + cMNEventEntity.ExpectedStartDate.ToString(UIConstants.SHORT_DATE_FORMAT));
            sb.Append("<br/>");
            sb.Append("-");
            sb.Append("<br/>");
            sb.Append("Thanks");
            sb.Append("<br/>");
            sb.Append("ERP System");
            MailBody = sb.ToString();
            Subject  = "ERP, Event";

            String fe1 = SqlExpressionBuilder.PrepareFilterExpression(CMNEventInvitationInformationEntity.FLD_NAME_EventID, OverviewEventID.ToString(), SQLMatchType.Equal);
            String fe2 = SqlExpressionBuilder.PrepareFilterExpression(CMNEventInvitationInformationEntity.FLD_NAME_EventInvitatedPersonTypeID, MasterDataConstants.EventInvitationPersonType.GUEST.ToString(), SQLMatchType.Equal);
            String fe  = SqlExpressionBuilder.PrepareFilterExpression(fe1, SQLJoinType.AND, fe2);

            IList <CMNEventInvitationInformationEntity> lstEventInvitationInformationEntity = FCCCMNEventInvitationInformation.GetFacadeCreate().GetIL(null, null, String.Empty, fe, DatabaseOperationType.LoadWithFilterExpression);

            if (lstEventInvitationInformationEntity != null && lstEventInvitationInformationEntity.Count > 0)
            {
                String[] sendToMail = new String[10]; // Should change here.
                Int64    i          = 0;

                foreach (CMNEventInvitationInformationEntity ent in lstEventInvitationInformationEntity)
                {
                    HRMemberEntity hRMemberEntity = FCCHRMember.GetFacadeCreate().GetByID(ent.InitationGivenToMemberID);

                    if (hRMemberEntity != null && hRMemberEntity.MemberID > 0)
                    {
                        switch (hRMemberEntity.MemberTypeID)
                        {
                        case MasterDataConstants.MemberType.HR_MEMBER:

                            String fe_member = SqlExpressionBuilder.PrepareFilterExpression(HREmployeeEntity.FLD_NAME_MemberID, ent.InitationGivenToMemberID.ToString(), SQLMatchType.Equal);
                            IList <HREmployeeEntity> lsthREmployeeEntity = FCCHREmployee.GetFacadeCreate().GetIL(null, null, String.Empty, fe_member, DatabaseOperationType.LoadWithFilterExpression);

                            if (lsthREmployeeEntity != null && lsthREmployeeEntity.Count > 0)
                            {
                                sendToMail[i++] = lsthREmployeeEntity[0].PrimaryEmail;
                            }
                            break;

                        //Will Implement Later on...
                        case MasterDataConstants.MemberType.CONSULATANT:
                            break;
                            //case MasterDataConstants.MemberType.CONSULATANT:
                            //    break;
                        }
                    }
                }

                MiscUtil.SendMail(sendToMail, Subject, MailBody);
            }

            #endregion
        }