コード例 #1
0
        public IList <ACBankAccountDepositItemEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression)
        {
            IList <ACBankAccountDepositItemEntity> aCBankAccountDepositItemEntityList = new List <ACBankAccountDepositItemEntity>();

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = ACBankAccountDepositItemEntity.FLD_NAME_BankAccountDepositItemID + " " + SQLConstants.SORT_ORDER_DESCENDING;
                }

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

                aCBankAccountDepositItemEntityList = FCCACBankAccountDepositItem.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(aCBankAccountDepositItemEntityList ?? new List <ACBankAccountDepositItemEntity>());
        }
コード例 #2
0
        public IList <ACBankAccountDepositItemEntity> GetData()
        {
            IList <ACBankAccountDepositItemEntity> aCBankAccountDepositItemEntityList = new List <ACBankAccountDepositItemEntity>();

            try
            {
                aCBankAccountDepositItemEntityList = FCCACBankAccountDepositItem.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(aCBankAccountDepositItemEntityList ?? new List <ACBankAccountDepositItemEntity>());
        }
コード例 #3
0
        private void SaveACBankAccountDepositEntity()
        {
            if (IsValid)
            {
                try
                {
                    ACBankAccountDepositEntity aCBankAccountDepositEntity = BuildACBankAccountDepositEntity();

                    Int64 result = -1;

                    if (aCBankAccountDepositEntity.IsNew)
                    {
                        result = FCCACBankAccountDeposit.GetFacadeCreate().Add(aCBankAccountDepositEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(ACBankAccountDepositEntity.FLD_NAME_BankAccountDepositID, aCBankAccountDepositEntity.BankAccountDepositID.ToString(), SQLMatchType.Equal);
                        result = FCCACBankAccountDeposit.GetFacadeCreate().Update(aCBankAccountDepositEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        Int64 resut_two = -1;

                        if (!aCBankAccountDepositEntity.IsNew)
                        {
                            CurrentACBankAccountDepositItemList = new List <ACBankAccountDepositItem_DetailedEntity>();

                            ACBankAccountDepositItem_DetailedEntity aCBankAccountDepositItemEntity = new ACBankAccountDepositItem_DetailedEntity();

                            IList <ListViewDataItem> listBankDeposit = lvACBankAccountDepositItem.Items;

                            if (listBankDeposit != null && listBankDeposit.Count > 0)
                            {
                                String fe_del = SqlExpressionBuilder.PrepareFilterExpression(ACBankAccountDepositItemEntity.FLD_NAME_BankAccountDepositID, result.ToString(), SQLMatchType.Equal);
                                ACBankAccountDepositItemEntity acDopsitItem = new ACBankAccountDepositItemEntity();

                                FCCACBankAccountDepositItem.GetFacadeCreate().Delete(acDopsitItem, fe_del, DatabaseOperationType.Delete, TransactionRequired.No);

                                foreach (ListViewDataItem lvdi in listBankDeposit)
                                {
                                    aCBankAccountDepositItemEntity = new ACBankAccountDepositItem_DetailedEntity();

                                    Label lblAccountIDLV   = (Label)lvdi.FindControl("lblAccountIDLV");
                                    Label lblAccountNameLV = (Label)lvdi.FindControl("lblAccountNameLV");
                                    Label lblAmountLV      = (Label)lvdi.FindControl("lblAmountLV");
                                    Label lblMemoLV        = (Label)lvdi.FindControl("lblMemoLV");

                                    aCBankAccountDepositItemEntity.BankAccountDepositItemID = CurrentACBankAccountDepositItemList.Count + 1;

                                    if (lblAccountIDLV.Text.Trim().IsNotNullOrEmpty())
                                    {
                                        aCBankAccountDepositItemEntity.AccountID   = Int64.Parse(lblAccountIDLV.Text.Trim());
                                        aCBankAccountDepositItemEntity.AccountName = lblAccountNameLV.Text.ToString().Trim();
                                    }

                                    if (!lblAmountLV.Text.Trim().IsNullOrEmpty())
                                    {
                                        aCBankAccountDepositItemEntity.Amount = Decimal.Parse(lblAmountLV.Text.Trim());
                                    }

                                    aCBankAccountDepositItemEntity.Memo = lblMemoLV.Text.Trim();

                                    #region Update Value

                                    ACBankAccountDepositItemEntity acBankAccountDepositItemEntity = new ACBankAccountDepositItemEntity();
                                    acBankAccountDepositItemEntity.AccountID            = aCBankAccountDepositItemEntity.AccountID;
                                    acBankAccountDepositItemEntity.DimensionID          = aCBankAccountDepositItemEntity.DimensionID;
                                    acBankAccountDepositItemEntity.Amount               = aCBankAccountDepositItemEntity.Amount;
                                    acBankAccountDepositItemEntity.Memo                 = aCBankAccountDepositItemEntity.Memo;
                                    acBankAccountDepositItemEntity.ItemID               = aCBankAccountDepositItemEntity.ItemID;
                                    acBankAccountDepositItemEntity.RequisitionID        = aCBankAccountDepositItemEntity.RequisitionID;
                                    acBankAccountDepositItemEntity.WorkOrderID          = aCBankAccountDepositItemEntity.WorkOrderID;
                                    acBankAccountDepositItemEntity.BillID               = aCBankAccountDepositItemEntity.BillID;
                                    acBankAccountDepositItemEntity.ProjectID            = aCBankAccountDepositItemEntity.ProjectID;
                                    acBankAccountDepositItemEntity.ProjectFloorID       = aCBankAccountDepositItemEntity.ProjectFloorID;
                                    acBankAccountDepositItemEntity.ProjectFloorUnitID   = aCBankAccountDepositItemEntity.ProjectFloorUnitID;
                                    acBankAccountDepositItemEntity.BankAccountDepositID = result;

                                    resut_two = FCCACBankAccountDepositItem.GetFacadeCreate().Add(acBankAccountDepositItemEntity, DatabaseOperationType.Add, TransactionRequired.No);

                                    #endregion

                                    CurrentACBankAccountDepositItemList.Add(aCBankAccountDepositItemEntity);
                                }

                                BindACBankAccountDepositItemList();
                                BuildTotalValueLabel();
                            }
                        }

                        if (aCBankAccountDepositEntity.IsNew)
                        {
                            if (CurrentACBankAccountDepositItemList != null && CurrentACBankAccountDepositItemList.Count > 0)
                            {
                                foreach (ACBankAccountDepositItem_DetailedEntity ent in CurrentACBankAccountDepositItemList)
                                {
                                    ACBankAccountDepositItemEntity acBankAccountDepositItemEntity = new ACBankAccountDepositItemEntity();
                                    acBankAccountDepositItemEntity.AccountID            = ent.AccountID;
                                    acBankAccountDepositItemEntity.DimensionID          = ent.DimensionID;
                                    acBankAccountDepositItemEntity.Amount               = ent.Amount;
                                    acBankAccountDepositItemEntity.Memo                 = ent.Memo;
                                    acBankAccountDepositItemEntity.ItemID               = ent.ItemID;
                                    acBankAccountDepositItemEntity.RequisitionID        = ent.RequisitionID;
                                    acBankAccountDepositItemEntity.WorkOrderID          = ent.WorkOrderID;
                                    acBankAccountDepositItemEntity.BillID               = ent.BillID;
                                    acBankAccountDepositItemEntity.ProjectID            = ent.ProjectID;
                                    acBankAccountDepositItemEntity.ProjectFloorID       = ent.ProjectFloorID;
                                    acBankAccountDepositItemEntity.ProjectFloorUnitID   = ent.ProjectFloorUnitID;
                                    acBankAccountDepositItemEntity.BankAccountDepositID = result;

                                    resut_two = FCCACBankAccountDepositItem.GetFacadeCreate().Add(acBankAccountDepositItemEntity, DatabaseOperationType.Add, TransactionRequired.No);
                                }
                            }
                        }

                        hypReportLink.NavigateUrl = UrlHelper.BuildSecureUrl("~/Reports/ReportViewer.aspx", string.Empty, "do", ReportConstants.BANK_ACCOUNT_DEPOSIT_REPORT, UrlConstants.OVERVIEW_BANK_ACCOUNT_DEPOSIT_ID, result.ToString()).ToString();
                        hypReportLink.Target      = "_blank";
                        hypReportLink.Visible     = true;


                        String str = (String)ViewState["Action"].ToString();

                        if (str == "GenerateReport")
                        {
                            _BankAccountDepositID = result;
                            _bankAccountDepositID = result;
                            PrepareEditView();
                        }

                        else if (str == "Approval")
                        {
                            _BankAccountDepositID       = 0;
                            _bankAccountDepositID       = result;
                            _ACBankAccountDepositEntity = new ACBankAccountDepositEntity();
                            PrepareInitialView();
                            PrepareInitialViewDepositeItem();
                            CurrentACBankAccountDepositItemList = new List <ACBankAccountDepositItem_DetailedEntity>();
                            BindACBankAccountDepositItemList();
                            BuildTotalValueLabel();
                        }

                        if (aCBankAccountDepositEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Bank Account Deposit Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Bank Account Deposit Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (aCBankAccountDepositEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Bank Account Deposit Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Bank Account Deposit Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }