public BaseRepository()
 {
     DataLibrary = new DataLibrary {
         ApplicationName = ConfigurationManager.AppSettings["ApplicationName"]
     };
     DataLibrary.SetConnection(ConfigurationManager.ConnectionStrings["MobileDBConnection"].ConnectionString);
 }
    private void MakeGenerals()
    {
        GameObject generalPrefab = DataLibrary.GetCreatureFromName("General");

        CombatManager.SpawnPermanent(generalPrefab, Owner.PLAYER, new MapPosition(0, 2));
        CombatManager.SpawnPermanent(generalPrefab, Owner.ENEMY, new MapPosition(13, 2));
    }
 /// <summary>
 /// Get User Details
 /// </summary>
 /// <param name="userId">User Id</param>
 /// <returns>Data set</returns>
 public DataSet GetUserDetails(string userId)
 {
     object[] objUserDetails = new object[2];
     objUserDetails[0] = userId;
     objUserDetails[1] = userSession.CompanyId;
     return(DataLibrary.ExecuteDataSet(ref objUserDetails, "bspGetUserDetailsForFriendInvitation"));
 }
 /// <summary>
 /// Create USer Group
 /// </summary>
 /// <param name="userId">User Id</param>
 /// <param name="groupName">Group Name</param>
 public void CreateUserGroup(string userId, string groupName)
 {
     object[] objCreateGroup = new object[2];
     objCreateGroup[0] = userId;
     objCreateGroup[1] = groupName;
     DataLibrary.ExecuteQuery(ref objCreateGroup, "bspAddApplicationUserGroup");
 }
Beispiel #5
0
 /// <summary>
 /// Get all available budgets in the application
 /// </summary>
 /// <param name="userId">User ID</param>
 /// <returns>Set of available budgets </returns>
 public DataSet GetAvailableBudgets(string userId)
 {
     object[] objUserCredentials = new object[2];
     objUserCredentials[0] = userId;
     objUserCredentials[1] = userSession.CompanyId;
     return(DataLibrary.ExecuteDataSet(ref objUserCredentials, "bspViewBudget"));
 }
 /// <summary>
 /// Check group already exists
 /// </summary>
 /// <param name="groupName">Group Name</param>
 /// <returns>True if exists else false</returns>
 public bool CheckGroupAlreadyExists(string groupName)
 {
     object[] objCheckGroup = new object[2];
     objCheckGroup[0] = groupName;
     objCheckGroup[1] = userSession.CompanyId;
     return(DataLibrary.ExecuteReaderSql(ref objCheckGroup, "bspCheckGroupAlreadyExists").HasRows);
 }
Beispiel #7
0
 /// <summary>
 /// Check is budget already exists
 /// </summary>
 /// <param name="BudgetName"></param>
 /// <returns>true if exists else false</returns>
 public bool CheckBudgetExists(string budgetName)
 {
     object[] objBudgetCheck = new object[2];
     objBudgetCheck[0] = budgetName;
     objBudgetCheck[1] = userSession.CompanyId;
     return(DataLibrary.ExecuteReaderSql(ref objBudgetCheck, "bspCheckBudgetAlreadyExists").HasRows);
 }
Beispiel #8
0
 /// <summary>
 /// Check budget category exists
 /// </summary>
 /// <returns>Boolean</returns>
 public bool CheckCategoryExists(string categoryName)
 {
     object[] objCategoryCheck = new object[2];
     objCategoryCheck[0] = categoryName;
     objCategoryCheck[1] = userSession.CompanyId;
     return(DataLibrary.ExecuteReaderSql(ref objCategoryCheck, "bspCheckCategoryExists").HasRows);
 }
        private void InitializeProfile()
        {
            if (!Directory.Exists(Helper.Configuration.AppDataFolderFullPath))
            {
                Directory.CreateDirectory(Helper.Configuration.AppDataFolderFullPath);

                if (Directory.Exists(Helper.Configuration.DefaultFolderFullPath))
                {
                    foreach (var file in Directory.GetFiles(Helper.Configuration.DefaultFolderFullPath))
                    {
                        File.Copy(file, Path.Combine(Helper.Configuration.AppDataFolderFullPath, Path.GetFileName(file)));
                    }
                }
                else
                {
                    const string message = " We are unable to load your radio collection \n And We are unable to load the default collection \n You will have to create your radio station list from scratch.";
                    MessageBox.Show(message, "Error Initializing default data", MessageBoxButton.OK);
                    this.profile = new Profile();
                }
            }

            DataLibrary dataLibrary = new DataLibrary(Helper.Configuration.AppDataJSONFullPath);

            this.profile = dataLibrary.LoadProfile();
        }
