Пример #1
0
        public IList <BDProjectEntity> GetPagedData(Int32 startRowIndex, Int32 pageSize, String sortExpression)
        {
            IList <BDProjectEntity> bDProjectEntityList = new List <BDProjectEntity>();

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

                if (String.IsNullOrEmpty(sortExpression))
                {
                    sortExpression = BDProjectEntity.FLD_NAME_ProjectCode + " " + SQLConstants.SORT_ORDER_ASCENDING;
                }

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

                bDProjectEntityList = FCCBDProject.GetFacadeCreate().GetIL(startRowIndex, pageSize, sortExpression, null, DatabaseOperationType.LoadPagedWithSortExpression);

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

            return(bDProjectEntityList ?? new List <BDProjectEntity>());
        }
Пример #2
0
 private void BuildProjectCodeByProjectID()
 {
     if (ddlProjectID != null && ddlProjectID.SelectedValue != "0")
     {
         BDProjectEntity lstProject = FCCBDProject.GetFacadeCreate().GetByID(Int64.Parse(ddlProjectID.SelectedValue.ToString()));
         txtProjectCode.Text = lstProject.ProjectCode.ToString();
         MiscUtil.PopulateCMBillByProject(ddlBillID, true, Int64.Parse(ddlProjectID.SelectedValue.ToString()));
     }
 }
