Esempio n. 1
0
        public IList <CMNDashboardItemQuicklinkEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression)
        {
            IList <CMNDashboardItemQuicklinkEntity> cMNDashboardItemQuicklinkEntityList = new List <CMNDashboardItemQuicklinkEntity>();

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = CMNDashboardItemQuicklinkEntity.FLD_NAME_DashboardItemQuicklinkID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                cMNDashboardItemQuicklinkEntityList = FCCCMNDashboardItemQuicklink.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(cMNDashboardItemQuicklinkEntityList ?? new List <CMNDashboardItemQuicklinkEntity>());
        }
        private void SaveCMNDashboardItemQuicklinkEntity()
        {
            if (IsValid)
            {
                try
                {
                    CMNDashboardItemQuicklinkEntity cMNDashboardItemQuicklinkEntity = BuildCMNDashboardItemQuicklinkEntity();

                    Int64 result = -1;

                    if (cMNDashboardItemQuicklinkEntity.IsNew)
                    {
                        result = FCCCMNDashboardItemQuicklink.GetFacadeCreate().Add(cMNDashboardItemQuicklinkEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(CMNDashboardItemQuicklinkEntity.FLD_NAME_DashboardItemQuicklinkID, cMNDashboardItemQuicklinkEntity.DashboardItemQuicklinkID.ToString(), SQLMatchType.Equal);
                        result = FCCCMNDashboardItemQuicklink.GetFacadeCreate().Update(cMNDashboardItemQuicklinkEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _DashboardItemQuicklinkID        = 0;
                        _CMNDashboardItemQuicklinkEntity = new CMNDashboardItemQuicklinkEntity();
                        PrepareInitialView();
                        BindCMNDashboardItemQuicklinkList();

                        if (cMNDashboardItemQuicklinkEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Dashboard Item Quicklink Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Dashboard Item Quicklink Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (cMNDashboardItemQuicklinkEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Dashboard Item Quicklink Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Dashboard Item Quicklink Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
        protected void lvCMNDashboardItemQuicklink_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 DashboardItemQuicklinkID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(CMNDashboardItemQuicklinkEntity.FLD_NAME_DashboardItemQuicklinkID, DashboardItemQuicklinkID.ToString(), SQLMatchType.Equal);

                        CMNDashboardItemQuicklinkEntity cMNDashboardItemQuicklinkEntity = new CMNDashboardItemQuicklinkEntity();


                        result = FCCCMNDashboardItemQuicklink.GetFacadeCreate().Delete(cMNDashboardItemQuicklinkEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _DashboardItemQuicklinkID        = 0;
                            _CMNDashboardItemQuicklinkEntity = new CMNDashboardItemQuicklinkEntity();
                            PrepareInitialView();
                            BindCMNDashboardItemQuicklinkList();

                            MiscUtil.ShowMessage(lblMessage, "Dashboard Item Quicklink has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Dashboard Item Quicklink.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
Esempio n. 4
0
        public IList <CMNDashboardItemQuicklinkEntity> GetData()
        {
            IList <CMNDashboardItemQuicklinkEntity> cMNDashboardItemQuicklinkEntityList = new List <CMNDashboardItemQuicklinkEntity>();

            try
            {
                cMNDashboardItemQuicklinkEntityList = FCCCMNDashboardItemQuicklink.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(cMNDashboardItemQuicklinkEntityList ?? new List <CMNDashboardItemQuicklinkEntity>());
        }
Esempio n. 5
0
        protected void lvCMNDashboardItem_ItemDataBound(object sender, ListViewItemEventArgs e)
        {
            if (e.Item.ItemType == ListViewItemType.DataItem)
            {
                ListViewDataItem dataItem = (ListViewDataItem)e.Item;

                CMNDashboardItemEntity ent = (CMNDashboardItemEntity)dataItem.DataItem;

                HyperLink hypImgDashBoardItem = (HyperLink)e.Item.FindControl("hypImgDashBoardItem");
                hypImgDashBoardItem.NavigateUrl = UrlHelper.BuildSecureUrl((String)DataBinder.Eval(e.Item.DataItem, "NavigationUrl"), string.Empty, UrlConstants.OVERVIEW_DASHBOARD_ITEM_ID, ent.DashboardItemID.ToString()).ToString();

                HyperLink hypDashBoardItem = (HyperLink)e.Item.FindControl("hypDashBoardItem");
                hypDashBoardItem.NavigateUrl = UrlHelper.BuildSecureUrl((String)DataBinder.Eval(e.Item.DataItem, "NavigationUrl"), string.Empty, UrlConstants.OVERVIEW_DASHBOARD_ITEM_ID, ent.DashboardItemID.ToString()).ToString();

                ListView lvCMNDashboardItemQuicklink = (ListView)e.Item.FindControl("lvCMNDashboardItemQuicklink");

                String fe = SqlExpressionBuilder.PrepareFilterExpression(CMNDashboardItemQuicklinkEntity.FLD_NAME_DashboardItemID, ent.DashboardItemID.ToString(), SQLMatchType.Equal);
                lvCMNDashboardItemQuicklink.DataSource = FCCCMNDashboardItemQuicklink.GetFacadeCreate().GetIL(null, null, String.Empty, fe, DatabaseOperationType.LoadWithFilterExpression);
                lvCMNDashboardItemQuicklink.DataBind();
            }
        }