Beispiel #10
0
        internal static ITargetDevice CreateTvDevice(DeviceInfo deviceInfo, IPlayerNotificationProvider playerNotification, IBaseDispatcher dispatcher, ISecondTvSecurityProvider securityProvider)
        {
            if (deviceInfo == null)
            {
                throw new ArgumentNullException("deviceInfo");
            }
            if (playerNotification == null)
            {
            }
            if (dispatcher == null)
            {
                Console.WriteLine("Dispatcher is null");
            }
            //Dispatcher backgroundSerialQeueue = new Dispatcher;
            SecondTvSyncTransport  secondTvSyncTransport  = new SecondTvSyncTransport(securityProvider);
            SecondTvAsyncTransport secondTvAsyncTransport = new SecondTvAsyncTransport(securityProvider);

            secondTvSyncTransport.Connect(deviceInfo.DeviceAddress);
            secondTvAsyncTransport.Connect(deviceInfo.DeviceAddress);
            SecondTv            secondTv            = new SecondTv(secondTvSyncTransport, deviceInfo.LocalAddress);
            SecondTvRemoteInput secondTvRemoteInput = new SecondTvRemoteInput(secondTvAsyncTransport, deviceInfo.LocalAddress);

            secondTvRemoteInput.Connect(secondTvSyncTransport);
            MbrKeySender         mbrKeySender         = new MbrKeySender(secondTvSyncTransport, deviceInfo.LocalAddress);
            RemoteControlFactory remoteControlFactory = new RemoteControlFactory(secondTvRemoteInput, mbrKeySender);

            HttpServer            _https = new HttpServer();
            MultiScreenController _msc   = new MultiScreenController();
            DlnaServer            _dlnas = new DlnaServer();
            DataLibrary           _dl    = new DataLibrary(_dispatcher);

            return(new TvDevice(deviceInfo, secondTv, playerNotification, secondTvRemoteInput, remoteControlFactory, dispatcher, _https, _msc, _dlnas, _dl));
        }
Beispiel #11
0
 void Start()
 {
     foreach (string eff in StartEffects)
     {
         IEffect effect = DataLibrary.GetEffect(eff);
         AddEffect(effect);
     }
 }
 /// <summary>
 /// Get Users by user name
 /// </summary>
 /// <param name="userName">User Name</param>
 /// <param name="loggedInUserId">Logged In User Id</param>
 /// <returns>Dataset</returns>
 public DataSet GetUsers(string userName, string loggedInUserId)
 {
     object[] objGetUsersByUserName = new object[3];
     objGetUsersByUserName[0] = userName;
     objGetUsersByUserName[1] = loggedInUserId;
     objGetUsersByUserName[2] = userSession.CompanyId;
     return(DataLibrary.ExecuteDataSet(ref objGetUsersByUserName, "bspGetUsersByUserName"));
 }
 /// <summary>
 /// Accept Invitation
 /// </summary>
 /// <param name="companyId">Company Id to join</param>
 /// <param name="invitationType">Invitation type to process</param>
 public void AcceptInvitation(string userId, long?companyId, string invitationType)
 {
     object[] objFriendInvitation = new object[3];
     objFriendInvitation[0] = companyId;
     objFriendInvitation[1] = userId;
     objFriendInvitation[2] = invitationType;
     DataLibrary.ExecuteQuery(ref objFriendInvitation, "bspAcceptInvitation");
 }
Beispiel #14
0
 /// <summary>
 /// Get transaction lookup data
 /// </summary>
 /// <param name="lookupType">Lookup type</param>
 /// <param name="lookupCondition">Look up condition</param>
 /// <returns></returns>
 public DataSet GetTransactionLookUpData(char lookupType, string lookupCondition)
 {
     object[] expenseDetails = new object[3];
     expenseDetails[0] = lookupType;
     expenseDetails[1] = lookupCondition;
     expenseDetails[2] = userSession.CompanyId;
     return(DataLibrary.ExecuteDataSet(ref expenseDetails, "bspGetTransactionLookUpData"));
 }
