示例#1
0
 /// <summary>
 /// InsertDirect
 /// </summary>
 /// <param name="viewId">viewId</param>
 /// <param name="fmType">fmType</param>
 /// <param name="companyId">companyId</param>
 /// <param name="sortId">sortId</param>
 /// <param name="order">order</param>
 /// <param name="deleted">deleted</param>
 public void InsertDirect(int viewId, string fmType, int companyId, int sortId, int order, bool deleted)
 {
     FmViewSortGateway fmViewSortGateway = new FmViewSortGateway(null);
     fmViewSortGateway.Insert(viewId, fmType, sortId, order, deleted, companyId);
 }
示例#2
0
 /// <summary>
 /// DeleteDirect
 /// </summary>
 /// <param name="viewId">viewId</param>
 /// <param name="companyId">companyId</param>
 public void DeleteDirect(int viewId, int companyId)
 {
     FmViewSortGateway fmViewSortGateway = new FmViewSortGateway(null);
     fmViewSortGateway.Delete(viewId, companyId);
 }
示例#3
0
 /// <summary>
 /// DeleteDirectForEditView
 /// </summary>
 /// <param name="viewId">viewId</param>
 /// <param name="fmType">fmType</param>
 /// <param name="companyId">companyId</param>
 /// <param name="sortId">sortId</param>
 public void DeleteDirectForEditView(int viewId, string fmType, int companyId, int sortId)
 {
     FmViewSortGateway fmViewSortGateway = new FmViewSortGateway(null);
     fmViewSortGateway.DeleteForEditView(viewId, fmType, companyId, sortId);
 }
示例#4
0
 /// <summary>
 /// UpdateDirect
 /// </summary>
 /// <param name="originalViewId">originalViewId</param>
 /// <param name="originalFmType">originalFmType</param>
 /// <param name="originalCompanyId">originalCompanyId</param>
 /// <param name="originalSortId">originalSortId</param>
 /// <param name="originalOrder">originalOrder</param>
 /// <param name="originalDeleted">originalDeleted</param>
 /// <param name="newViewId">newViewId</param>
 /// <param name="newFmType">newFmType</param>
 /// <param name="newCompanyId">newCompanyId</param>
 /// <param name="newSortId">newSortId</param>
 /// <param name="newOrder">newOrder</param>
 /// <param name="newDeleted">newDeleted</param>
 public void UpdateDirect(int originalViewId, string originalFmType, int originalCompanyId, int originalSortId, int originalOrder, bool originalDeleted, int newViewId, string newFmType, int newCompanyId, int newSortId, int newOrder, bool newDeleted)
 {
     FmViewSortGateway fmViewSortGateway = new FmViewSortGateway(null);
     fmViewSortGateway.Update(originalViewId, originalFmType, originalCompanyId, originalSortId, originalOrder, originalDeleted, newViewId, newFmType, newCompanyId, newSortId, newOrder, newDeleted);
 }
