Ejemplo n.º 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            listPorject = proApp.GetUserProjects(UserInfo);
            if (!IsPostBack)
            {
                userEntity = UserInfo;
                string userId = QS("userid");
                if (!string.IsNullOrEmpty(userId))
                {
                    userEntity  = userApp.GetUser(int.Parse(userId));
                    listPorject = proApp.GetUserProjects(userEntity);
                }

                pid = QS("pid");
                FillSearchDto();
                // Buring 2013_10_14 contactordev select
                if (this.userEntity.Role == RolesEnum.Contactor)
                {
                    ddlAssignUser.SelectedValue = this.userEntity.UserID.ToString();
                    ddlAssignUser.Enabled       = false;
                }

                TicketsDataBind();

                if (!string.IsNullOrEmpty(pid))
                {
                    if (!CheckSecurity(Convert.ToInt32(pid)))
                    {
                        Response.Redirect("~/SunnetTicket/dashboard.aspx");
                        return;
                    }
                }
            }
        }
Ejemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            fbmHandler  = new FeedBackMessageHandler(UserInfo);
            listPorject = proApp.GetUserProjects(UserInfo);
            if (!IsPostBack)
            {
                pid = QS("pid");
                InitTicketSatusBind();
                InitProjectTitleBind();
                InitCompanyBind();
                InitClientPriorityBind();

                // Buring 2013_10_14 contactordev select
                if (this.UserInfo.Role == RolesEnum.Contactor)
                {
                    dvCompany.Visible = false;
                }
                TicketsDataBind();

                if (!string.IsNullOrEmpty(pid))
                {
                    if (!CheckSecurity(Convert.ToInt32(pid)))
                    {
                        Response.Redirect("~/Sunnet/Tickets/dashboard.aspx");
                        return;
                    }
                }
                ShowAddTicketBuutton();
            }
        }
Ejemplo n.º 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     allowStatus = ReturnSatisfyConditionStatus(ClientAllowShowStatus());
     fbmHandler  = new FeedBackMessageHandler(UserInfo);
     listPorject = proApp.GetUserProjects(UserInfo);
     if (!IsPostBack)
     {
         upcomingEvents = new EventsApplication().GetEventList(DateTime.Now, UserInfo.UserID, 0, 10);
     }
     InitialControl();
 }
Ejemplo n.º 4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (QS("tid", 0) > 0)
                {
                    TicketsEntity entity = new TicketsApplication().GetTickets(QS("tid", 0));
                    if (entity == null && entity.CreatedBy != UserInfo.UserID)
                    {
                        ShowFailMessageToClient("unauthorized access.");
                        return;
                    }
                    ProjectApplication      projectApplication = new ProjectApplication();
                    List <ProjectDetailDTO> list = projectApplication.GetUserProjects(UserInfo);
                    this.ddlProject.DataTextField  = "Title";
                    this.ddlProject.DataValueField = "ProjectID";

                    ddlProject.DataSource = list;
                    ddlProject.DataBind();
                    jsonProjectAndEstimate = projectApplication.GetProjectAndEstimateRelationJson(list);
                    if (list.Count != 1)
                    {
                        ddlProject.Items.Insert(0, new ListItem()
                        {
                            Value = "", Text = "Please select..."
                        });
                    }

                    BindTicket(entity);
                }
            }
        }
Ejemplo n.º 5
0
        private void InitSearchControls()
        {
            DateTime date = DateTime.Now.AddMonths(-1);
            //txtStartDate.Text = new DateTime(date.Year, date.Month, 1).ToString("MM/dd/yyyy");
            //txtEndDate.Text = new DateTime(date.Year, date.Month, DateTime.DaysInMonth(date.Year, date.Month)).ToString("MM/dd/yyyy");

            ProjectApplication      projApp = new ProjectApplication();
            List <ProjectDetailDTO> listAll = projApp.GetUserProjects(UserInfo);

            listAll.BindDropdown <ProjectDetailDTO>(ddlProject, "Title", "ID", "All", "0");

            UserApplication    userApp     = new UserApplication();
            SearchUsersRequest requestUser = new SearchUsersRequest(
                SearchUsersType.All, false, " FirstName ", " ASC ");

            requestUser.IsSunnet = true;
            SearchUserResponse responseuser = userApp.SearchUsers(requestUser);

            ddlUsers.Items.Add(new ListItem("All", "0"));
            foreach (UsersEntity user in responseuser.ResultList)
            {
                ddlUsers.Items.Add(new ListItem(string.Format("{0} {1}", user.FirstName, user.LastName)
                                                , user.ID.ToString()));
            }
        }
