Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //http://localhost:14994/HRM/HR-Managment/Definition/LeaveType/Edit.aspx?LeaveTypeNameId=3&action=delete&LeaveTypeId=15
            if (Request.QueryString["LeaveTypeNameId"] != null && Request.QueryString["action"] == "delete")
            {
                new LeaveTypeLevelMapper().Delete(new Entities.LeaveTypeLevelEntity() { Id = Convert.ToInt32(Request.QueryString["LeaveTypeNameId"]) });
            }

            if (!IsPostBack)
            {
                GUIHelper.BindEnum2DropDownList(TypeDropDownList, typeof(LeaveNameType), true);

                if (Request.QueryString["LeaveTypeId"] != null)
                {
                    int LeaveTypeId;

                    LeaveTypeEntity entity = new LeaveTypeEntity();
                    Int32.TryParse(Request.QueryString["LeaveTypeId"], out LeaveTypeId);
                    entity.Id = LeaveTypeId;

                    LeaveTypeMapper mapper = new LeaveTypeMapper();
                    entity = mapper.Get(entity);

                    TitleTextBox.Text = entity.Title;
                    DescriptionTextBox.Text = entity.Description;
                }
            }
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //http://localhost:14994/HRM/HR-Managment/Definition/LeaveType/Edit.aspx?LeaveTypeNameId=3&action=delete&LeaveTypeId=15
            if (Request.QueryString["LeaveTypeNameId"] != null && Request.QueryString["action"] == "delete")
            {
                new LeaveTypeLevelMapper().Delete(new Entities.LeaveTypeLevelEntity()
                {
                    Id = Convert.ToInt32(Request.QueryString["LeaveTypeNameId"])
                });
            }


            if (!IsPostBack)
            {
                GUIHelper.BindEnum2DropDownList(TypeDropDownList, typeof(LeaveNameType), true);

                if (Request.QueryString["LeaveTypeId"] != null)
                {
                    int LeaveTypeId;

                    LeaveTypeEntity entity = new LeaveTypeEntity();
                    Int32.TryParse(Request.QueryString["LeaveTypeId"], out LeaveTypeId);
                    entity.Id = LeaveTypeId;

                    LeaveTypeMapper mapper = new LeaveTypeMapper();
                    entity = mapper.Get(entity);

                    TitleTextBox.Text       = entity.Title;
                    DescriptionTextBox.Text = entity.Description;
                }
            }
        }
Ejemplo n.º 3
0
        protected void AddLeaveType_Click(object sender, EventArgs e)
        {
            LeaveTypeEntity entity = new LeaveTypeEntity();

            entity.Title = TitleTextBox.Text;
            entity.Description = DescriptionTextBox.Text;

            LeaveTypeMapper mapper = new LeaveTypeMapper();
            mapper.Insert(entity);

            Response.Redirect(String.Format("Edit.aspx?LeavetypeId={0}", entity.Id));
        }
Ejemplo n.º 4
0
        protected void AddLeaveType_Click(object sender, EventArgs e)
        {
            LeaveTypeEntity entity = new LeaveTypeEntity();

            entity.Title       = TitleTextBox.Text;
            entity.Description = DescriptionTextBox.Text;

            LeaveTypeMapper mapper = new LeaveTypeMapper();

            mapper.Insert(entity);


            Response.Redirect(String.Format("Edit.aspx?LeavetypeId={0}", entity.Id));
        }
Ejemplo n.º 5
0
        public CascadingDropDownNameValue[] GetLeaveTypes(string knownCategoryValues, string category, string contextKey)
        {
            List <CascadingDropDownNameValue> values = new List <CascadingDropDownNameValue>();

            List <LeaveTypeEntity> list = new LeaveTypeMapper().List("");

            foreach (LeaveTypeEntity entity in list)
            {
                CascadingDropDownNameValue cdnv;

                cdnv = new CascadingDropDownNameValue(entity.Title, entity.Id.ToString());
                values.Add(cdnv);
            }

            return(values.ToArray());
        }
Ejemplo n.º 6
0
        public CascadingDropDownNameValue[] GetLeaveTypes(string knownCategoryValues, string category, string contextKey)
        {
            List<CascadingDropDownNameValue> values = new List<CascadingDropDownNameValue>();

            List<LeaveTypeEntity> list = new LeaveTypeMapper().List("");
            foreach (LeaveTypeEntity entity in list)
            {
                CascadingDropDownNameValue cdnv;

                cdnv = new CascadingDropDownNameValue(entity.Title, entity.Id.ToString());
                values.Add(cdnv);
            }

            return values.ToArray();
        }