示例#1
0
        public RoomChangeForm(int _id, MainForm _owner)
        {
            id = _id;
            InitializeComponent();
            owner = _owner;
            if (id != 0)
            {
                ConectionDB.Connection("select type_id, price, type_of_number.type from type_of_number ", cmType);
                cmType.Text         = ConectionDB.ReturnResultLikeString(String.Format("select type_of_number.type from type_of_number where type_id = (select type_id from hotel_room where room_id = {0})", id));
                tbNum.Text          = ConectionDB.ReturnResultLikeString(String.Format("select number_of_room from hotel_room where room_id = {0}", id));
                nudSleepPoint.Value = Convert.ToInt32(ConectionDB.ReturnResultLikeString(String.Format("select amount_of_sleeppoint from hotel_room where room_id = {0}", id)));
                nupFloor.Value      = Convert.ToInt32(ConectionDB.ReturnResultLikeString(String.Format("select floor_of_room from hotel_room where room_id = {0}", id)));
                ConectionDB.ConnectionSecondCMB("select name_type from type_of_bed", cbBed);
                cmType.Text = ConectionDB.ReturnResultLikeString(String.Format("select name_type from type_of_bed where type_id = (select type_of_bed_id from hotel_room where room_id = {0})", id));
            }
            string    appPath = Path.GetDirectoryName(Application.ExecutablePath) + @"\Images\";
            DataTable result  = ConectionDB.ReturnResult(String.Format("select images_path from rooms_images where rooms_id={0}", id));
            int       y       = result.Rows.Count;

            foreach (DataRow item in result.Rows)
            {
                listOfStr.Add(item[0].ToString());
                PictureBox pb = new PictureBox();
                pb.Name     = count.ToString();
                pb.SizeMode = PictureBoxSizeMode.Zoom;
                pb.Image    = new Bitmap(appPath + listOfStr.Last());
                flpPhotos.Controls.Add(pb);
                globalPBList.Add(pb);
                pb.Click += new EventHandler(pb_Click);
                count++;
            }
        }
示例#2
0
 public AddServices(int _id, bool _isNew)
 {
     InitializeComponent();
     id    = _id;
     isNew = _isNew;
     if (!isNew)
     {
         ConectionDB.ConnectionSecondCMB(String.Format("select service_name from services where service_id = (select service_id from bill where bill_id = {0})", id), cmServices);
         tbPrice.Text       = ConectionDB.ReturnResultLikeString(String.Format("select summa from bill where bill_id = {0}", id));
         nudAmount.Value    = Convert.ToInt32(ConectionDB.ReturnResultLikeString(String.Format("select amount from bill where bill_id = {0}", id)));
         cmServices.Enabled = false;
         tbPrice.Enabled    = false;
         nudAmount.Enabled  = false;
         btDelete.Visible   = false;
     }
     else
     {
         FillFields();
         priceA = Convert.ToInt32(Application.OpenForms["BillForm"].Controls["tbSum"].Text.ToString());
     }
 }
示例#3
0
 public FinalFormBill(int _roomId)
 {
     InitializeComponent();
     clientId = InformationClass.clientId;
     roomId   = _roomId;
     if (InformationClass.queryNew == "")
     {
         lbClient.Text = "  " + ConectionDB.ReturnResultLikeString(String.Format("select surname from clients where clients_id = {0}", clientId)) + " " + ConectionDB.ReturnResultLikeString(String.Format("select first_name from clients where clients_id = {0}", clientId));
     }
     else
     {
         lbClient.Text = "  " + InformationClass.surname + " " + InformationClass.firstName;
     }
     lbDays.Text = "  " + (InformationClass.finish - InformationClass.start).TotalDays.ToString();
     lbFrom.Text = "  " + InformationClass.start.ToShortDateString().ToString();
     lbTo.Text   = "  " + InformationClass.finish.ToShortDateString().ToString();
     lbRoom.Text = "  " + ConectionDB.ReturnResultLikeString(String.Format("select number_of_room from hotel_room where room_id = {0}", roomId));
     lbType.Text = "  " + ConectionDB.ReturnResultLikeString(String.Format("select type_of_number.type from type_of_number where type_id = (select type_id from hotel_room where room_id = {0})", roomId));
     lbSum.Text  = "  " + Convert.ToInt32(Convert.ToInt32(ConectionDB.ReturnResultLikeString(String.Format("select price from type_of_number where type_id = (select type_id from hotel_room where room_id = {0})", roomId))) * Convert.ToInt32(lbDays.Text.ToString())).ToString();
     ConectionDB.ConnectionSecondCMB("select name_type from type_of_pay", cmPay);
 }
示例#4
0
 public void FillFields()
 {
     ConectionDB.ConnectionSecondCMB("select service_name from services", cmServices);
 }