Ejemplo n.º 6
0
        private void InitProject()
        {
            ProjectApplication      projApp = new ProjectApplication();
            List <ProjectDetailDTO> list    = projApp.GetUserProjects(UserInfo);

            list.BindDropdown <ProjectDetailDTO>(ddlProject, "Title", "ID", "All", "0");
        }
Ejemplo n.º 7
0
        private void FillSearchDto()
        {
            proApp.GetUserProjects(UserInfo).BindDropdown <ProjectDetailDTO>(ddlProject, "Title", "ProjectID", this.DefaulAllText, "0",
                                                                             QS("project"));
            GetTicketSatus().BindDropdown <ListItem>(ddlStatus, "Text", "Value", DefaulAllText, "-1", QS("status"));
            txtKeyWord.Text = QS("keyword");
            ddlTicketType.SelectItem(QS("tickettype"));

            dto = dto ?? new TicketsSearchConditionDTO();
            dto.OrderExpression = OrderBy;
            dto.OrderDirection  = OrderDirection;

            dto.KeyWord    = ReturnTicketId(QS("keyword").Trim().NoHTML());
            dto.Status     = ddlStatus.SelectedValue;
            dto.TicketType = ddlTicketType.SelectedValue;
            dto.Project    = ddlProject.SelectedValue;
            dto.IsInternal = false;
            if (UserInfo.Role == RolesEnum.ADMIN || UserInfo.Role == RolesEnum.PM)
            {
                dto.Company = "0";
            }
            else
            {
                dto.Company = UserInfo.CompanyID.ToString();
                dto.Client  = UserInfo.UserID.ToString();
            }
        }
Ejemplo n.º 8
0
        private void SetSearchControlsStatus()
        {
            TicketSatusBind();
            listPorject = proApp.GetUserProjects(UserInfo);
            listPorject.BindDropdown <ProjectDetailDTO>(ddlProject, "Title", "ProjectID", this.DefaulAllText, "0",
                                                        QS("project"));
            ddlTicketType.SelectItem(QS("tickettype"));
            txtKeyWord.Text = QS("keyword");

            dto = dto ?? new TicketsSearchConditionDTO();
            dto.OrderExpression = OrderBy;
            dto.OrderDirection  = OrderDirection;

            dto.KeyWord = ReturnTicketId(QS("keyword").Trim().NoHTML());

            dto.Status     = ((int)ClientTicketState.Draft).ToString();
            dto.TicketType = string.IsNullOrEmpty(QS("type")) ? ddlTicketType.SelectedValue : QS("type");
            dto.Project    = string.IsNullOrEmpty(QS("project")) ? ddlProject.SelectedValue : QS("project");
            dto.IsInternal = false;
            if (UserInfo.Role == RolesEnum.ADMIN || UserInfo.Role == RolesEnum.PM)
            {
                dto.Company = "0";
            }
            else
            {
                dto.Company = UserInfo.CompanyID.ToString();
                dto.Client  = UserInfo.UserID.ToString();
            }
        }
Ejemplo n.º 9
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         ProjectApplication      projectApplication = new ProjectApplication();
         List <ProjectDetailDTO> list = projectApplication.GetUserProjects(UserInfo);
         this.ddlProject.DataTextField    = "Title";
         this.ddlProject.DataValueField   = "ProjectID";
         this.radioPriority.SelectedIndex = 1;
         ddlProject.DataSource            = list;
         jsonProjectAndEstimate           = projectApplication.GetProjectAndEstimateRelationJson(list);
         ddlProject.DataBind();
         if (list.Count != 1)
         {
             ddlProject.Items.Insert(0, new ListItem()
             {
                 Value = "", Text = "Please select..."
             });
         }
         int pid = QS("pid", 0);
         if (pid != 0)
         {
             ddlProject.SelectedValue = pid.ToString();
         }
         if (UserInfo.Role == RolesEnum.PM || UserInfo.Role == RolesEnum.ADMIN)
         {
             trSource.Visible     = true;
             ddlSource.DataSource = ConvertEnumtToListItem(typeof(RolesEnum));
             ddlSource.DataBind();
             ddlSource.SelectedValue = RolesEnum.CLIENT.ToString();
         }
     }
 }