Beispiel #15
0
    public CreatureCard(String name, String description)
    {
        cardType = CardType.Creature;

        Name                = name;
        Description         = description;
        AssociatedPermanent = DataLibrary.GetCreatureFromName(Name);
    }
Beispiel #16
0
 /// <summary>
 /// Get the account settings data
 /// </summary>
 /// <param name="userId">Logged In User Id</param>
 /// <param name="companyId">Users company</param>
 /// <returns>Data set</returns>
 public DataSet GetAccountSettingsData(string userId, long?companyId)
 {
     companyId = userSession.CompanyId;
     object[] objAccountInputParameter = new object[2];
     objAccountInputParameter[0] = userId;
     objAccountInputParameter[1] = companyId;
     return(DataLibrary.ExecuteDataSet(ref objAccountInputParameter, "bspGetAccountSettingsData"));
 }
Beispiel #17
0
 /// <summary>
 /// Delete selected component record
 /// </summary>
 /// <param name="recordId">Record Unique ID</param>
 /// <param name="componentType">Component Type</param>
 public void deleteSelectedComponentRecord(string recordId, char componentType)
 {
     object[] objComponentParameters = new object[3];
     objComponentParameters[0] = recordId;
     objComponentParameters[1] = componentType;
     objComponentParameters[2] = userSession.CompanyId;
     DataLibrary.ExecuteQuery(ref objComponentParameters, "bspDeleteRecordOfSelectedComponent");
 }
Beispiel #18
0
        public async Task<DataLibrary.DocumentmarkupDTO> SaveDocumentmarkupWithMarkupImage(DataLibrary.DocumentmarkupDTO documentmarkup, DataLibrary.UpfileDTOS upFileCollection)
        {
            Dictionary<string, dynamic> dParams = new Dictionary<string, dynamic>();
            dParams.Add("documentmarkup", documentmarkup);
            dParams.Add("upFileCollection", upFileCollection);

            return await JsonHelper.PutDataAsync<DataLibrary.DocumentmarkupDTO>("JsonSaveDocumentmarkupWithMarkupImage", dParams, JsonHelper.ProjectService);
        }
        /// <summary>
        /// Get User group Details by Userid
        /// </summary>
        /// <returns>User Group Data</returns>
        public DataSet GetUserGroups()
        {
            object[] objUserGroup = new object[1];
            objUserGroup[0] = userSession.CompanyId;
            DataSet userPermissionDataSet = DataLibrary.ExecuteDataSet(ref objUserGroup, "bspGetUSerGroup");

            return(userPermissionDataSet);
        }
Beispiel #20
0
 /// <summary>
 /// To add the Budget category to the application
 /// </summary>
 /// <returns>True if success else false</returns>
 public bool AddBudgetCategory(string categoryName, string createdBy)
 {
     object[] objAddBudgetCategoryParameters = new object[3];
     objAddBudgetCategoryParameters[0] = categoryName;
     objAddBudgetCategoryParameters[1] = createdBy;
     objAddBudgetCategoryParameters[2] = userSession.CompanyId;
     return(DataLibrary.ExecuteQuery(ref objAddBudgetCategoryParameters, "bspCreateBudgetCategory") == -1 ? true : false);
 }
        /// <summary>
        /// Get the list of application users
        /// </summary>
        /// <returns>Dataset</returns>
        public DataSet GetAllApplicationUsers()
        {
            object[] objUserParameter = new object[1];
            objUserParameter[0] = userSession.CompanyId;
            DataSet userPermissionDataSet = DataLibrary.ExecuteDataSet(ref objUserParameter, "bspGetApplicationUsers");

            return(userPermissionDataSet);
        }
        private void SpawnZombie(MapPosition position)
        {
            GameObject zombiePrefab = DataLibrary.GetCreatureFromName("Zombie Husk");

            if (CombatManager.CanSpawn(zombiePrefab, TurnManager.CurrentPlayer, position))
            {
                CombatManager.SpawnPermanent(zombiePrefab, TurnManager.CurrentPlayer, position);
            }
        }
 /// <summary>
 /// To add the user group to the application
 /// </summary>
 /// <returns>True if success else false</returns>
 public bool AddUserGroup(string userId, string groupName, string selectedUsers)
 {
     object[] objAddUserGroup = new object[4];
     objAddUserGroup[0] = userId;
     objAddUserGroup[1] = groupName;
     objAddUserGroup[2] = selectedUsers;
     objAddUserGroup[3] = userSession.CompanyId;
     return(DataLibrary.ExecuteQuery(ref objAddUserGroup, "bspCreateUserGroup") > 0 ? true : false);
 }
    private void Awake()
    {
        DataLibrary.Insert(AssetLibrary.GetTextByPath("Configs/Resources.json").text);

        _network   = new GameNetworkMock();
        _model     = new GameModel(_network);
        _presenter = new GamePresenter(_model);
        _presenter.Attach(_view);
    }
