Пример #1
0
        public List <SectionDTO> SelectSection()
        {
            List <SectionDTO> sectiondto = new List <SectionDTO>();

            using (DBlayer dblayer = new DBlayer())
            {
                SqlCommand cmd = new SqlCommand("sp_SelectSection");
                cmd.CommandType = CommandType.StoredProcedure;
                sectiondto      = dblayer.GetEntityList <SectionDTO>(cmd);
            }
            return(sectiondto);
        }
Пример #2
0
        public List <StaffAllocationDTO> SelectStaffAllocationt()
        {
            List <StaffAllocationDTO> sad = new List <StaffAllocationDTO>();

            using (DBlayer dblayer = new DBlayer())
            {
                SqlCommand cmd = new SqlCommand("sp_SelectStaff");
                cmd.CommandType = CommandType.StoredProcedure;
                sad             = dblayer.GetEntityList <StaffAllocationDTO>(cmd);
            }
            return(sad);
        }
Пример #3
0
        public List <UploadFileDTO> SelectUploadFile()
        {
            List <UploadFileDTO> up = new List <UploadFileDTO>();

            using (DBlayer dblayer = new DBlayer())
            {
                SqlCommand cmd = new SqlCommand("sp_SelectUploadFile");
                cmd.CommandType = CommandType.StoredProcedure;
                up = dblayer.GetEntityList <UploadFileDTO>(cmd);
            }
            return(up);
        }
Пример #4
0
        public List <Employee> Employee()
        {
            List <Employee> Employee = new List <Employee>();

            using (DBlayer dblayer = new DBlayer())
            {
                SqlCommand cmd = new SqlCommand("sp_Employee");
                cmd.CommandType = CommandType.StoredProcedure;
                Employee        = dblayer.GetEntityList <Employee>(cmd);
            }
            return(Employee);
        }
Пример #5
0
        public List <ClassName> ClassName()
        {
            List <ClassName> ClassName = new List <ClassName>();

            using (DBlayer dblayer = new DBlayer())
            {
                SqlCommand cmd = new SqlCommand("sp_ClassName");
                cmd.CommandType = CommandType.StoredProcedure;
                ClassName       = dblayer.GetEntityList <ClassName>(cmd);
            }
            return(ClassName);
        }
Пример #6
0
        public List <SectionName> SectionName()
        {
            List <SectionName> dept = new List <SectionName>();

            using (DBlayer dblayer = new DBlayer())
            {
                SqlCommand cmd = new SqlCommand("sp_SectionName");
                cmd.CommandType = CommandType.StoredProcedure;
                dept            = dblayer.GetEntityList <SectionName>(cmd);
            }
            return(dept);
        }
Пример #7
0
        public List <StateMaster> SelectState()
        {
            List <StateMaster> state = new List <StateMaster>();

            using (DBlayer dblayer = new DBlayer())
            {
                SqlCommand cmd = new SqlCommand("sp_SelectState");
                cmd.CommandType = CommandType.StoredProcedure;
                state           = dblayer.GetEntityList <StateMaster>(cmd);
            }
            return(state);
        }
Пример #8
0
        public List <DepartmentDTO> SelectDepartment()
        {
            List <DepartmentDTO> dept = new List <DepartmentDTO>();

            using (DBlayer dblayer = new DBlayer())
            {
                SqlCommand cmd = new SqlCommand("sp_SelectDepartment");
                cmd.CommandType = CommandType.StoredProcedure;
                dept            = dblayer.GetEntityList <DepartmentDTO>(cmd);
            }
            return(dept);
        }
Пример #9
0
        public List <EventDetailsDTO> SelectEvent()
        {
            List <EventDetailsDTO> even = new List <EventDetailsDTO>();

            using (DBlayer dblayer = new DBlayer())
            {
                SqlCommand cmd = new SqlCommand("sp_SelectEvent");
                cmd.CommandType = CommandType.StoredProcedure;
                even            = dblayer.GetEntityList <EventDetailsDTO>(cmd);
            }
            return(even);
        }
