コード例 #1
0
 partial void DeleteRevenueEntry(RevenueEntry instance);
コード例 #2
0
 partial void UpdateRevenueEntry(RevenueEntry instance);
コード例 #3
0
		private void detach_RevenueEntries(RevenueEntry entity)
		{
			this.SendPropertyChanging();
			entity.HotelRevenue = null;
		}
コード例 #4
0
 partial void InsertRevenueEntry(RevenueEntry instance);
コード例 #5
0
        protected void JqGridDataEntry_RowEditing(object sender, JQGridRowEditEventArgs e)
        {
            var revenueEntryId = e.RowKey;
            var hotelEntryId = e.RowData["HotelEntryId"] == "" ? 0 : Convert.ToInt32(e.RowData["HotelEntryId"]);
            var roomRevenue = string.IsNullOrEmpty(e.RowData["RoomRevenue"]) ? 0.00 : Convert.ToDouble(e.RowData["RoomRevenue"]);
            var fbRevenue = string.IsNullOrEmpty(e.RowData["FBRevenue"]) ? 0.00 : Convert.ToDouble(e.RowData["FBRevenue"]);
            var spa = string.IsNullOrEmpty(e.RowData["SpaRevenue"]) ? 0.00 : Convert.ToDouble(e.RowData["SpaRevenue"]);
            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 RevenueEntry()
                {
                    RevenueId = Convert.ToInt32(revenueEntryId),
                    HotelRevenueId = hotelEntryId,
                    OccupancyRoom = occupancyRoom,
                    RoomRevenue = roomRevenue,
                    FBRevenue = fbRevenue,
                    SpaRevenue = spa,
                    Others = others,
                    UpdateUser = Session["UserSession"].ToString(),
                    Total = roomRevenue+fbRevenue+spa+others
                };
            RevenueHelper.UpdateRevenueEntry(revenueEntry);
        }