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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
public IHttpActionResult PostEmployee(Employee employee) { try { DBlayer.InsertEmployee(employee); } catch (DbUpdateException ex) { throw ex; } return(CreatedAtRoute("DefaultApi", new { id = employee.EmployeeID }, employee)); }
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); } }
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); }
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)); }
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); }
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); }
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); }
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 })); }
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); } }
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); }
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); }
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); }
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); }