Пример #10
0
        public List <CountryMaster> SelectCountry()
        {
            List <CountryMaster> Country = new List <CountryMaster>();

            using (DBlayer dblayer = new DBlayer())
            {
                SqlCommand cmd = new SqlCommand("sp_SelectCountry");
                cmd.CommandType = CommandType.StoredProcedure;
                Country         = dblayer.GetEntityList <CountryMaster>(cmd);
            }
            return(Country);
        }
Пример #11
0
        public List <UniverSityMaster> SelectUniverSity()
        {
            List <UniverSityMaster> uni = new List <UniverSityMaster>();

            using (DBlayer dblayer = new DBlayer())
            {
                SqlCommand cmd = new SqlCommand("sp_SelectUniverSity");
                cmd.CommandType = CommandType.StoredProcedure;
                uni             = dblayer.GetEntityList <UniverSityMaster>(cmd);
            }
            return(uni);
        }
Пример #12
0
        public List <DepartmentName> SelectDepartmentName()
        {
            List <DepartmentName> deptName = new List <DepartmentName>();

            using (DBlayer dblayer = new DBlayer())
            {
                SqlCommand cmd = new SqlCommand("sp_DepartmentName");
                cmd.CommandType = CommandType.StoredProcedure;
                deptName        = dblayer.GetEntityList <DepartmentName>(cmd);
            }
            return(deptName);
        }
Пример #13
0
        public List <Hod_AllocationDTO> SelectHod_Allocation()
        {
            List <Hod_AllocationDTO> hoda = new List <Hod_AllocationDTO>();

            using (DBlayer dblayer = new DBlayer())
            {
                SqlCommand cmd = new SqlCommand("sp_SelectHod_Allocation");
                cmd.CommandType = CommandType.StoredProcedure;
                hoda            = dblayer.GetEntityList <Hod_AllocationDTO>(cmd);
            }
            return(hoda);
        }
Пример #14
0
        public List <College1DTO> SelectCollegeName()
        {
            List <College1DTO> clg1 = new List <College1DTO>();

            using (DBlayer dblayer = new DBlayer())
            {
                SqlCommand cmd = new SqlCommand("sp_SelectCollegeName");
                cmd.CommandType = CommandType.StoredProcedure;
                clg1            = dblayer.GetEntityList <College1DTO>(cmd);
            }
            return(clg1);
        }
Пример #15
0
        public List <ClassDTO> SelectClass()
        {
            List <ClassDTO> cls = new List <ClassDTO>();

            using (DBlayer dblayer = new DBlayer())
            {
                SqlCommand cmd = new SqlCommand("sp_SelectClass");
                cmd.CommandType = CommandType.StoredProcedure;
                cls             = dblayer.GetEntityList <ClassDTO>(cmd);
            }
            return(cls);
        }
Пример #16
0
        public List <RoleName> RoleName()
        {
            List <RoleName> r = new List <RoleName>();

            using (DBlayer dblayer = new DBlayer())
            {
                SqlCommand cmd = new SqlCommand("sp_RoleName");
                cmd.CommandType = CommandType.StoredProcedure;
                r = dblayer.GetEntityList <RoleName>(cmd);
            }
            return(r);
        }
Пример #17
0
        public List <EmployeeDTO> SelectEmployee()
        {
            List <EmployeeDTO> emp = new List <EmployeeDTO>();

            using (DBlayer dblayer = new DBlayer())
            {
                SqlCommand cmd = new SqlCommand("sp_SelectEmployee");
                cmd.CommandType = CommandType.StoredProcedure;
                emp             = dblayer.GetEntityList <EmployeeDTO>(cmd);
            }
            return(emp);
        }
Пример #18
0
        public IHttpActionResult PostEmployee(Employee employee)
        {
            try
            {
                DBlayer.InsertEmployee(employee);
            }
            catch (DbUpdateException ex)
            {
                throw ex;
            }

            return(CreatedAtRoute("DefaultApi", new { id = employee.EmployeeID }, employee));
        }
