コード例 #1
0
        public RoomBookingDateWiseDTO[] GetRoomOtherBookings(DateTime StartDate, DateTime EndDate, int notThisBookingId, int AccomTypeId, int AccomId, string RoomNo)
        {
            RoomBookingDateWiseDTO[] oBookingRoomDataDateWise;
            DataSet         dsRoomOtherBookings;
            DataRow         dr;
            string          sProcName;
            DatabaseManager oDB;

            dsRoomOtherBookings      = null;
            oBookingRoomDataDateWise = null;
            try
            {
                oDB       = new DatabaseManager();
                sProcName = "up_Get_RoomOtherBookings";
                oDB.DbCmd = oDB.GetStoredProcCommand(sProcName);
                oDB.DbDatabase.AddInParameter(oDB.DbCmd, "@StartDate", DbType.Date, StartDate);
                oDB.DbDatabase.AddInParameter(oDB.DbCmd, "@EndDate", DbType.Date, EndDate);
                oDB.DbDatabase.AddInParameter(oDB.DbCmd, "@CurrentBookingId", DbType.Int32, notThisBookingId);
                oDB.DbDatabase.AddInParameter(oDB.DbCmd, "@AccomTypeId", DbType.Int32, AccomTypeId);
                oDB.DbDatabase.AddInParameter(oDB.DbCmd, "@AccomId", DbType.Int32, AccomId);
                oDB.DbDatabase.AddInParameter(oDB.DbCmd, "@RoomNo", DbType.String, RoomNo);
                dsRoomOtherBookings = oDB.ExecuteDataSet(oDB.DbCmd);
                oDB = null;
            }
            catch (Exception exp)
            {
                oDB = null;
                dsRoomOtherBookings = null;
                GF.LogError("clsBookingRoomHandler.GetRoomOtherBookings", exp.Message);
            }
            if (dsRoomOtherBookings != null && dsRoomOtherBookings.Tables.Count > 0)
            {
                if (dsRoomOtherBookings.Tables[0].Rows.Count > 0)
                {
                    oBookingRoomDataDateWise = new RoomBookingDateWiseDTO[dsRoomOtherBookings.Tables[0].Rows.Count];
                    for (int i = 0; i < dsRoomOtherBookings.Tables[0].Rows.Count; i++)
                    {
                        dr = dsRoomOtherBookings.Tables[0].Rows[i];
                        oBookingRoomDataDateWise[i]                  = new RoomBookingDateWiseDTO();
                        oBookingRoomDataDateWise[i].BookingId        = Convert.ToInt32(dr.ItemArray.GetValue(0));
                        oBookingRoomDataDateWise[i].BookingCode      = Convert.ToString(dr.ItemArray.GetValue(1)).Trim();
                        oBookingRoomDataDateWise[i].AccomodationId   = Convert.ToInt32(dr.ItemArray.GetValue(2));
                        oBookingRoomDataDateWise[i].RoomNo           = Convert.ToString(dr.ItemArray.GetValue(3)).Trim();
                        oBookingRoomDataDateWise[i].Startdate        = Convert.ToDateTime(dr.ItemArray.GetValue(4).ToString());
                        oBookingRoomDataDateWise[i].Enddate          = Convert.ToDateTime(dr.ItemArray.GetValue(5).ToString());
                        oBookingRoomDataDateWise[i].BookingReference = Convert.ToString(dr.ItemArray.GetValue(6)).Trim();
                    }
                }
            }
            return(oBookingRoomDataDateWise);
        }
コード例 #2
0
    private Table PrepareBookingHeaderDataRow(RoomBookingDateWiseDTO oRoomBookingDateWiseData)
    {
        Table     t  = new Table();
        TableRow  tr = new TableRow();
        TableCell tc;

        t.Attributes.Add("class", "bookingHeaderDataRowTable");

        string sPanelId = Constants.PANEL_DETAIL + "_" + oRoomBookingDateWiseData.BookingId;

        tc = new TableCell();
        HtmlImage showhideImage = new HtmlImage();

        showhideImage.Src = "~/images/icon_summary_plus_On.gif";
        showhideImage.ID  = Constants.IMAGE + sPanelId;
        showhideImage.Attributes.Add("onclick", "showhide('" + sPanelId.ToString() + "')");
        tc.Controls.Add(showhideImage);
        tr.Cells.Add(tc);

        tc = new TableCell();
        tc.Attributes.Add("class", "bookingHeaderDataRowcell");
        tc.Text = "Booking Code: <br>" + oRoomBookingDateWiseData.BookingCode;
        tr.Cells.Add(tc);

        tc = new TableCell();
        tc.Attributes.Add("class", "bookingHeaderDataRowcell");
        tc.Text = "Booking Reference: <br>" + oRoomBookingDateWiseData.BookingReference;
        tr.Cells.Add(tc);

        tc = new TableCell();
        tc.Attributes.Add("class", "bookingHeaderDataRowcell");
        tc.Text = "Check In: <br>" + GF.GetDD_MMM_YYYY(oRoomBookingDateWiseData.Startdate, false);
        tr.Cells.Add(tc);

        tc = new TableCell();
        tc.Attributes.Add("class", "bookingHeaderDataRowcell");
        tc.Text = "Check Out: <br>" + GF.GetDD_MMM_YYYY(oRoomBookingDateWiseData.Enddate, false);
        tr.Cells.Add(tc);

        if (oRoomBookingDateWiseData.AgentName != null && oRoomBookingDateWiseData.AgentName != string.Empty)
        {
            tc = new TableCell();
            tc.Attributes.Add("class", "bookingHeaderDataRowcell");
            tc.Text = "Agent Name: " + oRoomBookingDateWiseData.AgentName;
            tr.Cells.Add(tc);
        }

        t.Rows.Add(tr);
        return(t);
    }