Ejemplo n.º 10
0
        private void InitProject()
        {
            ProjectApplication projApp = new ProjectApplication();

            List <ProjectDetailDTO> list = projApp.GetUserProjects(UserInfo);

            if (!string.IsNullOrEmpty(WorkRequestID))
            {
                WorkRequestEntity workRequestEntity = wqApp.Get(int.Parse(WorkRequestID));
                ProjectsEntity    projectsEntity    = projApp.Get(workRequestEntity.ProjectID);
                if (!projApp.IsProjectHasPM(projectsEntity.ProjectID, UserInfo.UserID))
                {
                    list.Add(new ProjectDetailDTO()
                    {
                        Title = projectsEntity.Title, ID = projectsEntity.ProjectID
                    });
                }
            }
            if (list.Count > 1 || list.Count == 0)
            {
                list.BindDropdown <ProjectDetailDTO>(ddlProject, "Title", "ID", "Please select...", "0");
            }
            else if (list.Count == 1)
            {
                list.BindDropdown <ProjectDetailDTO>(ddlProject, "Title", "ID");
            }
        }
Ejemplo n.º 11
0
 private void FillSearchDto()
 {
     proApp.GetUserProjects(UserInfo).BindDropdown <ProjectDetailDTO>(ddlProject, "Title", "ProjectID", this.DefaulAllText, "0",
                                                                      QS("project"));
     GetTicketSatus().BindDropdown <ListItem>(ddlStatus, "Text", "Value", DefaulAllText, "-1", QS("status"));
     txtKeyWord.Text = QS("keyword");
     ddlTicketType.SelectItem(QS("tickettype"));
 }
Ejemplo n.º 12
0
        //public string GetClientTopMenu()
        //{
        //    ProjectApi.ProjectApiSoapClient client = new ProjectApi.ProjectApiSoapClient();
        //    return client.GetClientTopMenu(UserID);
        //}

        public IList <ProjectDetailDTO> GetProject(int userId)
        {
            ProjectApplication projApp = new ProjectApplication();
            UsersEntity        user    = new UserApplication().GetUser(userId);
            IOrderedEnumerable <ProjectDetailDTO> list = projApp.GetUserProjects(user).OrderBy(r => r.Title);

            return(list.ToList <ProjectDetailDTO>());
        }
Ejemplo n.º 13
0
        public string GetProject(int userId)
        {
            ProjectApplication projApp = new ProjectApplication();
            UsersEntity        user    = new UserApplication().GetUser(userId);
            IOrderedEnumerable <ProjectDetailDTO> list = projApp.GetUserProjects(user).OrderBy(r => r.Title);
            var tempList = list.Select(e => new { e.ProjectID, ProjectName = e.Title });

            return(Newtonsoft.Json.JsonConvert.SerializeObject(tempList));
        }
Ejemplo n.º 14
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         proApp.GetUserProjects(UserInfo).BindDropdown <ProjectDetailDTO>(ddlProject, "Title", "ProjectID", this.DefaulSelectText, "0",
                                                                          QS("project"));
         InitControls();
     }
 }
