/// <summary>
        /// SaveForEdit
        /// </summary>
        public void SaveForEdit()
        {
            foreach (FmViewTDS.FmViewDisplayTempRow rowViewDisplay in (FmViewTDS.FmViewDisplayTempDataTable)Data.Tables["FmViewDisplayTemp"])
            {
                FmViewDisplay fmViewDisplay = new FmViewDisplay(null);

                if (!rowViewDisplay.Deleted && !rowViewDisplay.InDatabase && rowViewDisplay.Selected)
                {
                    fmViewDisplay.InsertDirect(rowViewDisplay.ViewID, rowViewDisplay.FmType, rowViewDisplay.COMPANY_ID, rowViewDisplay.DisplayID, rowViewDisplay.Deleted);
                }

                if (!rowViewDisplay.Deleted && rowViewDisplay.InDatabase && rowViewDisplay.Selected)
                {
                    FmViewDisplayGateway fmViewDisplayGateway = new FmViewDisplayGateway();
                    fmViewDisplayGateway.LoadAllByViewIdFmTypeDisplayId(rowViewDisplay.ViewID, rowViewDisplay.FmType, rowViewDisplay.COMPANY_ID, rowViewDisplay.DisplayID);

                    int originalViewId = rowViewDisplay.ViewID;
                    string originalFmType = rowViewDisplay.FmType;
                    int originalCompanyId = rowViewDisplay.COMPANY_ID;
                    int originalDisplayId = rowViewDisplay.DisplayID;
                    bool originalDeleted = fmViewDisplayGateway.GetDeleted(rowViewDisplay.ViewID, rowViewDisplay.FmType, rowViewDisplay.COMPANY_ID, rowViewDisplay.DisplayID);

                    fmViewDisplay.UpdateDirect(originalViewId, originalFmType, originalCompanyId, originalDisplayId, originalDeleted, rowViewDisplay.ViewID, rowViewDisplay.FmType, rowViewDisplay.COMPANY_ID, rowViewDisplay.DisplayID, rowViewDisplay.Deleted);

                }

                if (rowViewDisplay.Deleted && rowViewDisplay.InDatabase && !rowViewDisplay.Selected)
                {
                    fmViewDisplay.DeleteDirectForEditView(rowViewDisplay.ViewID, rowViewDisplay.FmType, rowViewDisplay.COMPANY_ID, rowViewDisplay.DisplayID);
                }

            }
        }
Esempio n. 2
0
        /// <summary>
        /// GetColumnsToDisplayForViews
        /// </summary>
        /// <param name="viewId">viewId</param>
        /// <param name="fmType">fmType</param>
        /// <param name="companyId">companyId</param>
        /// <returns>columnsToDisplay</returns>
        public string GetColumnsToDisplayForViews(int viewId, string fmType, int companyId)
        {
            FmViewDisplayGateway fmViewDisplayGateway = new FmViewDisplayGateway(Data);
            fmViewDisplayGateway.LoadByViewIdFmType(viewId, fmType, companyId);

            string columnsToDisplay = "";

            foreach (FmViewTDS.LFS_FM_VIEW_DISPLAYRow row in (FmViewTDS.LFS_FM_VIEW_DISPLAYDataTable)Table)
            {
                if ((row.FmType == fmType) && (row.COMPANY_ID == companyId) && (row.ViewID == viewId))
                {
                    FmTypeViewDisplayGateway fmTypeViewDisplayGateway = new FmTypeViewDisplayGateway();
                    fmTypeViewDisplayGateway.LoadByFmTypeDisplayId(fmType, companyId, row.DisplayID);

                    columnsToDisplay = columnsToDisplay + fmTypeViewDisplayGateway.GetName(fmType, companyId, row.DisplayID) + ", ";
                }
            }

            columnsToDisplay = columnsToDisplay.Substring(0, columnsToDisplay.Length - 2);

            return columnsToDisplay;
        }
        /// <summary>
        /// ProcessForEdit
        /// </summary>
        /// <param name="viewId">viewId</param>
        /// <param name="fmType">fmType</param>
        /// <param name="companyId">companyId</param>
        public void ProcessForEdit(int viewId, string fmType, int companyId)
        {
            foreach (FmViewTDS.LFS_FM_TYPE_VIEW_DISPLAYRow rowViewDisplay in (FmViewTDS.LFS_FM_TYPE_VIEW_DISPLAYDataTable)Data.Tables["LFS_FM_TYPE_VIEW_DISPLAY"])
            {
                FmViewDisplay fmViewDisplay = new FmViewDisplay();
                fmViewDisplay.LoadAllByViewIdFmTypeCompanyIdDisplayId(viewId, fmType, companyId, rowViewDisplay.DisplayID);
                FmViewDisplayGateway fmViewDisplayGateway = new FmViewDisplayGateway(fmViewDisplay.Data);

                if (fmViewDisplay.ExistsByViewIDFmTypeCompanyIdDisplayId(viewId, fmType, companyId, rowViewDisplay.DisplayID))
                {
                    if (rowViewDisplay.Selected)
                    {
                        // Set Deleted in 0
                        Insert(viewId, fmType, companyId, rowViewDisplay.DisplayID, true, true, false);
                    }
                    else
                    {
                        // Set Deleted in 1
                        Insert(viewId, fmType, companyId, rowViewDisplay.DisplayID, false, true, true);
                    }
                }
                else
                {
                    if (rowViewDisplay.Selected)
                    {
                        // Insert
                        Insert(viewId, fmType, companyId, rowViewDisplay.DisplayID, true, false, false);
                    }
                }
            }
        }
