Int64 IBDProjectFloorUnitDataAccess.Delete(BDProjectFloorUnitEntity bDProjectFloorUnitEntity, String filterExpression, DatabaseOperationType option, TransactionRequired reqTran)
        {
            try
            {
                long retValues = -99;

                switch (reqTran)
                {
                case TransactionRequired.No:
                {
                    retValues = Delete(bDProjectFloorUnitEntity, filterExpression, option);
                    break;
                }

                case TransactionRequired.Yes:
                {
                    retValues = DeleteTran(bDProjectFloorUnitEntity, filterExpression, option);
                    break;
                }

                default:
                {
                    retValues = -99;
                    break;
                }
                }

                return(retValues);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 2
0
        private void SaveBDProjectFloorUnitEntity()
        {
            if (IsValid)
            {
                try
                {
                    BDProjectFloorUnitEntity bDProjectFloorUnitEntity = BuildBDProjectFloorUnitEntity();

                    Int64 result = -1;

                    if (bDProjectFloorUnitEntity.IsNew)
                    {
                        result = FCCBDProjectFloorUnit.GetFacadeCreate().Add(bDProjectFloorUnitEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(BDProjectFloorUnitEntity.FLD_NAME_ProjectFloorUnitID, bDProjectFloorUnitEntity.ProjectFloorUnitID.ToString(), SQLMatchType.Equal);
                        result = FCCBDProjectFloorUnit.GetFacadeCreate().Update(bDProjectFloorUnitEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        _ProjectFloorUnitID       = 0;
                        _BDProjectFloorUnitEntity = new BDProjectFloorUnitEntity();
                        PrepareInitialView();
                        BindBDProjectFloorUnitList();
                        BindBDProjectFloorUnitFloorwiseList();

                        if (bDProjectFloorUnitEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Project Floor Unit Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Project Floor Unit Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (bDProjectFloorUnitEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Project Floor Unit Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Project Floor Unit Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }
        private Int64 DeleteTran(BDProjectFloorUnitEntity bDProjectFloorUnitEntity, String filterExpression, DatabaseOperationType option)
        {
            long         returnCode = -99;
            const string SP         = "dbo.BDProjectFloorUnit_SET";

            Database db = DatabaseFactory.CreateDatabase();


            using (DbCommand cmd = db.GetStoredProcCommand(SP))
            {
                AddOptionParameter(cmd, option);
                AddOutputParameter(cmd, db);
                AddFilterExpressionParameter(cmd, filterExpression, db);


                DbConnection connection = db.CreateConnection();
                connection.Open();
                DbTransaction transaction = connection.BeginTransaction();

                try
                {
                    using (IDataReader reader = db.ExecuteReader(cmd, transaction))
                    {
                        returnCode = GetReturnCodeFromParameter(cmd);
                    }

                    if (returnCode >= 0)
                    {
                        transaction.Commit();
                    }
                    else
                    {
                        throw new ArgumentException("Error Code." + returnCode.ToString());
                    }
                }
                catch (Exception ex)
                {
                    transaction.Rollback();
                    throw ex;
                }
                finally
                {
                    transaction.Dispose();
                    connection.Close();
                    connection = null;
                }
            }

            return(returnCode);
        }
Ejemplo n.º 4
0
        protected void lvBDProjectFloorUnit_ItemCommand(object sender, ListViewCommandEventArgs e)
        {
            Int64 ProjectFloorUnitID;

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

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

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

                        String fe = SqlExpressionBuilder.PrepareFilterExpression(BDProjectFloorUnitEntity.FLD_NAME_ProjectFloorUnitID, ProjectFloorUnitID.ToString(), SQLMatchType.Equal);

                        BDProjectFloorUnitEntity bDProjectFloorUnitEntity = new BDProjectFloorUnitEntity();


                        result = FCCBDProjectFloorUnit.GetFacadeCreate().Delete(bDProjectFloorUnitEntity, fe, DatabaseOperationType.Delete, TransactionRequired.No);

                        if (result == 0)
                        {
                            _ProjectFloorUnitID       = 0;
                            _BDProjectFloorUnitEntity = new BDProjectFloorUnitEntity();
                            PrepareInitialView();
                            BindBDProjectFloorUnitList();
                            BindBDProjectFloorUnitFloorwiseList();

                            MiscUtil.ShowMessage(lblMessage, "Project Floor Unit has been successfully deleted.", true);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to delete Project Floor Unit.", true);
                        }
                    }
                    catch (Exception ex)
                    {
                        MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                    }
                }
            }
        }
        private Int64 Delete(BDProjectFloorUnitEntity bDProjectFloorUnitEntity, String filterExpression, DatabaseOperationType option)
        {
            long         returnCode = -99;
            const string SP         = "dbo.BDProjectFloorUnit_SET";

            using (DbCommand cmd = Database.GetStoredProcCommand(SP))
            {
                AddOptionParameter(cmd, option);
                AddOutputParameter(cmd);
                AddFilterExpressionParameter(cmd, filterExpression);


                using (IDataReader reader = Database.ExecuteReader(cmd))
                {
                    returnCode = GetReturnCodeFromParameter(cmd);

                    switch (returnCode)
                    {
                    case SqlConstants.DB_STATUS_CODE_DATAALREADYEXIST:
                    {
                        throw new ArgumentException("BDProjectFloorUnitEntity already exists. Please specify another BDProjectFloorUnitEntity.");
                    }

                    case SqlConstants.DB_STATUS_CODE_DATAUPDATEDFROMOTHERSESSION:
                    {
                        throw new ArgumentException("BDProjectFloorUnitEntity data already updated from different session.");
                    }

                    case SqlConstants.DB_STATUS_CODE_FAIL_OPERATION:
                    {
                        throw new ArgumentException("BDProjectFloorUnitEntity already exists. Please specify another BDProjectFloorUnitEntity.");
                    }
                    }
                }
            }

            return(returnCode);
        }
Ejemplo n.º 6
0
 protected void btnAddNew_Click(object sender, EventArgs e)
 {
     _ProjectFloorUnitID       = 0;
     _BDProjectFloorUnitEntity = new BDProjectFloorUnitEntity();
     PrepareInitialView();
 }
Ejemplo n.º 7
0
        private BDProjectFloorUnitEntity BuildBDProjectFloorUnitEntity()
        {
            BDProjectFloorUnitEntity bDProjectFloorUnitEntity = CurrentBDProjectFloorUnitEntity;


            if (ddlProjectFloorID.Items.Count > 0)
            {
                if (ddlProjectFloorID.SelectedValue == "0")
                {
                }
                else
                {
                    bDProjectFloorUnitEntity.ProjectFloorID = Int64.Parse(ddlProjectFloorID.SelectedValue);
                }
            }

            if (ddlProjectFloorUnitTypeID.Items.Count > 0)
            {
                if (ddlProjectFloorUnitTypeID.SelectedValue == "0")
                {
                }
                else
                {
                    bDProjectFloorUnitEntity.ProjectFloorUnitTypeID = Int64.Parse(ddlProjectFloorUnitTypeID.SelectedValue);
                }
            }

            bDProjectFloorUnitEntity.ProjectFloorUnitName = txtProjectFloorUnitName.Text.Trim();
            if (ddlProjectFloorUnitStatusID.Items.Count > 0)
            {
                if (ddlProjectFloorUnitStatusID.SelectedValue == "0")
                {
                }
                else
                {
                    bDProjectFloorUnitEntity.ProjectFloorUnitStatusID = Int64.Parse(ddlProjectFloorUnitStatusID.SelectedValue);
                }
            }

            if (!txtUnitArea.Text.Trim().IsNullOrEmpty())
            {
                bDProjectFloorUnitEntity.UnitArea = Decimal.Parse(txtUnitArea.Text.Trim());
            }

            if (!txtTotalArea.Text.Trim().IsNullOrEmpty())
            {
                bDProjectFloorUnitEntity.TotalArea = Decimal.Parse(txtTotalArea.Text.Trim());
            }

            bDProjectFloorUnitEntity.Facing = txtFacing.Text.Trim();
            if (!txtToilet.Text.Trim().IsNullOrEmpty())
            {
                bDProjectFloorUnitEntity.Toilet = Decimal.Parse(txtToilet.Text.Trim());
            }

            if (!txtRegisteredArea.Text.Trim().IsNullOrEmpty())
            {
                bDProjectFloorUnitEntity.RegisteredArea = Decimal.Parse(txtRegisteredArea.Text.Trim());
            }
            else
            {
                bDProjectFloorUnitEntity.RegisteredArea = null;
            }

            if (!txtKitchen.Text.Trim().IsNullOrEmpty())
            {
                bDProjectFloorUnitEntity.Kitchen = Decimal.Parse(txtKitchen.Text.Trim());
            }

            if (!txtParking.Text.Trim().IsNullOrEmpty())
            {
                bDProjectFloorUnitEntity.Parking = Decimal.Parse(txtParking.Text.Trim());
            }

            if (!txtBathRoom.Text.Trim().IsNullOrEmpty())
            {
                bDProjectFloorUnitEntity.BathRoom = Decimal.Parse(txtBathRoom.Text.Trim());
            }

            if (!txtBedRoom.Text.Trim().IsNullOrEmpty())
            {
                bDProjectFloorUnitEntity.BedRoom = Decimal.Parse(txtBedRoom.Text.Trim());
            }

            if (!txtServantBed.Text.Trim().IsNullOrEmpty())
            {
                bDProjectFloorUnitEntity.ServantBed = Decimal.Parse(txtServantBed.Text.Trim());
            }

            if (!txtServantToilet.Text.Trim().IsNullOrEmpty())
            {
                bDProjectFloorUnitEntity.ServantToilet = Decimal.Parse(txtServantToilet.Text.Trim());
            }

            if (!txtCorridor.Text.Trim().IsNullOrEmpty())
            {
                bDProjectFloorUnitEntity.Corridor = Decimal.Parse(txtCorridor.Text.Trim());
            }

            if (!txtTapasGarden.Text.Trim().IsNullOrEmpty())
            {
                bDProjectFloorUnitEntity.TapasGarden = Decimal.Parse(txtTapasGarden.Text.Trim());
            }

            if (!txtSwimmingPool.Text.Trim().IsNullOrEmpty())
            {
                bDProjectFloorUnitEntity.SwimmingPool = Decimal.Parse(txtSwimmingPool.Text.Trim());
            }

            if (!txtFoyer.Text.Trim().IsNullOrEmpty())
            {
                bDProjectFloorUnitEntity.Foyer = Decimal.Parse(txtFoyer.Text.Trim());
            }

            if (!txtSittingRoom.Text.Trim().IsNullOrEmpty())
            {
                bDProjectFloorUnitEntity.SittingRoom = Decimal.Parse(txtSittingRoom.Text.Trim());
            }

            if (!txtDiningRoom.Text.Trim().IsNullOrEmpty())
            {
                bDProjectFloorUnitEntity.DiningRoom = Decimal.Parse(txtDiningRoom.Text.Trim());
            }

            if (!txtPantry.Text.Trim().IsNullOrEmpty())
            {
                bDProjectFloorUnitEntity.Pantry = Decimal.Parse(txtPantry.Text.Trim());
            }

            if (!txtBreakfastCorner.Text.Trim().IsNullOrEmpty())
            {
                bDProjectFloorUnitEntity.BreakfastCorner = Decimal.Parse(txtBreakfastCorner.Text.Trim());
            }

            if (!txtStudyRoom.Text.Trim().IsNullOrEmpty())
            {
                bDProjectFloorUnitEntity.StudyRoom = Decimal.Parse(txtStudyRoom.Text.Trim());
            }

            if (!txtStudy.Text.Trim().IsNullOrEmpty())
            {
                bDProjectFloorUnitEntity.Study = Decimal.Parse(txtStudy.Text.Trim());
            }

            if (!txtVerandah.Text.Trim().IsNullOrEmpty())
            {
                bDProjectFloorUnitEntity.Verandah = Decimal.Parse(txtVerandah.Text.Trim());
            }

            bDProjectFloorUnitEntity.IsIDServiceAvailable = chkIsIDServiceAvailable.Checked;

            bDProjectFloorUnitEntity.ElectricityService = chkElectricityService.Checked;

            bDProjectFloorUnitEntity.CommonGenerator = chkCommonGenerator.Checked;

            bDProjectFloorUnitEntity.WaterSupplyAvailable = chkWaterSupplyAvailable.Checked;

            if (!txtPricePerSft.Text.Trim().IsNullOrEmpty())
            {
                bDProjectFloorUnitEntity.PricePerSft = Decimal.Parse(txtPricePerSft.Text.Trim());
            }
            else
            {
                bDProjectFloorUnitEntity.PricePerSft = null;
            }

            if (!txtAreaPrice.Text.Trim().IsNullOrEmpty())
            {
                bDProjectFloorUnitEntity.AreaPrice = Decimal.Parse(txtAreaPrice.Text.Trim());
            }
            else
            {
                bDProjectFloorUnitEntity.AreaPrice = null;
            }

            if (!txtIDPrice.Text.Trim().IsNullOrEmpty())
            {
                bDProjectFloorUnitEntity.IDPrice = Decimal.Parse(txtIDPrice.Text.Trim());
            }
            else
            {
                bDProjectFloorUnitEntity.IDPrice = null;
            }

            if (!txtAdditionalCharges.Text.Trim().IsNullOrEmpty())
            {
                bDProjectFloorUnitEntity.AdditionalCharges = Decimal.Parse(txtAdditionalCharges.Text.Trim());
            }
            else
            {
                bDProjectFloorUnitEntity.AdditionalCharges = null;
            }

            #region Civil Image Url

            String CivilImageUrlpath;

            if (fuCivilDrawingImageUrl.HasFile == true && bDProjectFloorUnitEntity.CivilDrawingImageUrl.IsNotNullOrEmpty())
            {
                if (File.Exists(Server.MapPath(bDProjectFloorUnitEntity.CivilDrawingImageUrl)))
                {
                    File.Delete(Server.MapPath(bDProjectFloorUnitEntity.CivilDrawingImageUrl));
                }
                CivilImageUrlpath = FileUploadConstants.Project.PROJECT_FLOOR_DESIGN + Guid.NewGuid() + fuCivilDrawingImageUrl.FileName;
                fuCivilDrawingImageUrl.SaveAs(Server.MapPath(CivilImageUrlpath));
                bDProjectFloorUnitEntity.CivilDrawingImageUrl = CivilImageUrlpath;
            }

            if (bDProjectFloorUnitEntity.CivilDrawingImageUrl.IsNotNullOrEmpty() && fuCivilDrawingImageUrl.HasFile == false)
            {
                bDProjectFloorUnitEntity.CivilDrawingImageUrl = bDProjectFloorUnitEntity.CivilDrawingImageUrl;
            }

            if (fuCivilDrawingImageUrl.HasFile == false && bDProjectFloorUnitEntity.CivilDrawingImageUrl.IsNullOrEmpty())
            {
                bDProjectFloorUnitEntity.CivilDrawingImageUrl = null;
            }

            if (fuCivilDrawingImageUrl.HasFile == true && bDProjectFloorUnitEntity.CivilDrawingImageUrl.IsNullOrEmpty())
            {
                CivilImageUrlpath = FileUploadConstants.Project.PROJECT_FLOOR_DESIGN + Guid.NewGuid() + fuCivilDrawingImageUrl.FileName;
                fuCivilDrawingImageUrl.SaveAs(Server.MapPath(CivilImageUrlpath));
                bDProjectFloorUnitEntity.CivilDrawingImageUrl = CivilImageUrlpath;
            }

            #endregion

            #region Electrical Image Url

            String ElectricalDrawingImageUrl;

            if (fuElectricalDrawingImageUrl.HasFile == true && bDProjectFloorUnitEntity.ElectricalDrawingImageUrl.IsNotNullOrEmpty())
            {
                if (File.Exists(Server.MapPath(bDProjectFloorUnitEntity.ElectricalDrawingImageUrl)))
                {
                    File.Delete(Server.MapPath(bDProjectFloorUnitEntity.ElectricalDrawingImageUrl));
                }
                ElectricalDrawingImageUrl = FileUploadConstants.Project.PROJECT_FLOOR_DESIGN + Guid.NewGuid() + fuElectricalDrawingImageUrl.FileName;
                fuElectricalDrawingImageUrl.SaveAs(Server.MapPath(ElectricalDrawingImageUrl));
                bDProjectFloorUnitEntity.ElectricalDrawingImageUrl = ElectricalDrawingImageUrl;
            }

            if (bDProjectFloorUnitEntity.ElectricalDrawingImageUrl.IsNotNullOrEmpty() && fuElectricalDrawingImageUrl.HasFile == false)
            {
                bDProjectFloorUnitEntity.ElectricalDrawingImageUrl = bDProjectFloorUnitEntity.ElectricalDrawingImageUrl;
            }

            if (fuElectricalDrawingImageUrl.HasFile == false && bDProjectFloorUnitEntity.ElectricalDrawingImageUrl.IsNullOrEmpty())
            {
                bDProjectFloorUnitEntity.ElectricalDrawingImageUrl = null;
            }

            if (fuElectricalDrawingImageUrl.HasFile == true && bDProjectFloorUnitEntity.ElectricalDrawingImageUrl.IsNullOrEmpty())
            {
                ElectricalDrawingImageUrl = FileUploadConstants.Project.PROJECT_FLOOR_DESIGN + Guid.NewGuid() + fuElectricalDrawingImageUrl.FileName;
                fuElectricalDrawingImageUrl.SaveAs(Server.MapPath(ElectricalDrawingImageUrl));
                bDProjectFloorUnitEntity.ElectricalDrawingImageUrl = ElectricalDrawingImageUrl;
            }

            #endregion

            #region Interior Image Url

            String InteriorDrawingImageUrl;

            if (fuInteriorDrawingImageUrl.HasFile == true && bDProjectFloorUnitEntity.InteriorDrawingImageUrl.IsNotNullOrEmpty())
            {
                if (File.Exists(Server.MapPath(bDProjectFloorUnitEntity.InteriorDrawingImageUrl)))
                {
                    File.Delete(Server.MapPath(bDProjectFloorUnitEntity.InteriorDrawingImageUrl));
                }
                InteriorDrawingImageUrl = FileUploadConstants.Project.PROJECT_FLOOR_DESIGN + Guid.NewGuid() + fuInteriorDrawingImageUrl.FileName;
                fuInteriorDrawingImageUrl.SaveAs(Server.MapPath(InteriorDrawingImageUrl));
                bDProjectFloorUnitEntity.InteriorDrawingImageUrl = InteriorDrawingImageUrl;
            }

            if (bDProjectFloorUnitEntity.InteriorDrawingImageUrl.IsNotNullOrEmpty() && fuInteriorDrawingImageUrl.HasFile == false)
            {
                bDProjectFloorUnitEntity.InteriorDrawingImageUrl = bDProjectFloorUnitEntity.InteriorDrawingImageUrl;
            }

            if (fuInteriorDrawingImageUrl.HasFile == false && bDProjectFloorUnitEntity.InteriorDrawingImageUrl.IsNullOrEmpty())
            {
                bDProjectFloorUnitEntity.InteriorDrawingImageUrl = null;
            }

            if (fuInteriorDrawingImageUrl.HasFile == true && bDProjectFloorUnitEntity.InteriorDrawingImageUrl.IsNullOrEmpty())
            {
                InteriorDrawingImageUrl = FileUploadConstants.Project.PROJECT_FLOOR_DESIGN + Guid.NewGuid() + fuInteriorDrawingImageUrl.FileName;
                fuInteriorDrawingImageUrl.SaveAs(Server.MapPath(InteriorDrawingImageUrl));
                bDProjectFloorUnitEntity.InteriorDrawingImageUrl = InteriorDrawingImageUrl;
            }

            #endregion

            #region Mechanical Drawing Image Url

            String MechanicalDrawingImageUrl;

            if (fuMechanicalDrawingImageUrl.HasFile == true && bDProjectFloorUnitEntity.MechanicalDrawingImageUrl.IsNotNullOrEmpty())
            {
                if (File.Exists(Server.MapPath(bDProjectFloorUnitEntity.MechanicalDrawingImageUrl)))
                {
                    File.Delete(Server.MapPath(bDProjectFloorUnitEntity.MechanicalDrawingImageUrl));
                }
                MechanicalDrawingImageUrl = FileUploadConstants.Project.PROJECT_FLOOR_DESIGN + Guid.NewGuid() + fuMechanicalDrawingImageUrl.FileName;
                fuMechanicalDrawingImageUrl.SaveAs(Server.MapPath(MechanicalDrawingImageUrl));
                bDProjectFloorUnitEntity.MechanicalDrawingImageUrl = MechanicalDrawingImageUrl;
            }

            if (bDProjectFloorUnitEntity.MechanicalDrawingImageUrl.IsNotNullOrEmpty() && fuMechanicalDrawingImageUrl.HasFile == false)
            {
                bDProjectFloorUnitEntity.MechanicalDrawingImageUrl = bDProjectFloorUnitEntity.MechanicalDrawingImageUrl;
            }

            if (fuMechanicalDrawingImageUrl.HasFile == false && bDProjectFloorUnitEntity.MechanicalDrawingImageUrl.IsNullOrEmpty())
            {
                bDProjectFloorUnitEntity.MechanicalDrawingImageUrl = null;
            }

            if (fuMechanicalDrawingImageUrl.HasFile == true && bDProjectFloorUnitEntity.MechanicalDrawingImageUrl.IsNullOrEmpty())
            {
                MechanicalDrawingImageUrl = FileUploadConstants.Project.PROJECT_FLOOR_DESIGN + Guid.NewGuid() + fuMechanicalDrawingImageUrl.FileName;
                fuMechanicalDrawingImageUrl.SaveAs(Server.MapPath(MechanicalDrawingImageUrl));
                bDProjectFloorUnitEntity.MechanicalDrawingImageUrl = MechanicalDrawingImageUrl;
            }

            #endregion

            #region Plumbing Drawing Image Url

            String PlumbingDrawingImageUrlpath;

            if (fuPlumbingDrawingImageUrl.HasFile == true && bDProjectFloorUnitEntity.PlumbingDrawingImageUrl.IsNotNullOrEmpty())
            {
                if (File.Exists(Server.MapPath(bDProjectFloorUnitEntity.PlumbingDrawingImageUrl)))
                {
                    File.Delete(Server.MapPath(bDProjectFloorUnitEntity.PlumbingDrawingImageUrl));
                }
                PlumbingDrawingImageUrlpath = FileUploadConstants.Project.PROJECT_FLOOR_DESIGN + Guid.NewGuid() + fuPlumbingDrawingImageUrl.FileName;
                fuPlumbingDrawingImageUrl.SaveAs(Server.MapPath(PlumbingDrawingImageUrlpath));
                bDProjectFloorUnitEntity.PlumbingDrawingImageUrl = PlumbingDrawingImageUrlpath;
            }

            if (bDProjectFloorUnitEntity.PlumbingDrawingImageUrl.IsNotNullOrEmpty() && fuPlumbingDrawingImageUrl.HasFile == false)
            {
                bDProjectFloorUnitEntity.PlumbingDrawingImageUrl = bDProjectFloorUnitEntity.PlumbingDrawingImageUrl;
            }

            if (fuPlumbingDrawingImageUrl.HasFile == false && bDProjectFloorUnitEntity.PlumbingDrawingImageUrl.IsNullOrEmpty())
            {
                bDProjectFloorUnitEntity.PlumbingDrawingImageUrl = null;
            }

            if (fuPlumbingDrawingImageUrl.HasFile == true && bDProjectFloorUnitEntity.PlumbingDrawingImageUrl.IsNullOrEmpty())
            {
                PlumbingDrawingImageUrlpath = FileUploadConstants.Project.PROJECT_FLOOR_DESIGN + Guid.NewGuid() + fuPlumbingDrawingImageUrl.FileName;
                fuPlumbingDrawingImageUrl.SaveAs(Server.MapPath(PlumbingDrawingImageUrlpath));
                bDProjectFloorUnitEntity.PlumbingDrawingImageUrl = PlumbingDrawingImageUrlpath;
            }

            #endregion

            #region Others Drawing Image Url

            String OthersDrawingImageUrlpath;

            if (fuOthersDrawingImageUrl.HasFile == true && bDProjectFloorUnitEntity.OthersDrawingImageUrl.IsNotNullOrEmpty())
            {
                if (File.Exists(Server.MapPath(bDProjectFloorUnitEntity.OthersDrawingImageUrl)))
                {
                    File.Delete(Server.MapPath(bDProjectFloorUnitEntity.OthersDrawingImageUrl));
                }
                OthersDrawingImageUrlpath = FileUploadConstants.Project.PROJECT_FLOOR_DESIGN + Guid.NewGuid() + fuOthersDrawingImageUrl.FileName;
                fuOthersDrawingImageUrl.SaveAs(Server.MapPath(OthersDrawingImageUrlpath));
                bDProjectFloorUnitEntity.OthersDrawingImageUrl = OthersDrawingImageUrlpath;
            }

            if (bDProjectFloorUnitEntity.OthersDrawingImageUrl.IsNotNullOrEmpty() && fuOthersDrawingImageUrl.HasFile == false)
            {
                bDProjectFloorUnitEntity.OthersDrawingImageUrl = bDProjectFloorUnitEntity.OthersDrawingImageUrl;
            }

            if (fuOthersDrawingImageUrl.HasFile == false && bDProjectFloorUnitEntity.OthersDrawingImageUrl.IsNullOrEmpty())
            {
                bDProjectFloorUnitEntity.OthersDrawingImageUrl = null;
            }

            if (fuOthersDrawingImageUrl.HasFile == true && bDProjectFloorUnitEntity.OthersDrawingImageUrl.IsNullOrEmpty())
            {
                OthersDrawingImageUrlpath = FileUploadConstants.Project.PROJECT_FLOOR_DESIGN + Guid.NewGuid() + fuOthersDrawingImageUrl.FileName;
                fuPlumbingDrawingImageUrl.SaveAs(Server.MapPath(OthersDrawingImageUrlpath));
                bDProjectFloorUnitEntity.OthersDrawingImageUrl = OthersDrawingImageUrlpath;
            }

            #endregion

            bDProjectFloorUnitEntity.Features  = txtFeatures.Text.Trim();
            bDProjectFloorUnitEntity.IsRemoved = chkIsRemoved.Checked;


            return(bDProjectFloorUnitEntity);
        }
Ejemplo n.º 8
0
        private void PrepareEditView()
        {
            BDProjectFloorUnitEntity bDProjectFloorUnitEntity = CurrentBDProjectFloorUnitEntity;


            if (!bDProjectFloorUnitEntity.IsNew)
            {
                BuildProjectFloorByProjectID();

                if (ddlProjectFloorID.Items.Count > 0 && bDProjectFloorUnitEntity.ProjectFloorID != null)
                {
                    ddlProjectFloorID.SelectedValue = bDProjectFloorUnitEntity.ProjectFloorID.ToString();
                }

                if (ddlProjectFloorUnitTypeID.Items.Count > 0 && bDProjectFloorUnitEntity.ProjectFloorUnitTypeID != null)
                {
                    ddlProjectFloorUnitTypeID.SelectedValue = bDProjectFloorUnitEntity.ProjectFloorUnitTypeID.ToString();
                }

                txtProjectFloorUnitName.Text = bDProjectFloorUnitEntity.ProjectFloorUnitName.ToString();
                if (ddlProjectFloorUnitStatusID.Items.Count > 0 && bDProjectFloorUnitEntity.ProjectFloorUnitStatusID != null)
                {
                    ddlProjectFloorUnitStatusID.SelectedValue = bDProjectFloorUnitEntity.ProjectFloorUnitStatusID.ToString();
                }

                txtUnitArea.Text                = bDProjectFloorUnitEntity.UnitArea.ToString();
                txtTotalArea.Text               = bDProjectFloorUnitEntity.TotalArea.ToString();
                txtRegisteredArea.Text          = bDProjectFloorUnitEntity.RegisteredArea.ToString();
                txtFacing.Text                  = bDProjectFloorUnitEntity.Facing.ToString();
                txtToilet.Text                  = bDProjectFloorUnitEntity.Toilet.ToString();
                txtKitchen.Text                 = bDProjectFloorUnitEntity.Kitchen.ToString();
                txtParking.Text                 = bDProjectFloorUnitEntity.Parking.ToString();
                txtBathRoom.Text                = bDProjectFloorUnitEntity.BathRoom.ToString();
                txtBedRoom.Text                 = bDProjectFloorUnitEntity.BedRoom.ToString();
                txtServantBed.Text              = bDProjectFloorUnitEntity.ServantBed.ToString();
                txtServantToilet.Text           = bDProjectFloorUnitEntity.ServantToilet.ToString();
                txtCorridor.Text                = bDProjectFloorUnitEntity.Corridor.ToString();
                txtTapasGarden.Text             = bDProjectFloorUnitEntity.TapasGarden.ToString();
                txtSwimmingPool.Text            = bDProjectFloorUnitEntity.SwimmingPool.ToString();
                txtFoyer.Text                   = bDProjectFloorUnitEntity.Foyer.ToString();
                txtSittingRoom.Text             = bDProjectFloorUnitEntity.SittingRoom.ToString();
                txtDiningRoom.Text              = bDProjectFloorUnitEntity.DiningRoom.ToString();
                txtPantry.Text                  = bDProjectFloorUnitEntity.Pantry.ToString();
                txtBreakfastCorner.Text         = bDProjectFloorUnitEntity.BreakfastCorner.ToString();
                txtStudyRoom.Text               = bDProjectFloorUnitEntity.StudyRoom.ToString();
                txtStudy.Text                   = bDProjectFloorUnitEntity.Study.ToString();
                txtVerandah.Text                = bDProjectFloorUnitEntity.Verandah.ToString();
                chkIsIDServiceAvailable.Checked = bDProjectFloorUnitEntity.IsIDServiceAvailable;
                chkElectricityService.Checked   = bDProjectFloorUnitEntity.ElectricityService;
                chkCommonGenerator.Checked      = bDProjectFloorUnitEntity.CommonGenerator;
                if (bDProjectFloorUnitEntity.WaterSupplyAvailable != null)
                {
                    chkWaterSupplyAvailable.Checked = Convert.ToBoolean(bDProjectFloorUnitEntity.WaterSupplyAvailable);
                }
                else
                {
                    chkWaterSupplyAvailable.Checked = false;
                }
                txtPricePerSft.Text       = bDProjectFloorUnitEntity.PricePerSft.ToString();
                txtAreaPrice.Text         = bDProjectFloorUnitEntity.AreaPrice.ToString();
                txtIDPrice.Text           = bDProjectFloorUnitEntity.IDPrice.ToString();
                txtAdditionalCharges.Text = bDProjectFloorUnitEntity.AdditionalCharges.ToString();
                txtFeatures.Text          = bDProjectFloorUnitEntity.Features.ToString();
                chkIsRemoved.Checked      = bDProjectFloorUnitEntity.IsRemoved;

                btnSubmit.Text    = "Update";
                btnAddNew.Visible = true;
            }
        }
        private Int64 Add(BDProjectFloorUnitEntity bDProjectFloorUnitEntity, DatabaseOperationType option)
        {
            long         returnCode = -99;
            const string SP         = "dbo.BDProjectFloorUnit_SET";

            using (DbCommand cmd = Database.GetStoredProcCommand(SP))
            {
                AddOptionParameter(cmd, option);
                AddOutputParameter(cmd);
                AddNullPrimaryKeyParameter(cmd, "ProjectFloorUnitID");

                Database.AddInParameter(cmd, "@ProjectFloorID", DbType.Int64, bDProjectFloorUnitEntity.ProjectFloorID);
                Database.AddInParameter(cmd, "@ProjectFloorUnitTypeID", DbType.Int64, bDProjectFloorUnitEntity.ProjectFloorUnitTypeID);
                Database.AddInParameter(cmd, "@ProjectFloorUnitName", DbType.String, bDProjectFloorUnitEntity.ProjectFloorUnitName);
                Database.AddInParameter(cmd, "@ProjectFloorUnitStatusID", DbType.Int64, bDProjectFloorUnitEntity.ProjectFloorUnitStatusID);
                Database.AddInParameter(cmd, "@UnitArea", DbType.Decimal, bDProjectFloorUnitEntity.UnitArea);
                Database.AddInParameter(cmd, "@TotalArea", DbType.Decimal, bDProjectFloorUnitEntity.TotalArea);
                Database.AddInParameter(cmd, "@RegisteredArea", DbType.Decimal, bDProjectFloorUnitEntity.RegisteredArea);
                Database.AddInParameter(cmd, "@Facing", DbType.String, bDProjectFloorUnitEntity.Facing);
                Database.AddInParameter(cmd, "@Toilet", DbType.Decimal, bDProjectFloorUnitEntity.Toilet);
                Database.AddInParameter(cmd, "@Kitchen", DbType.Decimal, bDProjectFloorUnitEntity.Kitchen);
                Database.AddInParameter(cmd, "@Parking", DbType.Decimal, bDProjectFloorUnitEntity.Parking);
                Database.AddInParameter(cmd, "@BathRoom", DbType.Decimal, bDProjectFloorUnitEntity.BathRoom);
                Database.AddInParameter(cmd, "@BedRoom", DbType.Decimal, bDProjectFloorUnitEntity.BedRoom);
                Database.AddInParameter(cmd, "@ServantBed", DbType.Decimal, bDProjectFloorUnitEntity.ServantBed);
                Database.AddInParameter(cmd, "@ServantToilet", DbType.Decimal, bDProjectFloorUnitEntity.ServantToilet);
                Database.AddInParameter(cmd, "@Corridor", DbType.Decimal, bDProjectFloorUnitEntity.Corridor);
                Database.AddInParameter(cmd, "@TapasGarden", DbType.Decimal, bDProjectFloorUnitEntity.TapasGarden);
                Database.AddInParameter(cmd, "@SwimmingPool", DbType.Decimal, bDProjectFloorUnitEntity.SwimmingPool);
                Database.AddInParameter(cmd, "@IsIDServiceAvailable", DbType.Boolean, bDProjectFloorUnitEntity.IsIDServiceAvailable);
                Database.AddInParameter(cmd, "@ElectricityService", DbType.Boolean, bDProjectFloorUnitEntity.ElectricityService);
                Database.AddInParameter(cmd, "@CommonGenerator", DbType.Boolean, bDProjectFloorUnitEntity.CommonGenerator);
                Database.AddInParameter(cmd, "@PricePerSft", DbType.Decimal, bDProjectFloorUnitEntity.PricePerSft);
                Database.AddInParameter(cmd, "@AreaPrice", DbType.Decimal, bDProjectFloorUnitEntity.AreaPrice);
                Database.AddInParameter(cmd, "@IDPrice", DbType.Decimal, bDProjectFloorUnitEntity.IDPrice);
                Database.AddInParameter(cmd, "@AdditionalCharges", DbType.Decimal, bDProjectFloorUnitEntity.AdditionalCharges);
                Database.AddInParameter(cmd, "@Features", DbType.String, bDProjectFloorUnitEntity.Features);
                Database.AddInParameter(cmd, "@CivilDrawingImageUrl", DbType.String, bDProjectFloorUnitEntity.CivilDrawingImageUrl);
                Database.AddInParameter(cmd, "@ElectricalDrawingImageUrl", DbType.String, bDProjectFloorUnitEntity.ElectricalDrawingImageUrl);
                Database.AddInParameter(cmd, "@InteriorDrawingImageUrl", DbType.String, bDProjectFloorUnitEntity.InteriorDrawingImageUrl);
                Database.AddInParameter(cmd, "@MechanicalDrawingImageUrl", DbType.String, bDProjectFloorUnitEntity.MechanicalDrawingImageUrl);
                Database.AddInParameter(cmd, "@PlumbingDrawingImageUrl", DbType.String, bDProjectFloorUnitEntity.PlumbingDrawingImageUrl);
                Database.AddInParameter(cmd, "@OthersDrawingImageUrl", DbType.String, bDProjectFloorUnitEntity.OthersDrawingImageUrl);
                Database.AddInParameter(cmd, "@Foyer", DbType.Decimal, bDProjectFloorUnitEntity.Foyer);
                Database.AddInParameter(cmd, "@SittingRoom", DbType.Decimal, bDProjectFloorUnitEntity.SittingRoom);
                Database.AddInParameter(cmd, "@DiningRoom", DbType.Decimal, bDProjectFloorUnitEntity.DiningRoom);
                Database.AddInParameter(cmd, "@Pantry", DbType.Decimal, bDProjectFloorUnitEntity.Pantry);
                Database.AddInParameter(cmd, "@BreakfastCorner", DbType.Decimal, bDProjectFloorUnitEntity.BreakfastCorner);
                Database.AddInParameter(cmd, "@StudyRoom", DbType.Decimal, bDProjectFloorUnitEntity.StudyRoom);
                Database.AddInParameter(cmd, "@Study", DbType.Decimal, bDProjectFloorUnitEntity.Study);
                Database.AddInParameter(cmd, "@Verandah", DbType.Decimal, bDProjectFloorUnitEntity.Verandah);
                Database.AddInParameter(cmd, "@WaterSupplyAvailable", DbType.Boolean, bDProjectFloorUnitEntity.WaterSupplyAvailable);
                Database.AddInParameter(cmd, "@IsRemoved", DbType.Boolean, bDProjectFloorUnitEntity.IsRemoved);

                using (IDataReader reader = Database.ExecuteReader(cmd))
                {
                    returnCode = GetReturnCodeFromParameter(cmd);

                    switch (returnCode)
                    {
                    case SqlConstants.DB_STATUS_CODE_DATAALREADYEXIST:
                    {
                        throw new ArgumentException("BDProjectFloorUnitEntity already exists. Please specify another BDProjectFloorUnitEntity.");
                    }

                    case SqlConstants.DB_STATUS_CODE_DATAUPDATEDFROMOTHERSESSION:
                    {
                        throw new ArgumentException("BDProjectFloorUnitEntity data already updated from different session.");
                    }

                    case SqlConstants.DB_STATUS_CODE_FAIL_OPERATION:
                    {
                        throw new ArgumentException("BDProjectFloorUnitEntity already exists. Please specify another BDProjectFloorUnitEntity.");
                    }
                    }
                }
            }

            return(returnCode);
        }
        private Int64 UpdateTran(BDProjectFloorUnitEntity bDProjectFloorUnitEntity, String filterExpression, DatabaseOperationType option)
        {
            long         returnCode = -99;
            const string SP         = "dbo.BDProjectFloorUnit_SET";

            Database db = DatabaseFactory.CreateDatabase();

            using (DbCommand cmd = db.GetStoredProcCommand(SP))
            {
                AddOptionParameter(cmd, option, db);
                AddOutputParameter(cmd, db);
                AddFilterExpressionParameter(cmd, filterExpression, db);

                db.AddInParameter(cmd, "@ProjectFloorUnitID", DbType.Int64, bDProjectFloorUnitEntity.ProjectFloorUnitID);
                db.AddInParameter(cmd, "@ProjectFloorID", DbType.Int64, bDProjectFloorUnitEntity.ProjectFloorID);
                db.AddInParameter(cmd, "@ProjectFloorUnitTypeID", DbType.Int64, bDProjectFloorUnitEntity.ProjectFloorUnitTypeID);
                db.AddInParameter(cmd, "@ProjectFloorUnitName", DbType.String, bDProjectFloorUnitEntity.ProjectFloorUnitName);
                db.AddInParameter(cmd, "@ProjectFloorUnitStatusID", DbType.Int64, bDProjectFloorUnitEntity.ProjectFloorUnitStatusID);
                db.AddInParameter(cmd, "@UnitArea", DbType.Decimal, bDProjectFloorUnitEntity.UnitArea);
                db.AddInParameter(cmd, "@TotalArea", DbType.Decimal, bDProjectFloorUnitEntity.TotalArea);
                db.AddInParameter(cmd, "@RegisteredArea", DbType.Decimal, bDProjectFloorUnitEntity.RegisteredArea);
                db.AddInParameter(cmd, "@Facing", DbType.String, bDProjectFloorUnitEntity.Facing);
                db.AddInParameter(cmd, "@Toilet", DbType.Decimal, bDProjectFloorUnitEntity.Toilet);
                db.AddInParameter(cmd, "@Kitchen", DbType.Decimal, bDProjectFloorUnitEntity.Kitchen);
                db.AddInParameter(cmd, "@Parking", DbType.Decimal, bDProjectFloorUnitEntity.Parking);
                db.AddInParameter(cmd, "@BathRoom", DbType.Decimal, bDProjectFloorUnitEntity.BathRoom);
                db.AddInParameter(cmd, "@BedRoom", DbType.Decimal, bDProjectFloorUnitEntity.BedRoom);
                db.AddInParameter(cmd, "@ServantBed", DbType.Decimal, bDProjectFloorUnitEntity.ServantBed);
                db.AddInParameter(cmd, "@ServantToilet", DbType.Decimal, bDProjectFloorUnitEntity.ServantToilet);
                db.AddInParameter(cmd, "@Corridor", DbType.Decimal, bDProjectFloorUnitEntity.Corridor);
                db.AddInParameter(cmd, "@TapasGarden", DbType.Decimal, bDProjectFloorUnitEntity.TapasGarden);
                db.AddInParameter(cmd, "@SwimmingPool", DbType.Decimal, bDProjectFloorUnitEntity.SwimmingPool);
                db.AddInParameter(cmd, "@IsIDServiceAvailable", DbType.Boolean, bDProjectFloorUnitEntity.IsIDServiceAvailable);
                db.AddInParameter(cmd, "@ElectricityService", DbType.Boolean, bDProjectFloorUnitEntity.ElectricityService);
                db.AddInParameter(cmd, "@CommonGenerator", DbType.Boolean, bDProjectFloorUnitEntity.CommonGenerator);
                db.AddInParameter(cmd, "@PricePerSft", DbType.Decimal, bDProjectFloorUnitEntity.PricePerSft);
                db.AddInParameter(cmd, "@AreaPrice", DbType.Decimal, bDProjectFloorUnitEntity.AreaPrice);
                db.AddInParameter(cmd, "@IDPrice", DbType.Decimal, bDProjectFloorUnitEntity.IDPrice);
                db.AddInParameter(cmd, "@AdditionalCharges", DbType.Decimal, bDProjectFloorUnitEntity.AdditionalCharges);
                db.AddInParameter(cmd, "@Features", DbType.String, bDProjectFloorUnitEntity.Features);
                db.AddInParameter(cmd, "@CivilDrawingImageUrl", DbType.String, bDProjectFloorUnitEntity.CivilDrawingImageUrl);
                db.AddInParameter(cmd, "@ElectricalDrawingImageUrl", DbType.String, bDProjectFloorUnitEntity.ElectricalDrawingImageUrl);
                db.AddInParameter(cmd, "@InteriorDrawingImageUrl", DbType.String, bDProjectFloorUnitEntity.InteriorDrawingImageUrl);
                db.AddInParameter(cmd, "@MechanicalDrawingImageUrl", DbType.String, bDProjectFloorUnitEntity.MechanicalDrawingImageUrl);
                db.AddInParameter(cmd, "@PlumbingDrawingImageUrl", DbType.String, bDProjectFloorUnitEntity.PlumbingDrawingImageUrl);
                db.AddInParameter(cmd, "@OthersDrawingImageUrl", DbType.String, bDProjectFloorUnitEntity.OthersDrawingImageUrl);
                db.AddInParameter(cmd, "@Foyer", DbType.Decimal, bDProjectFloorUnitEntity.Foyer);
                db.AddInParameter(cmd, "@SittingRoom", DbType.Decimal, bDProjectFloorUnitEntity.SittingRoom);
                db.AddInParameter(cmd, "@DiningRoom", DbType.Decimal, bDProjectFloorUnitEntity.DiningRoom);
                db.AddInParameter(cmd, "@Pantry", DbType.Decimal, bDProjectFloorUnitEntity.Pantry);
                db.AddInParameter(cmd, "@BreakfastCorner", DbType.Decimal, bDProjectFloorUnitEntity.BreakfastCorner);
                db.AddInParameter(cmd, "@StudyRoom", DbType.Decimal, bDProjectFloorUnitEntity.StudyRoom);
                db.AddInParameter(cmd, "@Study", DbType.Decimal, bDProjectFloorUnitEntity.Study);
                db.AddInParameter(cmd, "@Verandah", DbType.Decimal, bDProjectFloorUnitEntity.Verandah);
                db.AddInParameter(cmd, "@WaterSupplyAvailable", DbType.Boolean, bDProjectFloorUnitEntity.WaterSupplyAvailable);
                db.AddInParameter(cmd, "@IsRemoved", DbType.Boolean, bDProjectFloorUnitEntity.IsRemoved);

                DbConnection connection = db.CreateConnection();
                connection.Open();
                DbTransaction transaction = connection.BeginTransaction();

                try
                {
                    using (IDataReader reader = db.ExecuteReader(cmd, transaction))
                    {
                        returnCode = GetReturnCodeFromParameter(cmd);
                    }

                    if (returnCode > 0)
                    {
                        transaction.Commit();
                    }
                    else
                    {
                        throw new ArgumentException("Error Code." + returnCode.ToString());
                    }
                }
                catch (Exception ex)
                {
                    transaction.Rollback();
                    throw ex;
                }
                finally
                {
                    transaction.Dispose();
                    connection.Close();
                    connection = null;
                }
            }

            return(returnCode);
        }
Ejemplo n.º 11
0
 Int64 IBDProjectFloorUnitFacade.Delete(BDProjectFloorUnitEntity bDProjectFloorUnitEntity, String filterExpression, DatabaseOperationType option, TransactionRequired reqTran)
 {
     return(DataAccessFactory.CreateBDProjectFloorUnitDataAccess().Delete(bDProjectFloorUnitEntity, filterExpression, option, reqTran));
 }
Ejemplo n.º 12
0
 Int64 IBDProjectFloorUnitFacade.Add(BDProjectFloorUnitEntity bDProjectFloorUnitEntity, DatabaseOperationType option, TransactionRequired reqTran)
 {
     return(DataAccessFactory.CreateBDProjectFloorUnitDataAccess().Add(bDProjectFloorUnitEntity, option, reqTran));
 }
Ejemplo n.º 13
0
        private void SaveCRMBuyerBookSpaceEntity()
        {
            if (IsValid)
            {
                try
                {
                    CRMBuyerBookSpaceEntity cRMBuyerBookSpaceEntity = BuildCRMBuyerBookSpaceEntity();

                    Int64 result = -1;

                    if (cRMBuyerBookSpaceEntity.IsNew)
                    {
                        result = FCCCRMBuyerBookSpace.GetFacadeCreate().Add(cRMBuyerBookSpaceEntity, DatabaseOperationType.Add, TransactionRequired.No);
                    }
                    else
                    {
                        String filterExpression = SqlExpressionBuilder.PrepareFilterExpression(CRMBuyerBookSpaceEntity.FLD_NAME_BuyerBookSpaceID, cRMBuyerBookSpaceEntity.BuyerBookSpaceID.ToString(), SQLMatchType.Equal);
                        result = FCCCRMBuyerBookSpace.GetFacadeCreate().Update(cRMBuyerBookSpaceEntity, filterExpression, DatabaseOperationType.Update, TransactionRequired.No);
                    }

                    if (result > 0)
                    {
                        #region Project Floor Unit Update Info

                        BDProjectFloorUnitEntity bDProjectFloorUnitEntity = FCCBDProjectFloorUnit.GetFacadeCreate().GetByID(cRMBuyerBookSpaceEntity.ProjectFloorUnitID);
                        bDProjectFloorUnitEntity.ProjectFloorUnitStatusID = MasterDataConstants.MDProjectFloorUnitStatus.ALLOCATED;

                        String fe_floorUnit = SqlExpressionBuilder.PrepareFilterExpression(BDProjectFloorUnitEntity.FLD_NAME_ProjectFloorUnitID, cRMBuyerBookSpaceEntity.ProjectFloorUnitID.ToString(), SQLMatchType.Equal);

                        FCCBDProjectFloorUnit.GetFacadeCreate().Update(bDProjectFloorUnitEntity, fe_floorUnit, DatabaseOperationType.Update, TransactionRequired.No);

                        #endregion

                        PrepareLabel(false);
                        _BuyerBookSpaceID        = 0;
                        _CRMBuyerBookSpaceEntity = new CRMBuyerBookSpaceEntity();
                        PrepareInitialView();
                        BindCRMBuyerBookSpaceList();

                        if (cRMBuyerBookSpaceEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Buyer Book Space Information has been added successfully.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Buyer Book Space Information has been updated successfully.", false);
                        }
                    }
                    else
                    {
                        if (cRMBuyerBookSpaceEntity.IsNew)
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to add Buyer Book Space Information.", false);
                        }
                        else
                        {
                            MiscUtil.ShowMessage(lblMessage, "Failed to update Buyer Book Space Information.", false);
                        }
                    }
                }
                catch (Exception ex)
                {
                    MiscUtil.ShowMessage(lblMessage, ex.Message, true);
                }
            }
        }