Ejemplo n.º 1
0
        private void LoadHolidayDate(int id)
        {
            HolidayDateDTO hd = dao.GetHolidayDate(id);

            this.HolidayDateID    = hd.ID;
            this.holidayDate.Text = hd.Date.ToShortDateString();
            this.description.Text = hd.Description;
        }
Ejemplo n.º 2
0
        public HolidayDateDTO GetHolidayDate(int hdID)
        {
            DbCommand cmd = db.GetStoredProcCommand("dbo.HolidayDateGet", hdID);

            HolidayDateDTO hd = new HolidayDateDTO();

            using (IDataReader dr = db.ExecuteReader(cmd))
            {
                if (dr.Read())
                {
                    hd.ID          = int.Parse(dr["id"].ToString());
                    hd.Date        = DateTime.Parse(dr["holidayDate"].ToString());
                    hd.Description = dr["description"].ToString();
                }
            }

            return(hd);
        }
Ejemplo n.º 3
0
 protected void save_Click(object sender, EventArgs e)
 {
     if (Page.IsValid)
     {
         try
         {
             HolidayDateDTO hd = new HolidayDateDTO(HolidayDateID, DateTime.Parse(holidayDate.Text), description.Text);
             dao.SetHolidayDate(hd);
             if (!String.IsNullOrEmpty(availableYears.SelectedValue))
             {
                 LoadHolidayDateList(int.Parse(availableYears.SelectedValue));
                 LoadAvailableYears(int.Parse(availableYears.SelectedValue));
             }
             ClearForm();
         }
         catch (Exception ex)
         {
             lblMessage.Text = ex.Message;
         }
     }
 }
Ejemplo n.º 4
0
        public void SetHolidayDate(HolidayDateDTO hd)
        {
            DbCommand cmd = db.GetStoredProcCommand("dbo.HolidayDateSet", hd.ID, hd.Date, hd.Description);

            db.ExecuteNonQuery(cmd);
        }