/// <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);
                }

            }
        }
Exemplo n.º 2
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 LoadAllByViewIdFmTypeCompanyIdDisplayId(int viewId, string fmType, int companyId, int displayId)
 {
     FmViewDisplayGateway fmViewDisplayGateway = new FmViewDisplayGateway(Data);
     fmViewDisplayGateway.LoadAllByViewIdFmTypeDisplayId(viewId, fmType, companyId, displayId);
 }