示例#5
0
 // ////////////////////////////////////////////////////////////////////////
 // PUBLIC METHODS
 //
 /// <summary>
 /// LoadByViewIdFmTypeSortId
 /// </summary>
 /// <param name="viewId">viewId</param>
 /// <param name="fmType">fmType</param>
 /// <param name="companyId">companyId</param>
 /// <param name="sortId">sortId</param>
 public void LoadByViewIdFmTypeSortId(int viewId,string fmType, int companyId, int sortId)
 {
     FmViewSortGateway fmViewSortGateway = new FmViewSortGateway(Data);
     fmViewSortGateway.LoadByViewIdFmTypeSortId(viewId, fmType, companyId, sortId);
 }
        /// <summary>
        /// SaveForEdit
        /// </summary>
        public void SaveForEdit()
        {
            foreach (FmViewTDS.FmViewSortTempRow rowViewSort in (FmViewTDS.FmViewSortTempDataTable)Data.Tables["FmViewSortTemp"])
            {
                FmViewSort fmViewSort = new FmViewSort(null);

                if (!rowViewSort.Deleted && !rowViewSort.InDatabase && rowViewSort.Selected)
                {
                    fmViewSort.InsertDirect(rowViewSort.ViewID, rowViewSort.FmType, rowViewSort.COMPANY_ID, rowViewSort.SortID, rowViewSort.Order_, rowViewSort.Deleted);
                }

                if (!rowViewSort.Deleted && rowViewSort.InDatabase && rowViewSort.Selected)
                {
                    FmViewSortGateway fmViewSortGateway = new FmViewSortGateway();
                    fmViewSortGateway.LoadAllByViewIdFmTypeSortId(rowViewSort.ViewID, rowViewSort.FmType, rowViewSort.COMPANY_ID, rowViewSort.SortID);

                    int originalViewId = rowViewSort.ViewID;
                    string originalFmType = rowViewSort.FmType;
                    int originalCompanyId = rowViewSort.COMPANY_ID;
                    int originalSortId = rowViewSort.SortID;
                    int originalOrder = fmViewSortGateway.GetOrder(rowViewSort.ViewID, rowViewSort.FmType, rowViewSort.COMPANY_ID, rowViewSort.SortID);
                    bool originalDeleted = fmViewSortGateway.GetDeleted(rowViewSort.ViewID, rowViewSort.FmType, rowViewSort.COMPANY_ID, rowViewSort.SortID);

                    fmViewSort.UpdateDirect(originalViewId, originalFmType, originalCompanyId, originalSortId, originalOrder, originalDeleted, rowViewSort.ViewID, rowViewSort.FmType, rowViewSort.COMPANY_ID, rowViewSort.SortID, rowViewSort.Order_, rowViewSort.Deleted);
                }

                if (rowViewSort.Deleted && rowViewSort.InDatabase && !rowViewSort.Selected)
                {
                    fmViewSort.DeleteDirectForEditView(rowViewSort.ViewID, rowViewSort.FmType, rowViewSort.COMPANY_ID, rowViewSort.SortID);
                }
            }
        }
        /// <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_SORTRow rowViewSort in (FmViewTDS.LFS_FM_TYPE_VIEW_SORTDataTable)Data.Tables["LFS_FM_TYPE_VIEW_SORT"])
            {
                FmViewSort fmViewSort = new FmViewSort();
                fmViewSort.LoadAllByViewIdFmTypeSortId(viewId, fmType, companyId, rowViewSort.SortID);
                FmViewSortGateway fmViewSortGateway = new FmViewSortGateway(fmViewSort.Data);

                if (fmViewSort.ExistsByViewIDFmTypeCompanyIdSortId(viewId, fmType, companyId, rowViewSort.SortID))
                {
                    if (rowViewSort.Selected)
                    {
                        Insert(viewId, fmType, companyId, rowViewSort.SortID, rowViewSort.Order_, true, true, false);
                    }
                    else
                    {
                        // delete
                        Insert(viewId, fmType, companyId, rowViewSort.SortID, 0, false, true, true);
                    }
                }
                else
                {
                    if (rowViewSort.Selected)
                    {
                        Insert(viewId, fmType, companyId, rowViewSort.SortID, rowViewSort.Order_, true, false, false);
                    }
                }
            }
        }
        /// <summary>
        /// UpdateForEdit
        /// </summary>
        /// <param name="viewId">viewId</param>
        /// <param name="fmType">fmType</param>
        /// <param name="companyId">companyId</param>
        public void UpdateForEdit(int viewId, string fmType, int companyId)
        {
            foreach (FmViewTDS.LFS_FM_TYPE_VIEW_SORTRow row in (FmViewTDS.LFS_FM_TYPE_VIEW_SORTDataTable)Table)
            {
                if ((row.FmType == fmType) && (row.COMPANY_ID == companyId))
                {
                    FmViewSort fmViewSort = new FmViewSort();
                    fmViewSort.LoadByViewIdFmTypeSortId(viewId, fmType, companyId, row.SortID);
                    FmViewSortGateway fmViewSortGateway = new FmViewSortGateway(fmViewSort.Data);

                    if (fmViewSort.ExistsByViewIDFmTypeCompanyIdSortId(viewId, fmType, companyId, row.SortID))
                    {
                        row.Selected = true;
                        row.Order_ = fmViewSortGateway.GetOrder(viewId, fmType, companyId, row.SortID);
                    }
                    else
                    {
                        row.Selected = false;
                        row.SetOrder_Null();
                    }
                }
            }
        }