Пример #1
0
    public void setdepartment()
    {
        DBFunctions db = new DBFunctions();

        DeptList.DataSource     = db.getalldepartments();
        DeptList.DataTextField  = "Department";
        DeptList.DataValueField = "ID";
        DeptList.DataBind();
    }
Пример #2
0
        protected void populateDeptList()
        {
            string    getDeptsQuery = DataProvider.DiscDeptWard.getDepartments();
            DataTable dt            = HospitalClass.getDataTable(getDeptsQuery);

            DeptList.DataSource    = dt;
            DeptList.DataTextField = "DEPT_NAME";
            DeptList.DataBind();
            DeptList.Items.Insert(0, new ListItem("Please select..."));
        }
Пример #3
0
        /// <summary>
        /// 根据部门ID取得部部门名字
        /// </summary>
        /// <param name="DeptId"></param>
        /// <returns></returns>
        public string GetDeptName(long DeptId)
        {
            var re = DeptList.SingleOrDefault(p => p.DeptID == DeptId);

            if (re != null)
            {
                return(re.DeptName);
            }
            return("");
        }
Пример #4
0
        private void LoadDept()
        {
            DeptList.Clear();
            foreach (var model in SharedPreference.Instance.DeptList)
            {
                DeptList.Add(model);
                Title = "DEPT";
            }
            var list = DeptList.OrderBy(p => p.DEPT_CODE);

            DeptList = new ObservableCollection <DeptModel>(list);
        }
    private void PopulateDropdown()
    {
        var           connectionString = System.Configuration.ConfigurationManager.ConnectionStrings["developmentserver"].ConnectionString;
        SqlConnection conn             = new SqlConnection(connectionString);

        conn.Open();
        SqlCommand    fetchCommand = new SqlCommand("Select * from DEPT", conn);
        SqlDataReader reader       = fetchCommand.ExecuteReader();

        DeptList.DataSource     = reader;
        DeptList.DataTextField  = "DNAME";
        DeptList.DataValueField = "DEPTNO";
        DeptList.DataBind();
        PopulateGrid(this, null);
    }
Пример #6
0
 /// <summary>
 /// 取得本社團之科系限制
 /// </summary>
 private void GetDept()
 {
     if (!string.IsNullOrEmpty(_ClubObj.DeptRestrict))
     {
         FISCA.DSAUtil.DSXmlHelper dsx = new FISCA.DSAUtil.DSXmlHelper();
         dsx.Load(_ClubObj.DeptRestrict);
         foreach (System.Xml.XmlElement xml in dsx.BaseElement.SelectNodes("Dept"))
         {
             if (!DeptList.Contains(xml.InnerText))
             {
                 DeptList.Add(xml.InnerText);
             }
         }
     }
 }
 protected void deptdatafilter()
 {
     if (EntiyList.SelectedValue != null && EntiyList.SelectedIndex != 0)
     {
         DeptList.Enabled        = true;
         Edit_Entity_btn.Enabled = true;
         DeptList.DataSource     = deptds(Convert.ToInt16(EntiyList.SelectedValue.ToString()));
         DeptList.DataValueField = "ID";
         DeptList.DataTextField  = "Department Name";
         DeptList.DataBind();
         DeptList.Items.Insert(0, "Select the Department");
     }
     else
     {
         DeptList.Enabled        = false;
         Edit_Entity_btn.Enabled = false;
     }
 }
Пример #8
0
        private void btnListDept_Click(object sender, EventArgs e)
        {
            DepartmentRepository repository  = new DepartmentRepository();
            List <Department>    departments = repository.GetDepartments().ToList();

            if (departments.Count == 0)
            {
                MessageBox.Show("No Records To Display.", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            ReportDocument report = new DeptList();

            report.SetDataSource(departments);
            report.SetParameterValue("@Company", Properties.Settings.Default.COMPANYNAME.ToUpper());
            report.SetParameterValue("@Branch", Properties.Settings.Default.BRANCHNAME.ToUpper());
            report.SetParameterValue("@Username", Properties.Settings.Default.USERNAME.ToUpper());
            Form form = new frmPrint(report);

            form.Text = "Department Master List";
            form.Show();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                using (LastADEntities b = new LastADEntities())
                {
                    //To generate data for DropDownList1
                    var itemcat = (from ic in b.ItemCategories select ic.CategoryName).ToList();
                    itemcat.Insert(0, "---Select---");
                    //DropDownList1.SelectedIndex = 0;

                    DropDownList1.DataSource = itemcat;
                    DropDownList1.DataBind();
                    //To generate the options for departments
                    var depts = from dept in b.Departments select dept.DepartmentName;
                    DeptList.DataSource = depts.ToArray();

                    DeptList.DataBind();
                    DeptList.Items.Remove(DeptList.Items.FindByText("Stationary Store Dept"));
                }
            }
        }
Пример #10
0
 /// <summary>
 /// 设置部门
 /// </summary>
 /// <param name="depts"></param>
 public void SetDept(List <Dept> depts)
 {
     DeptList.Clear();
     depts.ForEach(p => DeptList.Add(p));
 }