Beispiel #25
0
 /// <summary>
 /// Update the user permission for the selected screen
 /// </summary>
 /// <param name="screenId">Screen Id</param>
 /// <param name="actionType">Action Type (R-Read, W-Write, D-Delete)</param>
 /// <param name="isPermitted">Is allowed</param>
 public void UpdateScreenPermission(int screenId, char actionType, int isPermitted, string userId)
 {
     object[] objUserPermission = new object[5];
     objUserPermission[0] = screenId;
     objUserPermission[1] = actionType;
     objUserPermission[2] = isPermitted;
     objUserPermission[3] = userId;
     objUserPermission[4] = userSession.CompanyId;
     DataLibrary.ExecuteQuery(ref objUserPermission, "bspUpdateUserPermission");
 }
Beispiel #26
0
        /// <summary>
        /// Get the required data for the user permisssion screen
        /// </summary>
        /// <returns>Dataset</returns>
        public DataSet GetUserPermissions(string sessionId, bool showUserList = false)
        {
            object[] objUserPermissions = new object[3];
            objUserPermissions[0] = sessionId;
            objUserPermissions[1] = showUserList;
            objUserPermissions[2] = userSession.CompanyId;
            DataSet userPermissionDataSet = DataLibrary.ExecuteDataSet(ref objUserPermissions, "bspGetUserPermissions");

            return(userPermissionDataSet);
        }
Beispiel #27
0
 /// <summary>
 /// Check Amount Beyond Level
 /// </summary>
 /// <param name="AmountReturned">Amount returned</param>
 /// <param name="expenseId">Expense id.</param>
 /// <param name="amountReturnedBy">Amount returned by</param>
 /// <returns>true if the amount received is greater than the amount to be given then return true else false.</returns>
 public bool CheckAmountBeyondLevel(decimal AmountReturned, long expenseId, string amountReturnedBy, string amountReceivedBy)
 {
     object[] objReturnAmountCheck = new object[5];
     objReturnAmountCheck[0] = expenseId;
     objReturnAmountCheck[1] = AmountReturned;
     objReturnAmountCheck[2] = userSession.CompanyId;
     objReturnAmountCheck[3] = amountReturnedBy;
     objReturnAmountCheck[4] = amountReceivedBy;
     return(DataLibrary.ExecuteReaderSql(ref objReturnAmountCheck, "bspCheckAmountBeyondLevel").HasRows);
 }
Beispiel #28
0
        private void SaveCurrentProfile()
        {
            _profile.WindowTop   = this.Top;
            _profile.WindowLeft  = this.Left;
            _profile.Volume      = this.mediaPlayerMain.Volume;
            _profile.LastRadioId = _currentRadio.Id;
            DataLibrary dataLibrary = new DataLibrary(Helper.Configuration.AppDataJSONFullPath);

            dataLibrary.SaveProfile(_profile);
        }
Beispiel #29
0
        /// <summary>
        /// Check is valid password
        /// </summary>
        /// <param name="currentPassword">The current password.</param>
        /// <returns><see cref="bool"/></returns>
        public bool IsValidPassword(string currentPassword)
        {
            object[] objUserInput = new object[3];
            objUserInput[0] = userSession.UserId;
            objUserInput[1] = userSession.CompanyId;
            objUserInput[2] = encDecryption.Encrypt(currentPassword);
            SqlDataReader sdr = DataLibrary.ExecuteReaderSql(ref objUserInput, "bspCheckIsValidPassword");

            return(sdr.HasRows);
        }
