public IList <MDConstructionToolWorkingConditionEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression)
        {
            IList <MDConstructionToolWorkingConditionEntity> mDConstructionToolWorkingConditionEntityList = new List <MDConstructionToolWorkingConditionEntity>();

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = MDConstructionToolWorkingConditionEntity.FLD_NAME_ConstructionToolWorkingConditionID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                mDConstructionToolWorkingConditionEntityList = FCCMDConstructionToolWorkingCondition.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(mDConstructionToolWorkingConditionEntityList ?? new List <MDConstructionToolWorkingConditionEntity>());
        }
示例#2
0
        private void SaveMDConstructionToolWorkingConditionEntity()
        {
            if (IsValid)
            {
                try
                {
                    MDConstructionToolWorkingConditionEntity mDConstructionToolWorkingConditionEntity = BuildMDConstructionToolWorkingConditionEntity();

                    Int64 result = -1;

                    if (mDConstructionToolWorkingConditionEntity.IsNew)
                    {
                        result = FCCMDConstructionToolWorkingCondition.GetFacadeCreate().Add(mDConstructionToolWorkingConditionEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(MDConstructionToolWorkingConditionEntity.FLD_NAME_ConstructionToolWorkingConditionID, mDConstructionToolWorkingConditionEntity.ConstructionToolWorkingConditionID.ToString(), SQLMatchType.Equal);
                        result = FCCMDConstructionToolWorkingCondition.GetFacadeCreate().Update(mDConstructionToolWorkingConditionEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _ConstructionToolWorkingConditionID       = 0;
                        _MDConstructionToolWorkingConditionEntity = new MDConstructionToolWorkingConditionEntity();
                        PrepareInitialView();
                        BindMDConstructionToolWorkingConditionList();

                        if (mDConstructionToolWorkingConditionEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Construction Tool Working Condition Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Construction Tool Working Condition Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (mDConstructionToolWorkingConditionEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Construction Tool Working Condition Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Construction Tool Working Condition Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
示例#3
0
        protected void lvMDConstructionToolWorkingCondition_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 ConstructionToolWorkingConditionID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(MDConstructionToolWorkingConditionEntity.FLD_NAME_ConstructionToolWorkingConditionID, ConstructionToolWorkingConditionID.ToString(), SQLMatchType.Equal);

                        MDConstructionToolWorkingConditionEntity mDConstructionToolWorkingConditionEntity = new MDConstructionToolWorkingConditionEntity();


                        result = FCCMDConstructionToolWorkingCondition.GetFacadeCreate().Delete(mDConstructionToolWorkingConditionEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _ConstructionToolWorkingConditionID       = 0;
                            _MDConstructionToolWorkingConditionEntity = new MDConstructionToolWorkingConditionEntity();
                            PrepareInitialView();
                            BindMDConstructionToolWorkingConditionList();

                            MiscUtil.ShowMessage(lblMessage, "Construction Tool Working Condition has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Construction Tool Working Condition.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
        public IList <MDConstructionToolWorkingConditionEntity> GetData()
        {
            IList <MDConstructionToolWorkingConditionEntity> mDConstructionToolWorkingConditionEntityList = new List <MDConstructionToolWorkingConditionEntity>();

            try
            {
                mDConstructionToolWorkingConditionEntityList = FCCMDConstructionToolWorkingCondition.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(mDConstructionToolWorkingConditionEntityList ?? new List <MDConstructionToolWorkingConditionEntity>());
        }