Exemplo n.º 1
0
        protected void InitialDropdown()
        {
            try
            {
                DataSet      ds           = new DataSet();
                BLDepartment blDepartment = new BLDepartment();
                BLStatus     blStatus     = new BLStatus();

                ds = blDepartment.GetDepartment("");
                ddlDepartment.DataSource     = ds;
                ddlDepartment.DataValueField = "DEPT_ID";
                ddlDepartment.DataTextField  = "DEPT_NAME";
                ddlDepartment.DataBind();

                ds = blStatus.GetStatus("");
                ddlStatus.DataSource     = ds;
                ddlStatus.DataValueField = "STATUS_ID";
                ddlStatus.DataTextField  = "STATUS_NAME";
                ddlStatus.DataBind();

                ddlStatus.Items.Insert(0, new ListItem("ALL", ""));

                ddlDepartment.SelectedValue = hdDepartment.Value;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 2
0
        public static string GetDepartment(string condition)
        {
            DataSet      ds           = new DataSet();
            BLDepartment blDepartment = new BLDepartment();
            string       result       = "";
            Utility      utility      = new Utility();

            try
            {
                ds     = blDepartment.GetDepartment(condition == "1" ? "DEPT_STATUS = 'T'" : "");
                result = utility.DataTableToJSONWithJavaScriptSerializer(ds.Tables[0]);
            }
            catch (Exception ex)
            {
                //throw ex;
            }

            return(result);
        }