Пример #19
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                // GitHub Test 000
                SqlCommand cmd = new SqlCommand("SELECT top(1) p1.* FROM Product p1 LEFT JOIN Product p2 ON (p1.Category_id = p2.Category_id AND p1.Prod_id < p2.Prod_id) WHERE p2.Prod_id IS NULL order by p1.Category_id desc");

                dlst_latest.DataSource = DBlayer.Sel(cmd);
                dlst_latest.DataBind();
            }catch (Exception ex)
            {
                LogError.Error(ex, System.Reflection.MethodBase.GetCurrentMethod().Name);
            }
        }
Пример #20
0
        public List <SelectCommonT_LoginDTO> SelectCommonT_Login(SelectCommonT_LoginProcDTO obj)
        {
            List <SelectCommonT_LoginDTO> commont_logindto = new List <SelectCommonT_LoginDTO>();

            using (DBlayer dblayer = new DBlayer())
            {
                SqlCommand cmd = new SqlCommand("sp_SelectCommonT_Login");
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@p_UserName", obj.UserName);
                cmd.Parameters.AddWithValue("@p_PassWord", obj.PassWord);
                commont_logindto = dblayer.GetEntityList <SelectCommonT_LoginDTO>(cmd);
            }
            return(commont_logindto);
        }
Пример #21
0
        public IActionResult Create([FromBody] Tenant tenant)
        {
            if (tenant == null)
            {
                return(BadRequest());
            }

            // TODO: Save the tenant here to DB
            DBlayer dbLayer = new DBlayer();

            tenant = dbLayer.Create(tenant);
            // tenant = TestData.tenant;
            return(CreatedAtRoute("tenant", new { id = tenant.Id }, tenant));
        }
Пример #22
0
        public List <HODApprovalDTO> SelectHODApproval(SelectHODApprovalProcDTO obj)
        {
            List <HODApprovalDTO> hod = new List <HODApprovalDTO>();

            using (DBlayer dblayer = new DBlayer())
            {
                SqlCommand cmd = new SqlCommand("sp_SelectHODApproval");
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.AddWithValue("@p_EventId", obj.EventId);
                cmd.Parameters.AddWithValue("@p_StudentId", obj.StudentId);
                hod = dblayer.GetEntityList <HODApprovalDTO>(cmd);
            }
            return(hod);
        }
Пример #23
0
        public bool RemoveDepartment(RemoveDepartmentDTO obj)
        {
            bool       res = false;
            SqlCommand cmd = new SqlCommand("sp_RemoveDepartment");

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@p_DepartmentId", obj.DepartmentId);
            int result = new DBlayer().ExecuteNonQuery(cmd);

            if (result != Int32.MaxValue)
            {
                res = true;
            }
            return(res);
        }
Пример #24
0
        public bool RemoveStaffAllocation(RemoveStaffAllocationDTO obj)
        {
            bool       res = false;
            SqlCommand cmd = new SqlCommand("@p_StaffAllocationId");

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@p_StaffAllocationId", obj.StaffAllocationId);
            int result = new DBlayer().ExecuteNonQuery(cmd);

            if (result != Int32.MaxValue)
            {
                res = true;
            }
            return(res);
        }
Пример #25
0
        public IActionResult Create([FromBody] WSIdentityProvider identityProvider, long tenantId)
        {
            if (identityProvider == null)
            {
                return(BadRequest());
            }

            // TODO: Save the IDP here to DB
            DBlayer dbLayer = new DBlayer();

            identityProvider.TenantId = tenantId;
            dbLayer.CreateIDP(identityProvider);

            //return CreatedAtRoute("IDP", new { id = identityProvider.Id }, identityProvider);
            return(Ok(new { identityProvider }));
        }
