Ejemplo n.º 1
0
        public DepartmentListEntityDC GetAllDepartment()
        {
            DepartmentListEntityDC productResponse = new DepartmentListEntityDC();
            // AccountEntityDC member = new AccountEntityDC();
            AccountDAL memberDAL = new AccountDAL();

            productResponse = memberDAL.GetAllDepartment();
            return(productResponse);
        }
Ejemplo n.º 2
0
        public DepartmentListEntityDC GetAllDepartment()
        {
            int                    Count       = 0;
            AccountManager         member      = new AccountManager();
            DepartmentListEntityDC ListAccount = new DepartmentListEntityDC();

            ListAccount = member.GetAllDepartment();
            return(ListAccount);
        }
Ejemplo n.º 3
0
        public ActionResult GetAllDepartment()
        {
            int    Count  = 0;
            string roleid = null;

            AccountBLL             EmployeeBLL = new AccountBLL();
            DepartmentListEntityDC data        = new DepartmentListEntityDC();

            data = EmployeeBLL.GetAllDepartment();
            Dictionary <string, object> retData = new Dictionary <string, object>();

            retData.Add("data", data);
            retData.Add("total", Count);

            return(Json(retData, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 4
0
        public DepartmentListEntityDC GetAllDepartment()
        {
            DepartmentListEntityDC    Accounts    = new DepartmentListEntityDC();
            List <DepartmentEntityDC> AccountList = new List <DepartmentEntityDC>();

            using (DbConnection conn = Jaqen.CreateConnection())
            {
                conn.Open();
                try
                {
                    using (DbCommand sprocCmd = conn.CreateCommand())
                    {
                        sprocCmd.CommandType = CommandType.StoredProcedure;
                        sprocCmd.CommandText = GET_ALL_DEPARTMENT;


                        using (IDataReader sprocReader = Jaqen.ExecuteReader(sprocCmd))
                        {
                            while (sprocReader.Read())
                            {
                                DepartmentEntityDC Account = new DepartmentEntityDC();
                                Account.DepartmentID   = sprocReader["DepartmentID"].ToInt();
                                Account.DepartmentName = sprocReader["DepartmentName"].ToStringDefault();
                                AccountList.Add(Account);
                            }
                        }

                        Accounts.DepartmentList = AccountList;
                    }
                }
                catch (Exception ex)
                {
                    throw ex;
                }
                finally
                {
                    if (conn != null)
                    {
                        conn.Close();
                    }
                }
            }

            return(Accounts);
        }