Esempio n. 4
0
 /// <summary>
 /// DeleteDirectForEditView
 /// </summary>
 /// <param name="viewId">viewId</param>
 /// <param name="fmType">fmType</param>
 /// <param name="companyId">companyId</param>
 /// <param name="displayId">displayid</param>
 public void DeleteDirectForEditView(int viewId, string fmType, int companyId, int displayId)
 {
     FmViewDisplayGateway fmViewDisplayGateway = new FmViewDisplayGateway(null);
     fmViewDisplayGateway.DeleteForEditView(viewId, fmType, companyId, displayId);
 }
Esempio n. 5
0
 /// <summary>
 /// DeleteDirect
 /// </summary>
 /// <param name="viewId">viewId</param>
 /// <param name="companyId">companyId</param>
 public void DeleteDirect(int viewId, int companyId)
 {
     FmViewDisplayGateway fmViewDisplayGateway = new FmViewDisplayGateway(null);
     fmViewDisplayGateway.Delete(viewId, companyId);
 }
Esempio n. 6
0
 /// <summary>
 /// UpdateDirect
 /// </summary>
 /// <param name="originalViewId">originalViewId</param>
 /// <param name="originalFmType">originalFmType</param>
 /// <param name="originalCompanyId">originalCompanyId</param>
 /// <param name="originalDisplayId">originalDisplayid</param>
 /// <param name="originalDeleted">originalDeleted</param>
 /// <param name="newViewId">newViewid</param>
 /// <param name="newFmType">newFmType</param>
 /// <param name="newCompanyId">newCompanyId</param>
 /// <param name="newDisplayId">newDisplayid</param>
 /// <param name="newDeleted">newDeleted</param>
 public void UpdateDirect(int originalViewId, string originalFmType, int originalCompanyId, int originalDisplayId, bool originalDeleted, int newViewId, string newFmType, int newCompanyId, int newDisplayId, bool newDeleted)
 {
     FmViewDisplayGateway fmViewDisplayGateway = new FmViewDisplayGateway(null);
     fmViewDisplayGateway.Update(originalViewId, originalFmType, originalCompanyId, originalDisplayId, originalDeleted, newViewId, newFmType, newCompanyId, newDisplayId, newDeleted);
 }
Esempio n. 7
0
 /// <summary>
 /// LoadByViewIdFmTypeCompanyIdDisplayId
 /// </summary>
 /// <param name="viewId">viewId</param>
 /// <param name="fmType">fmType</param>
 /// <param name="companyId">companyId</param>
 /// <param name="displayId">displayId</param>
 public void LoadByViewIdFmTypeCompanyIdDisplayId(int viewId, string fmType, int companyId, int displayId)
 {
     FmViewDisplayGateway fmViewDisplayGateway = new FmViewDisplayGateway(Data);
     fmViewDisplayGateway.LoadByViewIdFmTypeDisplayId(viewId, fmType, companyId, displayId);
 }
Esempio n. 8
0
 /// <summary>
 /// InsertDirect
 /// </summary>
 /// <param name="viewId">viewId</param>
 /// <param name="fmType">fmType</param>
 /// <param name="companyId">companyId</param>
 /// <param name="displayId">displayId</param>
 /// <param name="deleted">deleted</param>
 public void InsertDirect(int viewId, string fmType, int companyId, int displayId, bool deleted)
 {
     FmViewDisplayGateway fmViewDisplayGateway = new FmViewDisplayGateway(null);
     fmViewDisplayGateway.Insert(viewId, fmType, companyId, displayId, deleted);
 }