partial void DeleteBudgetEntry(BudgetEntry instance);
 partial void UpdateBudgetEntry(BudgetEntry instance);
		private void detach_BudgetEntries(BudgetEntry entity)
		{
			this.SendPropertyChanging();
			entity.HotelBudget = null;
		}
 partial void InsertBudgetEntry(BudgetEntry instance);
Example #5
0
        protected void JqGridDataEntry_RowEditing(object sender, JQGridRowEditEventArgs e)
        {
            var budgetEntryId = e.RowKey;
            var hotelEntryId = e.RowData["HotelEntryId"] == "" ? 0 : Convert.ToInt32(e.RowData["HotelEntryId"]);
            var roomBudget = string.IsNullOrEmpty(e.RowData["RoomBudget"]) ? 0.00 : Convert.ToDouble(e.RowData["RoomBudget"]);
            var fbBudget = string.IsNullOrEmpty(e.RowData["FBBudget"]) ? 0.00 : Convert.ToDouble(e.RowData["FBBudget"]);
            var spa = string.IsNullOrEmpty(e.RowData["SpaBudget"]) ? 0.00 : Convert.ToDouble(e.RowData["SpaBudget"]);
            var others = string.IsNullOrEmpty(e.RowData["Others"]) ? 0.00 : Convert.ToDouble(e.RowData["Others"]);
            var occupancyRoom = 0.0;
            if (string.IsNullOrEmpty(e.RowData["OccupancyRoom"]))
            {
                occupancyRoom = 0;
            }
            else
            {
                var strOccupancy = "";
                strOccupancy = e.RowData["OccupancyRoom"].Contains("%") ? e.RowData["OccupancyRoom"].Remove(e.RowData["OccupancyRoom"].Length - 1, 1) : e.RowData["OccupancyRoom"];
                occupancyRoom = Convert.ToDouble(strOccupancy);
            }

            var revenueEntry = new BudgetEntry()
            {
                BudgetId  = Convert.ToInt32(budgetEntryId),
                HotelBudgetId = hotelEntryId,
                OccupancyRoom = occupancyRoom,
                RoomBudget = roomBudget,
                FBBudget = fbBudget,
                SpaBudget = spa,
                Others = others,
                UpdateUser = Session["UserSession"].ToString(),
                Total = roomBudget + fbBudget + spa + others
            };
            BudgetHelper.UpdateBudgetEntry(revenueEntry);
        }