Пример #26
0
        protected void btn_log_Click(object sender, EventArgs e)
        {
            try
            {
                if (txt_name.Text != "" && txt_pass.Text != "")
                {
                    SqlCommand cmd = new SqlCommand("select cust_Id ,isadmin from customer where cust_username=@username and cust_pass=@pass ");
                    cmd.Parameters.AddWithValue("@username", txt_name.Text);
                    cmd.Parameters.AddWithValue("@pass", txt_pass.Text);
                    DataTable dt = DBlayer.Sel(cmd);
                    if (dt.Rows.Count != 0)
                    {
                        MultiView1.ActiveViewIndex = 1;
                        Session.Add("id", dt.Rows[0][0].ToString());
                        Session.Add("isadmin", int.Parse(dt.Rows[0][1].ToString()));


                        if (ch_rem.Checked)
                        {
                            HttpCookie co = new HttpCookie("log");
                            co.Expires = DateTime.Now.AddDays(10);
                            co.Values.Add("id", dt.Rows[0][0].ToString());
                            co.Values.Add("isadmin", dt.Rows[0][1].ToString());

                            Response.Cookies.Add(co);
                        }
                        if (int.Parse(Session["isadmin"].ToString()) == 1)
                        {
                            Response.Redirect("~/Admin/HomeAdmin.aspx", false);
                        }
                        else
                        {
                            Response.Redirect("~/Annonymous/Home.aspx", false);
                        }
                    }
                    else
                    {
                        lbl_msg.Text = "invalid UserName or Password";
                    }
                }
            }
            catch (Exception ex)
            {
                LogError.Error(ex, System.Reflection.MethodBase.GetCurrentMethod().Name);
            }
        }
Пример #27
0
        public bool SaveCommonT_Login(SaveCommonT_LoginDTO obj)
        {
            bool       res = false;
            SqlCommand cmd = new SqlCommand("sp_SaveCommonT_Login");

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@p_Name", obj.Name);
            cmd.Parameters.AddWithValue("@p_UserName", obj.UserName);
            cmd.Parameters.AddWithValue("@p_PassWord", obj.PassWord);
            cmd.Parameters.AddWithValue("@p_Role", obj.Role);
            int result = new DBlayer().ExecuteNonQuery(cmd);

            if (result != Int32.MaxValue)
            {
                res = true;
            }
            return(res);
        }
Пример #28
0
        public bool SaveHod_Allocation(SaveHod_AllocationDTO obj)
        {
            bool res = false;

            obj.CreatedBy = "1001";
            SqlCommand cmd = new SqlCommand("sp_SaveHod_Allocation");

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@p_DepartmentId", obj.DepartmentId);
            cmd.Parameters.AddWithValue("@p_EmployeeId", obj.EmployeeId);
            cmd.Parameters.AddWithValue("@p_ActionBy", obj.CreatedBy);
            int result = new DBlayer().ExecuteNonQuery(cmd);

            if (result != Int32.MaxValue)
            {
                res = true;
            }
            return(res);
        }
Пример #29
0
        public bool SaveRole(SaveRoleDTO obj)
        {
            bool res = false;

            obj.CreatedBy = "1001";
            SqlCommand cmd = new SqlCommand("sp_SaveRole");

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@p_Name", obj.Name);
            cmd.Parameters.AddWithValue("@p_Code", obj.Code);
            cmd.Parameters.AddWithValue("@p_ActionBy", obj.CreatedBy);
            int result = new DBlayer().ExecuteNonQuery(cmd);

            if (result != Int32.MaxValue)
            {
                res = true;
            }
            return(res);
        }
Пример #30
0
        public bool ModifyDepartment(ModifyDepartmentDTO obj)
        {
            bool res = false;

            obj.ModifiedBy = "1002";
            SqlCommand cmd = new SqlCommand("sp_ModifyDepartment");

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@p_DepartmentId", obj.DepartmentId);
            cmd.Parameters.AddWithValue("@p_Name", obj.Name);
            cmd.Parameters.AddWithValue("@p_Code", obj.Code);
            cmd.Parameters.AddWithValue("@p_CollegeId", obj.CollegeId);
            cmd.Parameters.AddWithValue("@p_ActionBy", obj.ModifiedBy);
            int result = new DBlayer().ExecuteNonQuery(cmd);

            if (result != Int32.MaxValue)
            {
                res = true;
            }
            return(res);
        }