コード例 #3
0
        private RoomBookingDateWiseDTO[] MapDBToObject(DataSet dbData)
        {
            List <RoomBookingDateWiseDTO> dateWiseBookingDataList = new List <RoomBookingDateWiseDTO>();
            RoomBookingDateWiseDTO        dateWiseBookingDTO      = null;
            DataRow dr;

            try
            {
                if (dbData != null && dbData.Tables[0].Rows.Count > 0)
                {
                    for (int i = 0; i < dbData.Tables[0].Rows.Count; i++)
                    {
                        dr = dbData.Tables[0].Rows[i];
                        dateWiseBookingDTO = new RoomBookingDateWiseDTO();
                        if (dr.ItemArray.GetValue(0) != DBNull.Value)
                        {
                            dateWiseBookingDTO.AccomodationId = Convert.ToInt32(dr.ItemArray.GetValue(0));
                        }
                        if (dr.ItemArray.GetValue(1) != DBNull.Value)
                        {
                            dateWiseBookingDTO.RoomNo = Convert.ToString(dr.ItemArray.GetValue(1));
                        }
                        if (dr.ItemArray.GetValue(2) != DBNull.Value)
                        {
                            dateWiseBookingDTO.BookingId = Convert.ToInt32(dr.ItemArray.GetValue(2));
                        }
                        if (dr.ItemArray.GetValue(3) != DBNull.Value)
                        {
                            dateWiseBookingDTO.BookingCode = Convert.ToString(dr.ItemArray.GetValue(3)).Trim();
                        }
                        if (dr.ItemArray.GetValue(4) != DBNull.Value)
                        {
                            dateWiseBookingDTO.TourId = Convert.ToString(dr.ItemArray.GetValue(4));
                        }
                        if (dr.ItemArray.GetValue(5) != DBNull.Value)
                        {
                            dateWiseBookingDTO.Startdate = Convert.ToDateTime(dr.ItemArray.GetValue(5).ToString());
                        }
                        if (dr.ItemArray.GetValue(6) != DBNull.Value)
                        {
                            dateWiseBookingDTO.Enddate = Convert.ToDateTime(dr.ItemArray.GetValue(6).ToString());
                        }
                        if (dr.ItemArray.GetValue(7) != DBNull.Value)
                        {
                            dateWiseBookingDTO.Noofnights = Convert.ToInt32(dr.ItemArray.GetValue(7));
                        }
                        if (dr.ItemArray.GetValue(8) != null && dr.ItemArray.GetValue(8) != DBNull.Value)
                        {
                            dateWiseBookingDTO.BookingStatusId = Convert.ToInt32(dr.ItemArray.GetValue(8));
                        }
                        else
                        {
                            dateWiseBookingDTO.BookingStatusId = 0;
                        }
                        if (dr.ItemArray.GetValue(9) != null && dr.ItemArray.GetValue(9) != DBNull.Value)
                        {
                            dateWiseBookingDTO.AgentName = DataSecurityManager.Decrypt(Convert.ToString(dr.ItemArray.GetValue(9)));
                        }
                        if (dr.ItemArray.GetValue(15) != null && dr.ItemArray.GetValue(15) != DBNull.Value)
                        {
                            dateWiseBookingDTO.RefAgentName = DataSecurityManager.Decrypt(Convert.ToString(dr.ItemArray.GetValue(15)));
                        }
                        if (dr.ItemArray.GetValue(10) != null && dr.ItemArray.GetValue(10) != DBNull.Value)
                        {
                            dateWiseBookingDTO.BookingReference = Convert.ToString(dr.ItemArray.GetValue(10));
                        }
                        if (dr.ItemArray.GetValue(11) != null && dr.ItemArray.GetValue(11) != DBNull.Value)
                        {
                            dateWiseBookingDTO.BookingStatusType = Convert.ToString(dr.ItemArray.GetValue(11));
                        }

                        if (dr.ItemArray.GetValue(12) != null && dr.ItemArray.GetValue(12) != DBNull.Value)
                        {
                            dateWiseBookingDTO.Chartered = Convert.ToBoolean(dr.ItemArray.GetValue(12));
                        }
                        else
                        {
                            dateWiseBookingDTO.Chartered = false;
                        }

                        if (dr.ItemArray.GetValue(13) != null && dr.ItemArray.GetValue(13) != DBNull.Value)
                        {
                            dateWiseBookingDTO.NoofRooms = Convert.ToInt32(dr.ItemArray.GetValue(13));
                        }

                        if (dr.ItemArray.GetValue(14) != null && dr.ItemArray.GetValue(14) != DBNull.Value)
                        {
                            dateWiseBookingDTO.paxStaying = Convert.ToInt32(dr.ItemArray.GetValue(14));
                        }

                        dateWiseBookingDataList.Add(dateWiseBookingDTO);
                    }
                }
            }
            catch (Exception exp)
            {
                throw exp;
            }
            return(dateWiseBookingDataList.ToArray());
        }