Exemple #1
0
        protected void AddPaymentTypeButton_Click(object sender, EventArgs e)
        {
            HolidayEntity entity = new HolidayEntity();
            HolidayMapper mapper = new HolidayMapper();

            entity.HolidayGroupId = Convert.ToInt32(Request.QueryString["HolidayGroupId"]);

            DateTime dt;

            if (DateTime.TryParseExact(StartDateTextBox.Text, "dd.MM.yyyy", null, System.Globalization.DateTimeStyles.None, out dt))
            {
                entity.StartDate = dt;
            }
            if (DateTime.TryParseExact(EndDateTextBox.Text, "dd.MM.yyyy", null, System.Globalization.DateTimeStyles.None, out dt))
            {
                entity.EndDate = dt;
            }

            entity.Title       = HolidayTitleTextBox.Text;
            entity.Status      = StatusEnum.Active;
            entity.Description = "";

            mapper.Insert(entity);

            HolidayTitleTextBox.Text = "";
            StartDateTextBox.Text    = "";
            EndDateTextBox.Text      = "";

            LeaveTypeGridView.DataBind();
        }
Exemple #2
0
        protected void AddPaymentTypeButton_Click(object sender, EventArgs e)
        {
            LeaveTypeLevelEntity entity = new LeaveTypeLevelEntity();
            LeaveTypeLevelMapper mapper = new LeaveTypeLevelMapper();

            entity.LeaveTypeId       = Convert.ToInt32(Request.QueryString["LeaveTypeId"]);
            entity.NoOfDays          = Convert.ToInt32(NoDaysTextBox.Text);
            entity.PaymentPercentage = Convert.ToInt32(PaymentPercentageTextBox.Text);
            entity.LeaveNameType     = (LeaveNameType)Enum.Parse(typeof(LeaveNameType), TypeDropDownList.SelectedValue.ToString());

            mapper.Insert(entity);

            LeaveTypeGridView.DataBind();
        }