Beispiel #30
0
        /// <summary>
        /// Updates the screen data
        /// </summary>
        /// <param name="userId">User Id</param>
        /// <param name="screenId">Screen Id</param>
        /// <param name="screenParameter">Screen Parameter</param>
        public void UpdateScreenData(string userId, int screenId, string screenParameter, char type)
        {
            object[] objScreenParameter = new object[5];
            objScreenParameter[0] = userId;
            objScreenParameter[1] = userSession.CompanyId;
            objScreenParameter[2] = screenId;
            objScreenParameter[3] = screenParameter;
            objScreenParameter[4] = type;

            DataLibrary.ExecuteQuery(ref objScreenParameter, "bspUpdateScreenData");
        }
        private void SaveCurrentProfile()
        {
            profile.WindowTop   = this.Top;
            profile.WindowLeft  = this.Left;
            profile.Volume      = this.mediaPlayerMain.Volume;
            profile.LastRadioId = _currentRadio.Id;
            profile.Language    = ((System.Globalization.CultureInfo) this.cmbCulture.SelectedItem).NativeName;
            DataLibrary dataLibrary = new DataLibrary(Helper.Configuration.AppDataJSONFullPath);

            dataLibrary.SaveProfile(profile);
        }
Beispiel #32
0
        public async Task<List<DataLibrary.DocumentDTO>> SaveTurnoverCertificatePDFForTCCC(DataLibrary.DocumentDTO documentdto, DataLibrary.QaqcformDTO qaqcformdto, int systemId)
        {
            Dictionary<string, dynamic> dParams = new Dictionary<string, dynamic>();
            dParams.Add("documentDTO", documentdto);
            dParams.Add("qaqcformDTO", qaqcformdto);
            dParams.Add("systemId", systemId);

            return await JsonHelper.PutDataAsync<List<DataLibrary.DocumentDTO>>("JsonSaveTurnoverCertificatePDFForTCCC", dParams, JsonHelper.ProjectService);
        }
Beispiel #33
0
        public async Task<bool> UpdateHydroProgressAssignmentByStartPoint(DataLibrary.ProgressAssignment progress, int drawingId)
        {
            bool retValue = false;

            try
            {
                await (new Lib.ServiceModel.ProjectModel()).UpdateHydroProgressAssignmentByStartPoint(progress, drawingId);
                retValue = true;
            }
            catch (Exception e)
            {
                (new WinAppLibrary.Utilities.Helper()).ExceptionHandler(e, "UpdateHydroProgressAssignmentByStartPoint");
            }

            return retValue;
        }
Beispiel #34
0
        private string GetEquipmentName(DataLibrary.ComboBoxDTO dto)
        {
            string rtn = string.Empty;
            string prefix = string.Empty;

            if (lvCategory3.SelectedItem != null)
            {
                prefix = (lvCategory3.SelectedItem as DataLibrary.ComboBoxDTO).DataName;
            }
            else
            {
                if (lvCategory2.SelectedItem != null)
                {
                    prefix = (lvCategory2.SelectedItem as DataLibrary.ComboBoxDTO).DataName;
                }
                else
                {
                    if (lvCategory1.SelectedItem != null)
                    {
                        prefix = (lvCategory1.SelectedItem as DataLibrary.ComboBoxDTO).DataName;
                    }
                }
            }

            rtn = prefix + "-" + dto.DataName;

            return rtn;
        }