Ejemplo n.º 15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            projApp = new ProjectApplication();

            if (!Page.IsPostBack)
            {
                int id      = QS("ID", 0);
                int canEdit = QS("c", 0);
                if (canEdit == 2)
                {
                    trBtns.Visible        = false;
                    ltrlControlTitle.Text = "View Event";
                }
                EventEntity eventEntity = new EventsApplication().GetEventInfo(id);
                txtName.Text      = eventEntity.Name;
                txtDetails.Text   = eventEntity.Details;
                txtWhere.Text     = eventEntity.Where;
                chkAllDay.Checked = eventEntity.AllDay;
                if (chkAllDay.Checked)
                {
                    txtFromTime.Style.Add("display", "none");
                    selectFromType.Style.Add("display", "none");
                    txtToTime.Style.Add("display", "none");
                    selectToType.Style.Add("display", "none");
                }
                txtFrom.Text                 = eventEntity.FromDay.ToString("MM/dd/yyyy");
                txtFromTime.Text             = eventEntity.FromTime;
                selectFromType.SelectedValue = eventEntity.FromTimeType.ToString();
                txtTo.Text                 = eventEntity.ToDay.ToString("MM/dd/yyyy");
                txtToTime.Text             = eventEntity.ToTime;
                selectToType.SelectedValue = eventEntity.ToTimeType.ToString();
                ddlAlert.SelectedValue     = ((int)eventEntity.Alert).ToString();
                imgIcon.ImageUrl           = eventEntity.IconPath;
                projApp.GetUserProjects(UserInfo).BindDropdown <ProjectDetailDTO>(ddlProjects, "Title", "ProjectID", "Please select...", "-1");
                ddlProjects.SelectedValue = eventEntity.ProjectID.ToString();
            }
            else
            {
                if (chkAllDay.Checked)
                {
                    txtFromTime.Style.Add("display", "none");
                    selectFromType.Style.Add("display", "none");
                    txtToTime.Style.Add("display", "none");
                    selectToType.Style.Add("display", "none");
                }
                else
                {
                    txtFromTime.Style.Add("display", "");
                    selectFromType.Style.Add("display", "");
                    txtToTime.Style.Add("display", "");
                    selectToType.Style.Add("display", "");
                }
            }
        }
Ejemplo n.º 16
0
        private void InitProject()
        {
            ProjectApplication      projApp = new ProjectApplication();
            List <ProjectDetailDTO> list    = projApp.GetUserProjects(UserInfo);

            list.BindDropdown <ProjectDetailDTO>(ddlProject, "Title", "ID", "All", "0");

            CompanyApplication    comApp  = new CompanyApplication();
            List <CompanysEntity> listCom = comApp.GetAllCompanies();

            listCom.BindDropdown(ddlCompany, "CompanyName", "ComID", "All", "0");
        }
Ejemplo n.º 17
0
        private List <int> GetProjectIDsFilter()
        {
            ProjectApplication      projApp  = new ProjectApplication();
            List <ProjectDetailDTO> listproj = projApp.GetUserProjects(UserInfo);
            List <int> list = new List <int>();

            foreach (ProjectsEntity item in listproj)
            {
                list.Add(item.ID);
            }
            return(list);
        }
Ejemplo n.º 18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            listPorject = proApp.GetUserProjects(UserInfo);
            ((Pop)(this.Master)).Width = 780;
            if (!IsPostBack)
            {
                pid = QS("pid");
                FillSearchDto();
                // Buring 2013_10_14 contactordev select

                TicketsDataBind();

                if (!string.IsNullOrEmpty(pid))
                {
                    if (!CheckSecurity(Convert.ToInt32(pid)))
                    {
                        Response.Redirect("~/SunnetTicket/dashboard.aspx");
                        return;
                    }
                }
            }
        }
Ejemplo n.º 19
0
        private void InitControls()
        {
            DateTime date = DateTime.Now.AddMonths(-1);
            //txtStartDate.Text = new DateTime(date.Year, date.Month, 1).ToString("MM/dd/yyyy");
            //txtEndDate.Text = new DateTime(date.Year, date.Month, DateTime.DaysInMonth(date.Year, date.Month)).ToString("MM/dd/yyyy");

            ProjectApplication      projApp = new ProjectApplication();
            List <ProjectDetailDTO> list    = projApp.GetUserProjects(UserInfo);

            list.BindDropdown <ProjectDetailDTO>(ddlProject, "Title", "ID", "All", "0");

            ddlTickets.Items.Add(new ListItem("All", "0"));
        }
Ejemplo n.º 20
0
        protected void Page_Load(object sender, EventArgs e)
        {
            listPorject = proApp.GetUserProjects(UserInfo);

            if (!IsPostBack)
            {
                pid = QS("pid");

                FillSearchDto();

                TicketsDataBind();

                if (!string.IsNullOrEmpty(pid))
                {
                    if (!CheckSecurity(Convert.ToInt32(pid)))
                    {
                        Response.Redirect("~/SunnetTicket/dashboard.aspx");
                        return;
                    }
                }
            }
        }
