Beispiel #1
0
        public IList <DMSFileTrackingEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression)
        {
            IList <DMSFileTrackingEntity> dMSFileTrackingEntityList = new List <DMSFileTrackingEntity>();

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = DMSFileTrackingEntity.FLD_NAME_FileTrackingID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                dMSFileTrackingEntityList = FCCDMSFileTracking.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(dMSFileTrackingEntityList ?? new List <DMSFileTrackingEntity>());
        }
Beispiel #2
0
        private void SaveDMSFileTrackingEntity()
        {
            if (IsValid)
            {
                try
                {
                    DMSFileTrackingEntity dMSFileTrackingEntity = BuildDMSFileTrackingEntity();

                    Int64 result = -1;

                    if (dMSFileTrackingEntity.IsNew)
                    {
                        result = FCCDMSFileTracking.GetFacadeCreate().Add(dMSFileTrackingEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(DMSFileTrackingEntity.FLD_NAME_FileTrackingID, dMSFileTrackingEntity.FileTrackingID.ToString(), SQLMatchType.Equal);
                        result = FCCDMSFileTracking.GetFacadeCreate().Update(dMSFileTrackingEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _FileTrackingID        = 0;
                        _DMSFileTrackingEntity = new DMSFileTrackingEntity();
                        PrepareInitialView();
                        BindDMSFileTrackingList();

                        if (dMSFileTrackingEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "File Tracking Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "File Tracking Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (dMSFileTrackingEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add File Tracking Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update File Tracking Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
Beispiel #3
0
        protected void lvDMSFileTracking_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 FileTrackingID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(DMSFileTrackingEntity.FLD_NAME_FileTrackingID, FileTrackingID.ToString(), SQLMatchType.Equal);

                        DMSFileTrackingEntity dMSFileTrackingEntity = new DMSFileTrackingEntity();


                        result = FCCDMSFileTracking.GetFacadeCreate().Delete(dMSFileTrackingEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _FileTrackingID        = 0;
                            _DMSFileTrackingEntity = new DMSFileTrackingEntity();
                            PrepareInitialView();
                            BindDMSFileTrackingList();

                            MiscUtil.ShowMessage(lblMessage, "File Tracking has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete File Tracking.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
Beispiel #4
0
        public IList <DMSFileTrackingEntity> GetData()
        {
            IList <DMSFileTrackingEntity> dMSFileTrackingEntityList = new List <DMSFileTrackingEntity>();

            try
            {
                dMSFileTrackingEntityList = FCCDMSFileTracking.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(dMSFileTrackingEntityList ?? new List <DMSFileTrackingEntity>());
        }
        private void PrepareEditView()
        {
            DMSFileMovementRegisterEntity dMSFileMovementRegisterEntity = CurrentDMSFileMovementRegisterEntity;


            if (!dMSFileMovementRegisterEntity.IsNew)
            {
                String fe = SqlExpressionBuilder.PrepareFilterExpression(DMSFileTrackingEntity.FLD_NAME_FileTrackingID, dMSFileMovementRegisterEntity.FileTrackingID.ToString(), SQLMatchType.Equal);
                IList <DMSFileTrackingEntity> dMSFileTrackingList = FCCDMSFileTracking.GetFacadeCreate().GetIL(null, null, String.Empty, fe, DatabaseOperationType.LoadWithFilterExpression);

                if (dMSFileTrackingList != null && dMSFileTrackingList.Count > 0)
                {
                    if (ddlDepartmentID.Items.Count > 0)
                    {
                        ddlDepartmentID.SelectedValue = dMSFileTrackingList[0].DepartmentID.ToString();
                    }
                }

                BindDropDownFileByDepartment();

                if (ddlFileTrackingID.Items.Count > 0 && dMSFileMovementRegisterEntity.FileTrackingID != null)
                {
                    ddlFileTrackingID.SelectedValue = dMSFileMovementRegisterEntity.FileTrackingID.ToString();
                }

                if (ddlGivenToEmployeeID.Items.Count > 0 && dMSFileMovementRegisterEntity.GivenToEmployeeID != null)
                {
                    ddlGivenToEmployeeID.SelectedValue = dMSFileMovementRegisterEntity.GivenToEmployeeID.ToString();
                }

                txtMovementDateTime.Text  = dMSFileMovementRegisterEntity.MovementDateTime.ToStringDefault();
                txtFileMovementPlace.Text = dMSFileMovementRegisterEntity.FileMovementPlace.ToString();

                btnSubmit.Text    = "Update";
                btnAddNew.Visible = true;
            }
        }