Beispiel #35
0
        public async Task<DataLibrary.ExtSchedulerDTO> UpdateFiwpScheduler(DataLibrary.ExtSchedulerDTO extScheduler, string startDate, string finishDate)
        {
            DataLibrary.ExtSchedulerDTO fiwp = new DataLibrary.ExtSchedulerDTO();

            try
            {
                fiwp.Id = extScheduler.Id;
                fiwp.Name = extScheduler.Name;
                fiwp.FavoriteColor = extScheduler.FavoriteColor;
                fiwp.ResourceId = extScheduler.ResourceId;
                fiwp.Title = extScheduler.Title;
                fiwp.ResourceName = extScheduler.ResourceName;
                fiwp.StartDate = Convert.ToDateTime(startDate + " 07:00:00 AM");
                fiwp.EndDate = Convert.ToDateTime(finishDate + " 05:00:00 PM");
                fiwp.TotalMH = extScheduler.TotalMH;
                fiwp.CrewMembers = extScheduler.CrewMembers;
                fiwp.RowStyle = extScheduler.RowStyle;
                fiwp.Color = extScheduler.Color;
                fiwp.ReferenceID = extScheduler.ReferenceID;
                fiwp.IsProgressed = extScheduler.IsProgressed;

                Dictionary<string, dynamic> dParams = new Dictionary<string, dynamic>();
                dParams.Add("extscheduler", fiwp);
                dParams.Add("userName", string.Empty);
                dParams.Add("password", string.Empty);
                var retValue = await JsonHelper.PutDataAsync<DataLibrary.ExtSchedulerDTO>("JsonUpdateFiwpScheduler", dParams, JsonHelper.ProjectService);

                if (string.IsNullOrEmpty(retValue.ExceptionMessage))
                {
                    extScheduler.Id = retValue.Id;
                    extScheduler.Name = retValue.Name;
                    extScheduler.FavoriteColor = retValue.FavoriteColor;
                    extScheduler.ResourceId = retValue.ResourceId;
                    extScheduler.Title = retValue.Title;
                    extScheduler.ResourceName = retValue.ResourceName;
                    extScheduler.StartDate = retValue.StartDate;
                    extScheduler.EndDate = retValue.EndDate;
                    extScheduler.TotalMH = retValue.TotalMH;
                    extScheduler.CrewMembers = retValue.CrewMembers;
                    extScheduler.RowStyle = retValue.RowStyle;
                    extScheduler.Color = retValue.Color;
                    extScheduler.ReferenceID = retValue.ReferenceID;
                    extScheduler.IsProgressed = retValue.IsProgressed;
                }
                extScheduler.ExceptionMessage = retValue.ExceptionMessage; 
                return extScheduler;
            }
            catch
            {
                extScheduler.ExceptionMessage = "There was an error at update";
                return extScheduler;
            }
        }
Beispiel #36
0
 public async Task<List<DataLibrary.DocumentDTO>> SaveProjectDocumentWithSharePointForWFP(
    DataLibrary.DocumentDTO document, string cwpName, string fiwpName, int siteimage)
 {
     Dictionary<string, dynamic> dParams = new Dictionary<string, dynamic>();
     dParams.Add("document", document);
     dParams.Add("cwpName", cwpName);
     dParams.Add("fiwpName", fiwpName);
     dParams.Add("packagetypeLuid", siteimage);
     dParams.Add("currentStep", 0);
     return await JsonHelper.PutDataAsync<List<DataLibrary.DocumentDTO>>("JsonSaveProjectDocumentWithSharePointForWFP", dParams, JsonHelper.ProjectService);
 }
Beispiel #37
0
        private string GetSystemType(DataLibrary.ComboBoxDTO dto)
        {
            string rtn = string.Empty;

            string tmp = dto.DataName;

            if (tmp.Split(',').Count() > 1)
                rtn = tmp.Split(',')[1];

            return rtn;
        }
Beispiel #38
0
        public async Task<DataLibrary.ProgressAssignment> UpdateSIWPProgressAssignmentByScope(DataLibrary.ProgressAssignment progress,
            int startdrawingId, int enddrawingId, int startidfseq, int endidfseq, List<int> withindrawingList)
        {
            Dictionary<string, dynamic> dParams = new Dictionary<string, dynamic>();
            dParams.Add("progress", progress);
            dParams.Add("startdrawingId", startdrawingId);
            dParams.Add("enddrawingId", enddrawingId);
            dParams.Add("startidfseq", startidfseq);
            dParams.Add("endidfseq", endidfseq);
            dParams.Add("withindrawingList", withindrawingList);

            return await JsonHelper.PutDataAsync<DataLibrary.ProgressAssignment>("JsonUpdateSIWPProgressAssignmentByScope", dParams, JsonHelper.ProjectService);
        }
Beispiel #39
0
        public async Task<DataLibrary.WalkdownDTOSet> SaveQaqcformWithSharepoint(DataLibrary.WalkdownDTOSet walkdownDs)
        {
            Dictionary<string, dynamic> dParams = new Dictionary<string, dynamic>();
            dParams.Add("walkdownDs", walkdownDs);

            return await JsonHelper.PutDataAsync<DataLibrary.WalkdownDTOSet>("JsonSaveQaqcformWithSharepoint", dParams, JsonHelper.ProjectService);
        }