Ejemplo n.º 21
0
 protected void Page_Load(object sender, EventArgs e)
 {
     projApp = new ProjectApplication();
     if (!Page.IsPostBack)
     {
         DateTime eventDate = QS("Date", DateTime.Now);
         txtFrom.Text    = eventDate.ToString("MM/dd/yyyy");
         txtTo.Text      = eventDate.ToString("MM/dd/yyyy");
         txtEndDate.Text = eventDate.ToString("MM/dd/yyyy");
         projApp.GetUserProjects(UserInfo).BindDropdown <ProjectDetailDTO>(ddlProjects, "Title", "ProjectID", "Please select...", "-1");
         int searchedProjectID = QS("pid", -1);
         ddlProjects.SelectedValue = searchedProjectID.ToString();
     }
 }
Ejemplo n.º 22
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                if (!string.IsNullOrEmpty(Request.Params["date"]))
                {
                    this.SelectedDate = Convert.ToDateTime(Request.QueryString["date"]);
                    if (!TimeSheetTicket.CanEdit(this.SelectedDate))
                    {
                        Redirect("Index.aspx");
                    }
                    if (SelectedDate.Date > DateTime.Now)
                    {
                        btnSubmit.Visible = false;
                    }
                }
                else
                {
                    this.SelectedDate = DateTime.Now;
                }
            }
            catch
            {
                this.SelectedDate = DateTime.Now;
            }
            if (!IsPostBack)
            {
                Title = "Write timesheet - " + SelectedDate.ToString("MM/dd/yyyy");

                List <CateGoryEntity> list = cgApp.GetCateGroyListByUserID(UserInfo.ID);
                if (list == null)
                {
                    list = new List <CateGoryEntity>();
                }
                var category = list.Select(x => new { category = x.Title, id = x.ID }).ToList();
                category.Insert(0, new { category = DefaulSelectText, id = 0 });
                this.CategoryJson = JsonConvert.SerializeObject(category, DoBase.DateConverter);

                List <ProjectDetailDTO> listProj = projApp.GetUserProjects(UserInfo);
                if (listProj != null && listProj.Count > 0)
                {
                    listProj.RemoveAll(r => r.Status == ProjectStatus.Cancelled || r.Status == ProjectStatus.Completed);
                }
                var project = listProj.Select(x => new { title = x.Title, id = x.ProjectID, tickets = new List <int>() }).ToList();
                project.Insert(0, new { title = DefaulSelectText, id = 0, tickets = new List <int>() });
                this.ProjectJson = JsonConvert.SerializeObject(project, DoBase.DateConverter);
            }
            totalQWeeklyHours = tsApp.TotalWeeklyHours(this.SelectedDate, UserInfo.ID);
        }
Ejemplo n.º 23
0
 protected void ddlCompany_OnSelectedIndexChanged(object sender, EventArgs e)
 {
     if (ddlCompany.SelectedValue == "0")
     {
         ddlProject.Items.Clear();
         ddlProject.Items.Add(new ListItem("All", "0"));
     }
     else
     {
         int comID = int.Parse(ddlCompany.SelectedValue);
         ProjectApplication      projApp     = new ProjectApplication();
         List <ProjectDetailDTO> listProj    = projApp.GetUserProjects(UserInfo);
         List <ProjectDetailDTO> listcomProj = listProj.FindAll(p => p.CompanyID == comID);
         listcomProj.BindDropdown <ProjectDetailDTO>(ddlProject, "Title", "ID", "All", "0");
     }
 }
Ejemplo n.º 24
0
 protected void Page_Load(object sender, EventArgs e)
 {
     listPorject = proApp.GetUserProjects(UserInfo);
     if (!IsPostBack)
     {
         //InitTicketSatusBind();
         InitProjectTitleBind();
         InitClientPriorityBind();
         //selectValue.Value  = QS("status");
         ddlPriority.SelectedValue = QS("ticketPriority", 0).ToString();
         ddlProject.SelectItem(QS("project"));
         ddlTicketType.SelectedValue = QS("tickettype");
         txtKeyWord.Text             = QS("keyword").Trim();
         txtCreated.Text             = QS("create").Trim();
         TicketsDataBind();
     }
 }