Пример #3
0
        private void SaveBDProjectEntity()
        {
            if (IsValid)
            {
                try
                {
                    BDProjectEntity bDProjectEntity = BuildBDProjectEntity();

                    Int64 result = -1;

                    if (bDProjectEntity.IsNew)
                    {
                        result = FCCBDProject.GetFacadeCreate().Add(bDProjectEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(BDProjectEntity.FLD_NAME_ProjectID, bDProjectEntity.ProjectID.ToString(), SQLMatchType.Equal);
                        result = FCCBDProject.GetFacadeCreate().Update(bDProjectEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _ProjectID       = 0;
                        _BDProjectEntity = new BDProjectEntity();
                        PrepareInitialView();
                        BindBDProjectList();

                        if (bDProjectEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Project Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Project Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (bDProjectEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Project Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Project Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
Пример #4
0
        private REQRequisitionEntity BuildREQRequisitionEntity()
        {
            REQRequisitionEntity rEQRequisitionEntity = CurrentREQRequisitionEntity;

            if (rEQRequisitionEntity.IsNew)
            {
                if (ddlProjectID.Items.Count > 0)
                {
                    if (ddlProjectID.SelectedValue == "0")
                    {
                    }
                    else
                    {
                        rEQRequisitionEntity.ProjectID = Int64.Parse(ddlProjectID.SelectedValue);
                    }
                }
            }

            BDProjectEntity _bDProjectEntity = FCCBDProject.GetFacadeCreate().GetByID(rEQRequisitionEntity.ProjectID);

            if (_bDProjectEntity != null && txtRequisitionNo.Text.ToString() == MasterDataConstants.AutoAssigned.DEFAULT_AUTO_ASSIGNED)
            {
                rEQRequisitionEntity.RequisitionNo = _bDProjectEntity.ProjectCode;
            }

            else if (_bDProjectEntity != null && txtRequisitionNo.Text.ToString() != MasterDataConstants.AutoAssigned.DEFAULT_AUTO_ASSIGNED)
            {
                rEQRequisitionEntity.RequisitionNo = txtRequisitionNo.Text.ToString();
            }


            if (txtRequisitionDate.Text.Trim().IsNotNullOrEmpty())
            {
                rEQRequisitionEntity.RequisitionDate = MiscUtil.ParseToDateTime(txtRequisitionDate.Text);
            }

            rEQRequisitionEntity.Remarks = txtRemarks.Text.Trim();
            if (ddlRequisitionStatusID.Items.Count > 0)
            {
                if (ddlRequisitionStatusID.SelectedValue == "0")
                {
                }
                else
                {
                    rEQRequisitionEntity.RequisitionStatusID = Int64.Parse(ddlRequisitionStatusID.SelectedValue);
                }
            }

            rEQRequisitionEntity.IsCashPayment         = chkIsCashPayment.Checked;
            rEQRequisitionEntity.IsAccountsMadePayment = false;
            rEQRequisitionEntity.IsRCS = chkIsRCS.Checked;
            return(rEQRequisitionEntity);
        }
Пример #5
0
        protected void lvBDProject_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 ProjectID;

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

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

                    PrepareEditView();

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(BDProjectEntity.FLD_NAME_ProjectID, ProjectID.ToString(), SQLMatchType.Equal);

                        BDProjectEntity bDProjectEntity = new BDProjectEntity();


                        result = FCCBDProject.GetFacadeCreate().Delete(bDProjectEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _ProjectID       = 0;
                            _BDProjectEntity = new BDProjectEntity();
                            PrepareInitialView();
                            BindBDProjectList();

                            MiscUtil.ShowMessage(lblMessage, "Project has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Project.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
Пример #6
0
        public IList <BDProjectEntity> GetData()
        {
            IList <BDProjectEntity> bDProjectEntityList = new List <BDProjectEntity>();

            try
            {
                bDProjectEntityList = FCCBDProject.GetFacadeCreate().GetIL(null, null, null, null, DatabaseOperationType.Load);

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

            return(bDProjectEntityList ?? new List <BDProjectEntity>());
        }
        protected void lvACCPrePayableStatementDetail_ItemDataBound(object sender, ListViewItemEventArgs e)
        {
            if (e.Item.ItemType == ListViewItemType.DataItem)
            {
                ListViewDataItem dataItem = (ListViewDataItem)e.Item;

                ACCPostPayableStatementDetailEntity ent = (ACCPostPayableStatementDetailEntity)dataItem.DataItem;

                Label        lblProjectNameLV                            = (Label)e.Item.FindControl("lblProjectNameLV");
                Label        lblVendorCategoryNameLV                     = (Label)e.Item.FindControl("lblVendorCategoryNameLV");
                Label        lblVendorCategoryIDLV                       = (Label)e.Item.FindControl("lblVendorCategoryIDLV");
                Label        lblVendorIDLV                               = (Label)e.Item.FindControl("lblVendorIDLV");
                Label        lblVendorNameLV                             = (Label)e.Item.FindControl("lblVendorNameLV");
                Label        lblProjectIDLV                              = (Label)e.Item.FindControl("lblProjectIDLV");
                DropDownList ddlACCPayableApprovalStatusIDLV             = (DropDownList)e.Item.FindControl("ddlACCPayableApprovalStatusIDLV");
                DropDownList ddlACCPayablePaymentStatusIDLV              = (DropDownList)e.Item.FindControl("ddlACCPayablePaymentStatusIDLV");
                DropDownList ddlPayableClassificationIDLV                = (DropDownList)e.Item.FindControl("ddlPayableClassificationIDLV");
                DropDownList ddlAccountPaybleStatementDetailCategoryIDLV = (DropDownList)e.Item.FindControl("ddlAccountPaybleStatementDetailCategoryIDLV");
                CheckBox     chkPartyReconcileLV                         = (CheckBox)e.Item.FindControl("chkPartyReconcileLV");

                if (lblProjectIDLV != null)
                {
                    BDProjectEntity _bDProjectEntity = FCCBDProject.GetFacadeCreate().GetByID(Int64.Parse(lblProjectIDLV.Text));

                    if (_bDProjectEntity != null)
                    {
                        lblProjectNameLV.Text = _bDProjectEntity.ProjectName + " (" + _bDProjectEntity.ProjectCode + ")";
                    }
                }

                MiscUtil.PopulateMDACCPayablePaymentStatus(ddlACCPayablePaymentStatusIDLV, false);
                MiscUtil.PopulateMDACCPayableApprovalStatus(ddlACCPayableApprovalStatusIDLV, false);
                MiscUtil.PopulateMDPayableClassification(ddlPayableClassificationIDLV, false);
                MiscUtil.PopulateMDAccountPaybleStatementDetailCategory(ddlAccountPaybleStatementDetailCategoryIDLV, false);
                _PostPayableStatementDetailID = ent.PostPayableStatementDetailID;

                if (ent.PartyReconcile == true)
                {
                    chkPartyReconcileLV.Checked = true;
                }
                else
                {
                    chkPartyReconcileLV.Checked = false;
                }

                Int64 vendorID;
                Int64.TryParse(lblVendorIDLV.Text.ToString(), out vendorID);

                switch (lblVendorCategoryIDLV.Text)
                {
                case MasterDataConstants.CM_Bill_VendorCategory.CONSULTANT:
                    CMConsultantEntity _cmConsultantEntity = FCCCMConsultant.GetFacadeCreate().GetByID(vendorID);
                    lblVendorCategoryNameLV.Text = "CONSULTANT";
                    lblVendorNameLV.Text         = _cmConsultantEntity.Name;
                    break;

                case MasterDataConstants.CM_Bill_VendorCategory.CONTRACTOR:
                    CMContractorEntity _cMContractorEntity = FCCCMContractor.GetFacadeCreate().GetByID(vendorID);
                    lblVendorCategoryNameLV.Text = "CONTRACTOR";
                    lblVendorNameLV.Text         = _cMContractorEntity.Name;
                    break;

                case MasterDataConstants.CM_Bill_VendorCategory.VENDOR:
                    PRMSupplierEntity _pRMSupplierEntity = FCCPRMSupplier.GetFacadeCreate().GetByID(vendorID);
                    lblVendorCategoryNameLV.Text = "VENDOR";
                    lblVendorNameLV.Text         = _pRMSupplierEntity.SupplierName;
                    break;
                }

                if (ddlACCPayableApprovalStatusIDLV != null && ddlACCPayableApprovalStatusIDLV.Items.Count > 0)
                {
                    ddlACCPayableApprovalStatusIDLV.SelectedValue = ent.ACCPayableApprovalStatusID.ToString();
                }

                if (ddlACCPayablePaymentStatusIDLV != null && ddlACCPayablePaymentStatusIDLV.Items.Count > 0)
                {
                    ddlACCPayablePaymentStatusIDLV.SelectedValue = ent.ACCPayablePaymentStatusID.ToString();
                }

                if (ddlPayableClassificationIDLV != null && ddlPayableClassificationIDLV.Items.Count > 0)
                {
                    ddlPayableClassificationIDLV.SelectedValue = ent.PayableClassificationID.ToString();
                }

                if (ddlAccountPaybleStatementDetailCategoryIDLV != null && ddlAccountPaybleStatementDetailCategoryIDLV.Items.Count > 0)
                {
                    ddlAccountPaybleStatementDetailCategoryIDLV.SelectedValue = ent.AccountPaybleStatementDetailCategoryID.ToString();
                }

                ddlACCPayableApprovalStatusIDLV.Enabled = false;
            }
        }