Beispiel #40
0
 public async Task<DataLibrary.ProgressAssignment> UpdateProjectScheduleAssignment(DataLibrary.ProgressAssignment progress)
 {
     Dictionary<string, dynamic> dParams = new Dictionary<string, dynamic>();
     dParams.Add("progress", progress);
     return await JsonHelper.PutDataAsync<DataLibrary.ProgressAssignment>("JsonUpdateProjectScheduleAssignment", dParams, JsonHelper.ProjectService);
 }
Beispiel #41
0
        public async Task<DataLibrary.ProgressAssignment> UpdateHydroProgressAssignmentByStartPoint(DataLibrary.ProgressAssignment progress,
            int drawingId)
        {
            Dictionary<string, dynamic> dParams = new Dictionary<string, dynamic>();
            dParams.Add("progress", progress);
            dParams.Add("drawingId", drawingId);

            return await JsonHelper.PutDataAsync<DataLibrary.ProgressAssignment>("JsonUpdateHydroProgressAssignmentByStartPoint", dParams, JsonHelper.ProjectService);
        }
        private Dictionary<string, string> GetDrawingInfo(DataLibrary.DrawingDTO drawing)
        {
            Dictionary<string, string> infolist = new Dictionary<string, string>();
            infolist.Add("DrawingName", drawing.DrawingName == null ? "" : drawing.DrawingName);
            infolist.Add("CWA", drawing.CWPName == null ? "" : drawing.CWPName);
            infolist.Add("Title", drawing.Description == null ? "" : drawing.Description);
            infolist.Add("TypeDesc", drawing.TypeDesc == null ? "" : drawing.TypeDesc);
            return infolist;

            //This was dismissed because of faster binding to Drawing Info Panel
            //ObservableCollection<DataGroup> groupedlist = new ObservableCollection<DataGroup>();
            //var group = new DataGroup("DrawingName", "DrawingName", "");
            //groupedlist.Add(group);
            //groupedlist[0].Items.Add(new DataItem(drawing.DrawingID + "DrawingName", drawing.DrawingName, "", "", groupedlist[0]) { });

            //group = new DataGroup("CWA", "CWA", "");
            //groupedlist.Add(group);
            //groupedlist[1].Items.Add(new DataItem(drawing.CWPID + "CWA", drawing.CWPName, "", "", groupedlist[1]) { });

            //group = new DataGroup("Title", "Title", "");
            //groupedlist.Add(group);
            //groupedlist[2].Items.Add(new DataItem(drawing.Description + "Title", drawing.Description, "", "", groupedlist[2]) { });

            //group = new DataGroup("TypeDesc", "Type Description", "");
            //groupedlist.Add(group);
            //groupedlist[3].Items.Add(new DataItem(drawing.TypeDesc, drawing.TypeDesc, "", "", groupedlist[3]) { });
        }
Beispiel #43
0
 public async Task<DataLibrary.FiwpDTO> UpdateIwpPeriod(DataLibrary.FiwpDTO iwp, string totalManhours)
 {
     try
     {
         DataLibrary.FiwpDTO result = await (new Lib.ServiceModel.ProjectModel()).UpdateIwpPeriod(iwp, totalManhours);
         return result;
     }
     catch (Exception e)
     {
         throw e;
     }
 }    
Beispiel #44
0
 public bool SetSchduleInfo(DataLibrary.ProjectscheduleDTO dto)
 {
     try
     {
         List<DataLibrary.ProjectscheduleDTO> ldto = new List<DataLibrary.ProjectscheduleDTO>();
         ldto.Add(dto);
         _scheduleJson = ldto;
     }
     catch( Exception e)
     {
     }
     return true;
 }
Beispiel #45
0
        public async Task<bool> UpdateSIWPProgressAssignmentByScope(DataLibrary.ProgressAssignment progress, 
            int startdrawingId, int enddrawingId, int startidfseq, int endidfseq, List<int> withindrawingList)
        {
            bool retValue = false;

            try
            {
                await (new Lib.ServiceModel.ProjectModel()).UpdateSIWPProgressAssignmentByScope(progress, startdrawingId, enddrawingId, startidfseq, endidfseq, withindrawingList);
                retValue = true;
            }
            catch (Exception e)
            {
                (new WinAppLibrary.Utilities.Helper()).ExceptionHandler(e, "UpdateSIWPProgressAssignmentByScope");
            }

            return retValue;
        }
Beispiel #46
0
 public async Task<DataLibrary.ProjectscheduleDTO> UpdateProjectSchedulePeriod(DataLibrary.ProjectscheduleDTO psc, string totalManhours)
 {
     DataLibrary.ProjectscheduleDTO dto = new DataLibrary.ProjectscheduleDTO();
     dto = await (new Lib.ServiceModel.ProjectModel()).UpdateProjectSchedulePeriod(psc, totalManhours);
     return dto;
 }
Beispiel #47
0
        public async Task<bool> UpdateProjectScheduleAssignment(DataLibrary.ProgressAssignment progress)
        {
            bool retValue = false;

            try
            {
                await (new Lib.ServiceModel.ProjectModel()).UpdateProjectScheduleAssignment(progress);
                retValue = true;
            }
            catch (Exception e)
            {
                (new WinAppLibrary.Utilities.Helper()).ExceptionHandler(e, "UpdateProjectScheduleAssignment");
            }

            return retValue;
        }
Beispiel #48
0
        //private void Bind_Spec()
        //{
        //    List<DataLibrary.FieldequipmentDTO> result = null;
        //    List<DataLibrary.ComboBoxDTO> tmp = null;

        //    if (_libFieldequipment == null)
        //        return;

        //    if (lvCategory3.SelectedItem != null)
        //        result = _libFieldequipment.Where(x => x.Category3 == (lvCategory3.SelectedItem as DataLibrary.ComboBoxDTO).DataName).ToList();
        //    else if (lvCategory2.SelectedItem != null)
        //        result = _libFieldequipment.Where(x => x.Category2 == (lvCategory2.SelectedItem as DataLibrary.ComboBoxDTO).DataName).ToList();
        //    else
        //        result = _libFieldequipment.Where(x => x.Category1 == (lvCategory1.SelectedItem as DataLibrary.ComboBoxDTO).DataName).ToList();

        //    tmp = result.GroupBy(x => new { x.FieldEquipmentID, x.Spec, x.SystemType }).Select(x => new DataLibrary.ComboBoxDTO()
        //    {
        //        DataName = x.Key.Spec + (string.IsNullOrEmpty(x.Key.SystemType) ? "" : ", " + x.Key.SystemType),
        //        DataID = x.Key.FieldEquipmentID
        //    }).ToList();

        //    lvSpec.ItemsSource = tmp;
        //}

        private string GetSpec(DataLibrary.ComboBoxDTO dto)
        {
            string rtn = string.Empty;

            rtn = dto.DataName.Split(',')[0];

            return rtn;
        }
Beispiel #49
0
 public async Task<DataLibrary.DocumentDTO> SaveProjectDocumentWithSharePointForModelView(List<DataLibrary.FiwpDTO> fiwps,
     DataLibrary.DocumentDTO document, string docName, string cwpName, string fiwpName)
 {
     Dictionary<string, dynamic> dParams = new Dictionary<string, dynamic>();
     dParams.Add("fiwps", fiwps);
     dParams.Add("document", document);
     dParams.Add("docName", docName);
     dParams.Add("cwpName", cwpName);
     dParams.Add("fiwpName", fiwpName);
     return await JsonHelper.PutDataAsync<DataLibrary.DocumentDTO>("JsonSaveProjectDocumentWithSharePointForModelView", dParams, JsonHelper.ProjectService);
 }
Beispiel #50
0
        public void LoadIWPSchedule(DataLibrary.ExtSchedulerDTO dto, string startDate, string endDate)
        {
            Login.MasterPage.Loading(true, this);
            
            ucIWPScheduleDetail.btnUpdateClicked += _iwpScheduleDetail_btnUpdateClicked;
            ucIWPScheduleDetail.btnPanelCollapseClicked += _iwpScheduleDetail_btnPanelCollapseClicked;

            if (dto != null)
            {
                ucIWPScheduleDetail.BindIWPScheduleDetail(dto, startDate, endDate);                
            }

            Login.MasterPage.Loading(false, this);
        }