Ejemplo n.º 25
0
        private void ProjectTitleBind()
        {
            List <ProjectDetailDTO> list = proApp.GetUserProjects(UserInfo);

            this.ddlProject.DataTextField  = "Title";
            this.ddlProject.DataValueField = "ProjectID";
            if (list.Count == 1)
            {
                BindTicketUsers(list[0].ProjectID);
            }
            ddlProject.DataSource = list;
            ddlProject.DataBind();
            if (list.Count != 1)
            {
                ddlProject.Items.Insert(0, new ListItem("Please select...", ""));
            }
        }
Ejemplo n.º 26
0
 protected void Page_Load(object sender, EventArgs e)
 {
     projApp = new ProjectApplication();
     if (!Page.IsPostBack)
     {
         projApp.GetUserProjects(UserInfo).BindDropdown <ProjectDetailDTO>(ddlProjects, "Title", "ProjectID", "Please select...", "-1");
         ddlYears.SelectedValue  = DateTime.Now.Year.ToString();
         ddlMonths.SelectedValue = DateTime.Now.Month.ToString();
     }
     SearchEvents();
     if (ddlProjects.Items.Count <= 0)
     {
         ddlProjects.Items.Add(new ListItem()
         {
             Selected = true, Text = "None", Value = "0"
         });
     }
 }
Ejemplo n.º 27
0
 protected void Page_Load(object sender, EventArgs e)
 {
     listPorject = proApp.GetUserProjects(UserInfo);
     if (!IsPostBack)
     {
         TicketSatusBind();
         ProjectTitleBind();
         int projectID = QS("pid", 0);
         if (projectID != 0)
         {
             ddlProject.SelectedValue = projectID.ToString();
             TicketsDataBind(projectID.ToString());
         }
         else
         {
             TicketsDataBind(string.Empty);
         }
     }
 }
Ejemplo n.º 28
0
 protected void Page_Load(object sender, EventArgs e)
 {
     fbmHandler  = new FeedBackMessageHandler(UserInfo);
     allowStatus = ReturnSatisfyConditionStatus(ClientAllowShowStatus());
     listPorject = proApp.GetUserProjects(UserInfo);
     if (!IsPostBack)
     {
         TicketSatusBind();
         ProjectTitleBind();
         int projectID = QS("pid", 0);
         if (projectID != 0)
         {
             ddlProject.SelectedValue = projectID.ToString();
             TicketsDataBind(projectID.ToString());
         }
         else
         {
             TicketsDataBind(string.Empty);
         }
     }
 }
Ejemplo n.º 29
0
        protected void Page_Load(object sender, EventArgs e)
        {
            fbmHandler      = new FeedBackMessageHandler(UserInfo);
            AllowStatusList = AllowStatus();
            #region initial
            list      = proApp.GetUserProjects(UserInfo, DateTime.Now.AddDays(-15));
            listOrder = toApp.GetListByProjectId(PidList());
            int userId = 0;
            if (UserInfo.Role == RolesEnum.Contactor)
            {
                userId = UserInfo.UserID;
            }
            listTickets = ticketApp.GetListTopTenTicketsByProjects(PidList(), AllowStatus(), userId);
            #endregion
            if (!IsPostBack)
            {
                BindDataList();
            }

            ((Main)this.Master).TopSelectedIndex = 2;
        }
Ejemplo n.º 30
0
        private void InitSearchControls()
        {
            projApp.GetUserProjects(UserInfo).BindDropdown <ProjectDetailDTO>(ddlProject, "Title", "ID", "All", "0");

            var statuses = new Dictionary <int, string>();

            foreach (int value in Enum.GetValues(typeof(ClientTicketState)))
            {
                if (value != (int)ClientTicketState.None)
                {
                    statuses.Add(value, ((ClientTicketState)value).ToString().Replace("_", " "));
                }
            }

            ddlStatus.DataSource     = statuses;
            ddlStatus.DataTextField  = "Value";
            ddlStatus.DataValueField = "Key";
            ddlStatus.DataBind();
            ddlStatus.Items.Insert(0, new ListItem("All", "-1"));
            ddlStatus.Items[0].Selected = true;
        }