public bool GetLeavesAssignedByRoleById(int id, out LeaveAssignedByRole objLeaves) { DBDataHelper.ConnectionString = ConfigurationManager.ConnectionStrings["CSBiometricAttendance"].ConnectionString; List <SqlParameter> lstparameter = new List <SqlParameter>(); lstparameter.Add(new SqlParameter("@id", id)); DataTable dt = new DataTable(); DataSet ds; int i = 0; string query = "Select * from tblLeaveAssignedByRole where Id = @id"; LeaveAssignedByRole objLeaves1 = new LeaveAssignedByRole(); using (DBDataHelper objDDBDataHelper = new DBDataHelper()) { ds = objDDBDataHelper.GetDataSet(query, SQLTextType.Query, lstparameter); List <LeaveAssignedByRole> lstLeaveType = new List <LeaveAssignedByRole>(); Leaves objLeave = new Leaves(); foreach (DataRow rows in ds.Tables[0].Rows) { objLeaves1.Id = Convert.ToInt32(ds.Tables[0].Rows[i][0]); objLeaves1.RoleId = Convert.ToInt32(ds.Tables[0].Rows[i][1]); objLeaves1.LeaveTypeId = Convert.ToInt32(ds.Tables[0].Rows[i][2]); objLeaves1.NoOfLeaves = Convert.ToInt32(ds.Tables[0].Rows[i][3]); objLeaves1.IsPromoted = Convert.ToBoolean(ds.Tables[0].Rows[i][4]); GetLeavesById(objLeaves1.LeaveTypeId, out objLeave); objLeaves1.LeaveName = objLeave.LeaveName; objLeaves1.RoleName = GetRoleById(objLeaves1.RoleId); lstLeaveType.Add(objLeaves1); i++; } objLeaves = objLeaves1; return(true); } }
/// <summary> /// Get all Durations /// </summary> /// <returns>List of Duration objects</returns> public List <Duration> GetAllDurations() { DBDataHelper.ConnectionString = ConfigurationManager.ConnectionStrings["CSBiometricAttendance"].ConnectionString; DataTable dt = new DataTable(); DataSet ds; int i = 0; using (DBDataHelper objDDBDataHelper = new DBDataHelper()) { ds = objDDBDataHelper.GetDataSet("spGetAllDurations", SQLTextType.Stored_Proc); List <Duration> lstDuration = new List <Duration>(); Leaves objLeaves = new Leaves(); foreach (DataRow rows in ds.Tables[0].Rows) { Duration objDuration = new Duration(); objDuration.Id = Convert.ToInt32(ds.Tables[0].Rows[i][0]); objDuration.leaveId = Convert.ToInt32(ds.Tables[0].Rows[i][1]); GetLeavesById(objDuration.leaveId, out objLeaves); objDuration.leaveName = objLeaves.LeaveName; objDuration.duration = (TimeSpan)(ds.Tables[0].Rows[i][2]); lstDuration.Add(objDuration); i++; } return(lstDuration); } }
public bool GetLeavesById(int leaveId, out Leaves objLeaves) { DBDataHelper.ConnectionString = ConfigurationManager.ConnectionStrings["CSBiometricAttendance"].ConnectionString; List <SqlParameter> lstLeave = new List <SqlParameter>(); lstLeave.Add(new SqlParameter("@leaveId", leaveId)); DataTable dt = new DataTable(); DataSet ds; int i = 0; Leaves objLeaves1 = new Leaves(); using (DBDataHelper objDDBDataHelper = new DBDataHelper()) { ds = objDDBDataHelper.GetDataSet("spGetTypeOfLeaveById ", SQLTextType.Stored_Proc, lstLeave); List <Leaves> lstLeaveType = new List <Leaves>(); foreach (DataRow rows in ds.Tables[0].Rows) { objLeaves1.Id = leaveId; objLeaves1.LeaveName = (ds.Tables[0].Rows[i][0]).ToString(); lstLeaveType.Add(objLeaves1); i++; } objLeaves = objLeaves1; return(true); } }
public void Generate(int2 cellIndex) { parentCell = worley.GetCellProfile(cellIndex); vertices = new NativeList <float3>(Allocator.Temp); triangles = new NativeList <int>(Allocator.Temp); random = new Unity.Mathematics.Random((uint)(parentCell.data.value * 1000)); leaves = new Leaves(vertices, triangles); trunk = new Trunk(vertices, triangles, random); baseHeight = simplex.GetSimplex(parentCell.data.position.x, parentCell.data.position.z) * 15; DrawChildCells(worley.frequency * 2); //leaves.Draw(parentCellProfile, 0); trunk.DrawTrunk(parentCell); DrawCellSegments(parentCell); DrawCellLines(parentCell); MakeMesh(); vertices.Dispose(); triangles.Dispose(); }
public Branch Generate(Branch parent, int depth, int i, int nMax, float angle, float length, Vec2 branchVec) { // var parentAngle = new Vec2(parent.X, parent.Y).GetAngle() * 180 / (float)Math.PI; var p1 = GetAngleVector(new Vec2(parent.X, parent.Y), angle, length); index++; var stroke = parent.Paint.StrokeWidth - 1; var particle = new Branch(_engine, p1.X, p1.Y, stroke, true, stroke / 5000, false, index); // particle.Paint.StrokeWidth -= 10 - nMax; particle.RigidBody.JointRevolute(parent.RigidBody, 0, 0, false, -0, 0, 0f); parent.AddNode(particle); if (i < nMax) { var a = Generate(particle, 0, i, nMax - 1, angle + 30, length - 10, new Vec2()); var b = Generate(particle, 0, i, nMax - 1, angle - 30, length - 10, new Vec2()); //a.RigidBody.JointRevolute(b.RigidBody, 0, 0, false, -1, 1, 0); // _engine.Physics.AddCircle(a.X, a.Y, 10, 0, 0.2f, 0.2f, 0.2f, 1); // _engine.Physics.AddCircle(b.X, b.Y, 10, 0, 0.2f, 0.2f, 0.2f, 1); } else { // var f = _engine.Physics.FactoryBody.CreateRigidVertex() // .CreateBox(0.2f, 0.2f, 10, 10, 0.2f, true) // .CreateBodyDef(particle.X, particle.Y, 0, true, false) // .Build(0.001f); // f.JointRevolute(particle.RigidBody, 0, 0, false, 0, 0, 0); Leaves.Add(particle.RigidBody); } return(particle); }
// GET: TestAPI public async Task <ActionResult> GetLeaves() { WebClient client = new WebClient(); Leaves leaves = await client.GetLeaves(); return(View(leaves)); }
public JsonResult ApplyLeave(Leaves leav) { try { int employeeId = Convert.ToInt32(Session["Emp_ID"]); leav.Date_Applied = DateTime.Now; leav.Is_Approved = false; leav.Is_Rejected = false; leav.Employee_Id = employeeId; objLeaveSetups = new Leaves_BLL(leav); var flag = objLeaveSetups.Insert(); if (flag) { return(Json(new { Success = true, msg = "Applied successfully" }, JsonRequestBehavior.AllowGet)); } else { return(Json(new { Success = false, msg = "Failed" }, JsonRequestBehavior.AllowGet)); } } catch (Exception ex) { return(Json(new { Success = false, msg = ex.Message }, JsonRequestBehavior.AllowGet)); } }
public StoryGraph(ISceneNode root, IReadOnlyList <Pair <int> > edges, bool sameLayout) { SameLayout = sameLayout; var aspectsUnsorted = root.GetComponent <IStoryComponent>().EnumerateStoryAspectsDeep(SameLayout).ToArray(); var maxId = aspectsUnsorted.Max(x => x.Node.Id); EnoughIntegers = Enumerable.Range(0, maxId + 1).ToArray(); Aspects = aspectsUnsorted.ToDictionary(x => x.Node.Id, x => x); NodeObjects = aspectsUnsorted.ToDictionary(x => x.Node.Id, x => x.Node); NodeIds = aspectsUnsorted.Select(x => x.Node.Id).ToArray(); IsUsed = EnoughIntegers.Select(x => NodeObjects.ContainsKey(x)).ToArray(); Indices = NodeObjects.ToDictionary(x => x.Value, x => x.Key); Children = Aspects.ToDictionary(x => x.Key, x => (IReadOnlyList <int>)x.Value.EnumerateImmediateStoryChildren(SameLayout).Select(y => y.Node.Id).ToArray()); Root = root.Id; Parents = NodeObjects.ToDictionary(x => x.Key, x => x.Value.ParentNode?.Id ?? -1); Depths = NodeIds.ToDictionary(x => x, CalculateNodeDepth); Depth = CalculateDepth(Root); Leaves = EnumerateLeaves(Root).ToArray(); NonLeaves = EnumerateNonLeaves(Root).ToArray(); BuildPrevNext(edges, out var next, out var previous, out var goodEdges); Next = next; Previous = previous; Neighbors = Leaves.ToDictionary(x => x, x => (IReadOnlyList <int>)Next[x].Concat(Previous[x]).ToArray()); Edges = goodEdges; LeveledEdges = BuildLeveledEdges(); BuildLeveledPrevNext(out var leveledNext, out var leveledPrev); LeveledNext = leveledNext; LeveledPrevious = leveledPrev; LeveledNeighbors = NodeIds.ToDictionary(x => x, x => (IReadOnlyList <int>)LeveledNext[x].Concat(LeveledPrevious[x]).ToArray()); ExternalConnections = BuildExternal(); NodesInBfsOrder = BreadthFirstSearch().ToArray(); }
public Leave AddLeave(LeaveTypeEnum leavesType, DateTimeOffset startDate, DateTimeOffset endDate, string purpose, string delegation, DateTimeOffset createDate) { TimeSpan span = endDate.Subtract(startDate); double duration = span.TotalDays + 1; double remaining = 12 - duration; //if leave not null then remaining equal to latest remaining minus duration if (Leaves.Count > 0) { remaining = Leaves.Select(o => o.Remaining).Max(); remaining = remaining - duration; } //no idea bool status = false; var leave = new Leave(Guid.NewGuid(), this.Identity, leavesType, startDate, endDate, purpose, delegation, duration, remaining, status, createDate); if (Leaves == null) { Leaves = new List <Leave>().AsReadOnly(); } var list = Leaves.ToList(); list.Add(leave); ReadModel.Leaves.Add(new LeaveReadModel(leave)); Leaves = list.AsReadOnly(); return(leave); }
void BuildTrees(Block trunk, int x, int y, int z) { if (trunk.bType != Block.BlockType.WOODBASE) return; Block t = trunk.GetBlock (x, y + 1, z); if (t != null) { //t.SetType (Block.BlockType.WOOD); chunkData [x, y+1, z] = new Wood (t.position, this); Block t1 = t.GetBlock (x, y + 2, z); if (t1 != null) { //t1.SetType (Block.BlockType.WOOD); chunkData [x, y + 2, z] = new Wood (t1.position, this); for (int i = -1; i <= 1; i++) for (int j = -1; j <= 1; j++) for (int k = 3; k <= 4; k++) { Block t2 = trunk.GetBlock (x + i, y + k, z + j); if (t2 != null) chunkData[x + i, y + k, z + j] = new Leaves (t2.position, this); //t2.SetType (Block.BlockType.LEAVES); else return; } Block t3 = t1.GetBlock (x, y + 5, z); if (t3 != null) { chunkData[x, y + 5, z] = new Leaves (t3.position, this); //t3.SetType (Block.BlockType.LEAVES); } } } }
public List<AssignLeaveViewModel> BindGridData() { MasterEntries objMasterEntries = new MasterEntries(); DBDataHelper.ConnectionString = ConfigurationManager.ConnectionStrings["CSBiometricAttendance"].ConnectionString; DataTable dt = new DataTable(); List<SqlParameter> lstData = new List<SqlParameter>(); lstData.Add(new SqlParameter("@employeeId", Convert.ToInt32(Session["employeeId"]))); lstData.Add(new SqlParameter("@dateMonth", Calendar1.SelectedDate.Month)); lstData.Add(new SqlParameter("@dateYear", Calendar1.SelectedDate.Year)); lstData.Add(new SqlParameter("@IsDeleted", Convert.ToInt32(0))); DataSet ds; int i = 0; string query = "SELECT Id , LeaveTypeId , [Date] FROM tblLeave WHERE MONTH([Date]) = @dateMonth AND YEAR([Date]) = @dateYear And EmployeeId = @employeeId And IsDeleted = @IsDeleted"; using (DBDataHelper objDDBDataHelper = new DBDataHelper()) { ds = objDDBDataHelper.GetDataSet(query, SQLTextType.Query, lstData); List<AssignLeaveViewModel> lstLeaves = new List<AssignLeaveViewModel>(); foreach (DataRow row in ds.Tables[0].Rows) { AssignLeaveViewModel objLeaves = new AssignLeaveViewModel(); int Id = Convert.ToInt32(ds.Tables[0].Rows[i][0]); int leaveId = Convert.ToInt32(ds.Tables[0].Rows[i][1]); Leaves objLeaves1 = new Leaves(); objMasterEntries.GetLeavesById(leaveId, out objLeaves1); objLeaves.leaveId = Id; objLeaves.Id = objLeaves1.Id; objLeaves.LeaveName = objLeaves1.LeaveName; objLeaves.EmployeeId = Convert.ToInt32(Session["employeeId"]); objLeaves.Date = (Convert.ToDateTime(ds.Tables[0].Rows[i][2])).Date; lstLeaves.Add(objLeaves); i++; } return lstLeaves; } }
public override void Setup(Beast beast, GameObject holder) { base.Setup(beast, holder); SpriteRenderer r = Leaves.First().GetComponent <SpriteRenderer>(); Leaves.First().transform.localPosition = startPos; //100 pixels per unit }
public override void ShiftKeys(Func <t2, t2> ShiftKey) { Leaves.ForEach(delegate(ILeaf <t1, t2, t3> l) { l.ShiftKeys(ShiftKey); }); }
public async Task <ActionResult <Leaves> > PostLeaves(Leaves leaves) { _context.Leaves.Add(leaves); await _context.SaveChangesAsync(); return(CreatedAtAction("GetLeaves", new { id = leaves.id }, leaves)); }
public async Task <IActionResult> PutLeaves(int id, Leaves leaves) { if (id != leaves.id) { return(BadRequest()); } _context.Entry(leaves).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!LeavesExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
internal bool AddLeave(Leaves model) { bool result = false; try { string query = "INSERT INTO leaves (fromdate, todate, reason, askedby, hodid, facultyid, status) VALUES(@fromdate, @todate, @reason, @askedby, @hodid, @facultyid, @status)"; SqlCommand cmd = new SqlCommand(query, Conn); cmd.Parameters.Add(new SqlParameter("fromdate", model.FromDate)); cmd.Parameters.Add(new SqlParameter("todate", model.ToDate)); cmd.Parameters.Add(new SqlParameter("reason", model.Reason)); cmd.Parameters.Add(new SqlParameter("askedby", model.AskedBy)); cmd.Parameters.Add(new SqlParameter("hodid", model.HodID)); cmd.Parameters.Add(new SqlParameter("facultyid", model.FacultyID)); cmd.Parameters.Add(new SqlParameter("status", model.Status)); Conn.Open(); int rows = cmd.ExecuteNonQuery(); if (rows > 0) { result = true; } } catch (Exception exp) { } finally { Conn.Close(); } return(result); }
public JsonResult AccpetLeave(int id) { objleaveproperty = new Leaves(); objleaveproperty.Id = id; objLeaveSetups = new Leaves_BLL(objleaveproperty); DataTable dt = objLeaveSetups.SelectOne(); objleaveproperty.LeaveType = Convert.ToInt32(dt.Rows[0]["LeaveType"].ToString()); objleaveproperty.TotalDays = Convert.ToInt32(dt.Rows[0]["TotalDays"].ToString()); objleaveproperty.Employee_Id = Convert.ToInt32(dt.Rows[0]["Employee_Id"].ToString()); if (objleaveproperty.LeaveType == 1) {//casual int currentcasualvalues = Convert.ToInt32(dt.Rows[0]["Casual_Leaves"].ToString()); int newcasualvalues = currentcasualvalues - objleaveproperty.TotalDays; objleaveproperty.TotalDays = newcasualvalues; } else {//annual int currentannualvalues = Convert.ToInt32(dt.Rows[0]["Annual_Leaves"].ToString()); int newannualvalues = currentannualvalues - objleaveproperty.TotalDays; objleaveproperty.TotalDays = newannualvalues; } objLeaveSetups = new Leaves_BLL(objleaveproperty); var flag = objLeaveSetups.AcceptLeave(); return(Json(new { success = true, msg = "successfully" }, JsonRequestBehavior.AllowGet)); }
public MerkleTree AddLeaf(MerkleNode node) { Nodes.Add(node); Leaves.Add(node); SortedLeaves.Add(node.Hash, node); return(this); }
private RouteBuilderNode Pop() { var result = Leaves.First; Leaves.Remove(result); return(result.Value); }
public override void TakeDamage(float damage, bool isCurseDmg) { Drop(); Leaves.Play(); Shake(); Instantiate(berrylessBush, transform.position, transform.rotation); Destroy(gameObject); }
/// <summary> /// Removes current from leaves list and adds node there instead /// </summary> /// <param name="current"></param> /// <param name="node"></param> private void UpdateLeavesList(ActivationNode current, ActivationNode node) { if (!Leaves.Contains(node)) { Leaves.Add(node); } Leaves.Remove(current); }
public async Task <IActionResult> RemoveLeave(int Id) { Leaves leaves = await _repo.Get(Id); _repo.RemoveLeave(leaves); await _unitofwork.CompleteAsync(); return(Ok(Id)); }
protected void Update() { var temp = Leaves.First().transform; //current time(to sync it up with others) * pi * frequency(higher is faster) * amplitude float y = startPos.y + Mathf.Sin(Time.fixedTime * Mathf.PI * 1f) * 0.05f; Leaves.First().transform.localPosition = new Vector3(temp.localPosition.x, y, temp.localPosition.z); }
public List <AssignLeaveViewModel> GetDataForGridview() { MasterEntries objMasterEntries = new MasterEntries(); DBDataHelper.ConnectionString = ConfigurationManager.ConnectionStrings["CSBiometricAttendance"].ConnectionString; DateTime sessionStartDate = new DateTime(); DateTime sessionEndDate = new DateTime(); if (DateTime.Now.Month <= 7) { sessionStartDate = new DateTime(DateTime.Now.Year - 1, 8, 1); sessionEndDate = new DateTime(DateTime.Now.Year, 7, 31); } else { sessionStartDate = new DateTime(DateTime.Now.Year, 8, 1); sessionEndDate = new DateTime(DateTime.Now.Year + 1, 7, 31); } List <SqlParameter> lstData = new List <SqlParameter>(); lstData.Add(new SqlParameter("@employeeId", Convert.ToInt32(Session["employeeId"]))); lstData.Add(new SqlParameter("@sessionStartDate", sessionStartDate)); lstData.Add(new SqlParameter("@sessionEndDate", sessionEndDate)); lstData.Add(new SqlParameter("@IsDeleted", Convert.ToInt32(0))); DataSet ds; int i = 0; string query = @"SELECT Id , LeaveTypeId , [Date] FROM tblLeave WHERE [Date] >= @sessionStartDate AND [Date] <= @sessionEndDate AND EmployeeId = @employeeId AND IsDeleted = @IsDeleted"; using (DBDataHelper objDDBDataHelper = new DBDataHelper()) { ds = objDDBDataHelper.GetDataSet(query, SQLTextType.Query, lstData); List <AssignLeaveViewModel> lstLeaves = new List <AssignLeaveViewModel>(); foreach (DataRow row in ds.Tables[0].Rows) { AssignLeaveViewModel objLeaves = new AssignLeaveViewModel(); int Id = Convert.ToInt32(ds.Tables[0].Rows[i][0]); int leaveId = Convert.ToInt32(ds.Tables[0].Rows[i][1]); Leaves objLeaves1 = new Leaves(); objMasterEntries.GetLeavesById(leaveId, out objLeaves1); objLeaves.leaveId = Id; objLeaves.Id = objLeaves1.Id; objLeaves.LeaveName = objLeaves1.LeaveName; objLeaves.EmployeeId = Convert.ToInt32(Session["employeeId"]); objLeaves.Date = (Convert.ToDateTime(ds.Tables[0].Rows[i][2])).Date; lstLeaves.Add(objLeaves); i++; } return(lstLeaves); } }
public static void Unload() { Rain.Unload(); Thunder.Unload(); Ice.Unload(); Leaves.Unload(); Ghost.Unload(); Twinkle.Unload(); Spark.Unload(); }
//------------------------------------------------------------------------- // Load, Unload public static void Load(System.Action pre, System.Action done) { Rain.Load(pre, done); Thunder.Load(pre, done); Ice.Load(pre, done); Leaves.Load(pre, done); Ghost.Load(pre, done); Twinkle.Load(pre, done); Spark.Load(pre, done); }
public List<AssignLeaveViewModel> GetDataForGridview() { MasterEntries objMasterEntries = new MasterEntries(); DBDataHelper.ConnectionString = ConfigurationManager.ConnectionStrings["CSBiometricAttendance"].ConnectionString; DateTime sessionStartDate = new DateTime(); DateTime sessionEndDate = new DateTime(); if (DateTime.Now.Month <= 7) { sessionStartDate = new DateTime(DateTime.Now.Year - 1, 8, 1); sessionEndDate = new DateTime(DateTime.Now.Year, 7, 31); } else { sessionStartDate = new DateTime(DateTime.Now.Year, 8, 1); sessionEndDate = new DateTime(DateTime.Now.Year + 1, 7, 31); } List<SqlParameter> lstData = new List<SqlParameter>(); lstData.Add(new SqlParameter("@employeeId", Convert.ToInt32(Session["employeeId"]))); lstData.Add(new SqlParameter("@sessionStartDate", sessionStartDate)); lstData.Add(new SqlParameter("@sessionEndDate", sessionEndDate)); lstData.Add(new SqlParameter("@IsDeleted", Convert.ToInt32(0))); DataSet ds; int i = 0; string query = @"SELECT Id , LeaveTypeId , [Date] FROM tblLeave WHERE [Date] >= @sessionStartDate AND [Date] <= @sessionEndDate AND EmployeeId = @employeeId AND IsDeleted = @IsDeleted"; using (DBDataHelper objDDBDataHelper = new DBDataHelper()) { ds = objDDBDataHelper.GetDataSet(query, SQLTextType.Query, lstData); List<AssignLeaveViewModel> lstLeaves = new List<AssignLeaveViewModel>(); foreach (DataRow row in ds.Tables[0].Rows) { AssignLeaveViewModel objLeaves = new AssignLeaveViewModel(); int Id = Convert.ToInt32(ds.Tables[0].Rows[i][0]); int leaveId = Convert.ToInt32(ds.Tables[0].Rows[i][1]); Leaves objLeaves1 = new Leaves(); objMasterEntries.GetLeavesById(leaveId, out objLeaves1); objLeaves.leaveId = Id; objLeaves.Id = objLeaves1.Id; objLeaves.LeaveName = objLeaves1.LeaveName; objLeaves.EmployeeId = Convert.ToInt32(Session["employeeId"]); objLeaves.Date = (Convert.ToDateTime(ds.Tables[0].Rows[i][2])).Date; lstLeaves.Add(objLeaves); i++; } return lstLeaves; } }
public override int GetHashCode() { unchecked { var result = (Leaves != null ? Leaves.GetHashCode() : 0); result = (result * 397) ^ CreatedDate.GetHashCode(); result = (result * 397) ^ Id.GetHashCode(); result = (result * 397) ^ (Titles != null ? Titles.GetHashCode() : 0); result = (result * 397) ^ (Friend != null ? Friend.GetHashCode() : 0); return(result); } }
static void getLeaves() { using (var context = new Context()) { Leaves hp = new Leaves(); foreach (var item in context.Leaves.ToList()) { Console.WriteLine($"ID {item.LeaveId} Description {item.Descriptions} FromDate{item.FromDate}-ToDate{item.ToDate} -EmployeeId{item.EmployeeId}"); } } }
static void removeLeaves() { using (var context = new Context()) { Leaves hp = new Leaves(); Console.WriteLine("Enter Leave Id"); hp.LeaveId = Convert.ToInt32(Console.ReadLine()); context.Leaves.Remove(hp); context.SaveChanges(); } }
/// <summary> /// Checks if the Node is odd and adds a copy of the Left Node of The Last Node to the List /// </summary> public List <Node> CheckIfNodeCountIsOdd(List <Node> nodesToBeLayered) { if (!(nodesToBeLayered.Count == 1)) { if (nodesToBeLayered.Count % 2 != 0) { nodesToBeLayered.Add(Leaves.Last()); } } return(nodesToBeLayered); }
protected void lkbEditLeave_Click(object sender, EventArgs e) { MasterEntries objMasterEntry = new MasterEntries(); List <Leaves> objListLeaves = new List <Leaves>(); LinkButton b = (LinkButton)sender; Leaves objLeaves = new Leaves(); int Id = Convert.ToInt32(b.CommandArgument); objMasterEntry.GetLeavesById(Id, out objLeaves); txtEditLeave.Text = objLeaves.LeaveName; Session["LeaveId"] = Id; popupEditLeave.Show(); }
protected void lkbEditLeave_Click(object sender, EventArgs e) { MasterEntries objMasterEntry = new MasterEntries(); List<Leaves> objListLeaves = new List<Leaves>(); LinkButton b = (LinkButton)sender; Leaves objLeaves = new Leaves(); int Id = Convert.ToInt32(b.CommandArgument); objMasterEntry.GetLeavesById(Id, out objLeaves); txtEditLeave.Text = objLeaves.LeaveName; Session["LeaveId"] = Id; popupEditLeave.Show(); }
public static Block GetBlockById(byte blockId) { Block block = null; if (CustomBlockFactory != null) { block = CustomBlockFactory.GetBlockById(blockId); } if (block != null) return block; if (blockId == 0) block = new Air(); else if (blockId == 1) block = new Stone(); else if (blockId == 2) block = new Grass(); else if (blockId == 3) block = new Dirt(); else if (blockId == 4) block = new Cobblestone(); else if (blockId == 5) block = new Planks(); else if (blockId == 6) block = new Sapling(); else if (blockId == 7) block = new Bedrock(); else if (blockId == 8) block = new FlowingWater(); else if (blockId == 9) block = new StationaryWater(); else if (blockId == 10) block = new FlowingLava(); else if (blockId == 11) block = new StationaryLava(); else if (blockId == 12) block = new Sand(); else if (blockId == 13) block = new Gravel(); else if (blockId == 14) block = new GoldOre(); else if (blockId == 15) block = new IronOre(); else if (blockId == 16) block = new CoalOre(); else if (blockId == 17) block = new Log(); else if (blockId == 18) block = new Leaves(); else if (blockId == 19) block = new Sponge(); else if (blockId == 20) block = new Glass(); else if (blockId == 21) block = new LapisOre(); else if (blockId == 22) block = new LapisBlock(); else if (blockId == 23) block = new Dispenser(); else if (blockId == 24) block = new Sandstone(); else if (blockId == 25) block = new NoteBlock(); else if (blockId == 26) block = new Bed(); else if (blockId == 27) block = new GoldenRail(); else if (blockId == 28) block = new DetectorRail(); else if (blockId == 30) block = new Cobweb(); else if (blockId == 31) block = new TallGrass(); else if (blockId == 32) block = new DeadBush(); else if (blockId == 35) block = new Wool(); else if (blockId == 37) block = new YellowFlower(); else if (blockId == 38) block = new Flower(); else if (blockId == 39) block = new BrownMushroom(); else if (blockId == 40) block = new RedMushroom(); else if (blockId == 41) block = new GoldBlock(); else if (blockId == 42) block = new IronBlock(); else if (blockId == 43) block = new DoubleStoneSlab(); else if (blockId == 44) block = new StoneSlab(); else if (blockId == 45) block = new Bricks(); else if (blockId == 46) block = new Tnt(); else if (blockId == 47) block = new Bookshelf(); else if (blockId == 48) block = new MossStone(); else if (blockId == 49) block = new Obsidian(); else if (blockId == 50) block = new Torch(); else if (blockId == 51) block = new Fire(); else if (blockId == 52) block = new MonsterSpawner(); else if (blockId == 53) block = new OakWoodStairs(); else if (blockId == 54) block = new Chest(); else if (blockId == 55) block = new RedstoneWire(); else if (blockId == 56) block = new DiamondOre(); else if (blockId == 57) block = new DiamondBlock(); else if (blockId == 58) block = new CraftingTable(); else if (blockId == 59) block = new Wheat(); else if (blockId == 60) block = new Farmland(); else if (blockId == 61) block = new Furnace(); else if (blockId == 62) block = new LitFurnace(); else if (blockId == 63) block = new StandingSign(); else if (blockId == 64) block = new WoodenDoor(); else if (blockId == 65) block = new Ladder(); else if (blockId == 66) block = new Rail(); else if (blockId == 67) block = new CobblestoneStairs(); else if (blockId == 68) block = new WallSign(); else if (blockId == 69) block = new Lever(); else if (blockId == 70) block = new StonePressurePlate(); else if (blockId == 71) block = new IronDoor(); else if (blockId == 72) block = new WoodenPressurePlate(); else if (blockId == 73) block = new RedstoneOre(); else if (blockId == 74) block = new LitRedstoneOre(); else if (blockId == 75) block = new UnlitRedstoneTorch(); else if (blockId == 76) block = new RedstoneTorch(); else if (blockId == 77) block = new StoneButton(); else if (blockId == 78) block = new SnowLayer(); else if (blockId == 79) block = new Ice(); else if (blockId == 80) block = new Snow(); else if (blockId == 81) block = new Cactus(); else if (blockId == 82) block = new Clay(); else if (blockId == 83) block = new Reeds(); else if (blockId == 85) block = new Fence(); else if (blockId == 86) block = new Pumpkin(); else if (blockId == 87) block = new Netherrack(); else if (blockId == 88) block = new SoulSand(); else if (blockId == 89) block = new Glowstone(); else if (blockId == 90) block = new Portal(); else if (blockId == 91) block = new LitPumpkin(); else if (blockId == 92) block = new Cake(); else if (blockId == 93) block = new UnpoweredRepeater(); else if (blockId == 94) block = new PoweredRepeater(); else if (blockId == 95) block = new InvisibleBedrock(); else if (blockId == 96) block = new Trapdoor(); else if (blockId == 97) block = new MonsterEgg(); else if (blockId == 98) block = new StoneBrick(); else if (blockId == 99) block = new BrownMushroomBlock(); else if (blockId == 100) block = new RedMushroomBlock(); else if (blockId == 101) block = new IronBars(); else if (blockId == 102) block = new GlassPane(); else if (blockId == 103) block = new Melon(); else if (blockId == 106) block = new Vine(); else if (blockId == 107) block = new FenceGate(); else if (blockId == 108) block = new BrickStairs(); else if (blockId == 109) block = new StoneBrickStairs(); else if (blockId == 110) block = new Mycelium(); else if (blockId == 111) block = new Waterlily(); else if (blockId == 112) block = new NetherBrick(); else if (blockId == 113) block = new NetherBrickFence(); else if (blockId == 114) block = new NetherBrickStairs(); else if (blockId == 115) block = new NetherWart(); else if (blockId == 116) block = new EnchantingTable(); else if (blockId == 117) block = new BrewingStand(); else if (blockId == 120) block = new EndPortalFrame(); else if (blockId == 121) block = new EndStone(); else if (blockId == 122) block = new LitRedstoneLamp(); else if (blockId == 123) block = new RedstoneLamp(); else if (blockId == 126) block = new ActivatorRail(); else if (blockId == 127) block = new Cocoa(); else if (blockId == 128) block = new SandStoneStairs(); else if (blockId == 129) block = new EmeraldOre(); else if (blockId == 131) block = new TripwireHook(); else if (blockId == 132) block = new Tripwire(); else if (blockId == 133) block = new EmeraldBlock(); else if (blockId == 134) block = new SpruceWoodStairs(); else if (blockId == 135) block = new BirchWoodStairs(); else if (blockId == 136) block = new JungleWoodStairs(); else if (blockId == 139) block = new CobblestoneWall(); else if (blockId == 140) block = new FlowerPot(); else if (blockId == 141) block = new Carrots(); else if (blockId == 142) block = new Potatoes(); else if (blockId == 143) block = new WoodenButton(); else if (blockId == 144) block = new Skull(); else if (blockId == 145) block = new Anvil(); else if (blockId == 146) block = new TrappedChest(); else if (blockId == 147) block = new LightWeightedPressurePlate(); else if (blockId == 148) block = new HeavyWeightedPressurePlate(); else if (blockId == 151) block = new DaylightDetector(); else if (blockId == 152) block = new RedstoneBlock(); else if (blockId == 153) block = new QuartzOre(); else if (blockId == 155) block = new QuartzBlock(); else if (blockId == 156) block = new QuartzStairs(); else if (blockId == 157) block = new DoubleWoodSlab(); else if (blockId == 158) block = new WoodSlab(); else if (blockId == 159) block = new StainedHardenedClay(); else if (blockId == 161) block = new AcaciaLeaves(); else if (blockId == 162) block = new AcaciaLog(); else if (blockId == 163) block = new AcaciaStairs(); else if (blockId == 164) block = new DarkOakStairs(); else if (blockId == 167) block = new IronTrapdoor(); else if (blockId == 170) block = new HayBlock(); else if (blockId == 171) block = new Carpet(); else if (blockId == 172) block = new HardenedClay(); else if (blockId == 173) block = new CoalBlock(); else if (blockId == 174) block = new PackedIce(); else if (blockId == 175) block = new Sunflower(); else if (blockId == 178) block = new DaylightDetectorInverted(); else if (blockId == 183) block = new SpruceFenceGate(); else if (blockId == 184) block = new BirchFenceGate(); else if (blockId == 185) block = new JungleFenceGate(); else if (blockId == 186) block = new DarkOakFenceGate(); else if (blockId == 187) block = new AcaciaFenceGate(); else if (blockId == 198) block = new GrassPath(); else if (blockId == 199) block = new ItemFrame(); else if (blockId == 243) block = new Podzol(); else if (blockId == 244) block = new Beetroot(); else if (blockId == 245) block = new Stonecutter(); else if (blockId == 246) block = new GlowingObsidian(); else if (blockId == 247) block = new NetherReactorCore(); else { // Log.DebugFormat(@" // // Add this missing block to the BlockFactory // else if (blockId == {1}) block = new {0}(); // // public class {0} : Block // {{ // internal {0}() : base({1}) // {{ // }} // }} //", "Missing", blockId); block = new Block(blockId); } return block; }
public TimeSpan GetDurationById(int Id) { DBDataHelper.ConnectionString = ConfigurationManager.ConnectionStrings["CSBiometricAttendance"].ConnectionString; DataTable dt = new DataTable(); DataSet ds; List<SqlParameter> lstDurations = new List<SqlParameter>(); lstDurations.Add(new SqlParameter("@id", Id)); int i = 0; TimeSpan duration = TimeSpan.Parse("00:00"); using (DBDataHelper objDDBDataHelper = new DBDataHelper()) { ds = objDDBDataHelper.GetDataSet("spGetDurationById", SQLTextType.Stored_Proc, lstDurations); List<Duration> lstDuration = new List<Duration>(); Leaves objLeaves = new Leaves(); foreach (DataRow rows in ds.Tables[0].Rows) { duration = (TimeSpan)(ds.Tables[0].Rows[i][2]); } } return duration; }
/// <summary> /// Get all Durations /// </summary> /// <returns>List of Duration objects</returns> public List<Duration> GetAllDurations() { DBDataHelper.ConnectionString = ConfigurationManager.ConnectionStrings["CSBiometricAttendance"].ConnectionString; DataTable dt = new DataTable(); DataSet ds; int i = 0; using (DBDataHelper objDDBDataHelper = new DBDataHelper()) { ds = objDDBDataHelper.GetDataSet("spGetAllDurations", SQLTextType.Stored_Proc); List<Duration> lstDuration = new List<Duration>(); Leaves objLeaves = new Leaves(); foreach (DataRow rows in ds.Tables[0].Rows) { Duration objDuration = new Duration(); objDuration.Id = Convert.ToInt32(ds.Tables[0].Rows[i][0]); objDuration.leaveId = Convert.ToInt32(ds.Tables[0].Rows[i][1]); GetLeavesById(objDuration.leaveId, out objLeaves); objDuration.leaveName = objLeaves.LeaveName; objDuration.duration = (TimeSpan)(ds.Tables[0].Rows[i][2]); lstDuration.Add(objDuration); i++; } return lstDuration; } }
public bool GetLeavesAssignedByRoleById(int id, out LeaveAssignedByRole objLeaves) { DBDataHelper.ConnectionString = ConfigurationManager.ConnectionStrings["CSBiometricAttendance"].ConnectionString; List<SqlParameter> lstparameter = new List<SqlParameter>(); lstparameter.Add(new SqlParameter("@id", id)); DataTable dt = new DataTable(); DataSet ds; int i = 0; string query = "Select * from tblLeaveAssignedByRole where Id = @id"; LeaveAssignedByRole objLeaves1 = new LeaveAssignedByRole(); using (DBDataHelper objDDBDataHelper = new DBDataHelper()) { ds = objDDBDataHelper.GetDataSet(query, SQLTextType.Query, lstparameter); List<LeaveAssignedByRole> lstLeaveType = new List<LeaveAssignedByRole>(); Leaves objLeave = new Leaves(); foreach (DataRow rows in ds.Tables[0].Rows) { objLeaves1.Id = Convert.ToInt32(ds.Tables[0].Rows[i][0]); objLeaves1.RoleId = Convert.ToInt32(ds.Tables[0].Rows[i][1]); objLeaves1.LeaveTypeId = Convert.ToInt32(ds.Tables[0].Rows[i][2]); objLeaves1.NoOfLeaves = Convert.ToInt32(ds.Tables[0].Rows[i][3]); objLeaves1.IsPromoted = Convert.ToBoolean(ds.Tables[0].Rows[i][4]); GetLeavesById(objLeaves1.LeaveTypeId, out objLeave); objLeaves1.LeaveName = objLeave.LeaveName; objLeaves1.RoleName = GetRoleById(objLeaves1.RoleId); lstLeaveType.Add(objLeaves1); i++; } objLeaves = objLeaves1; return true; } }
public bool GetLeavesById(int leaveId, out Leaves objLeaves) { DBDataHelper.ConnectionString = ConfigurationManager.ConnectionStrings["CSBiometricAttendance"].ConnectionString; List<SqlParameter> lstLeave = new List<SqlParameter>(); lstLeave.Add(new SqlParameter("@leaveId", leaveId)); DataTable dt = new DataTable(); DataSet ds; int i = 0; Leaves objLeaves1 = new Leaves(); using (DBDataHelper objDDBDataHelper = new DBDataHelper()) { ds = objDDBDataHelper.GetDataSet("spGetTypeOfLeaveById ", SQLTextType.Stored_Proc, lstLeave); List<Leaves> lstLeaveType = new List<Leaves>(); foreach (DataRow rows in ds.Tables[0].Rows) { objLeaves1.Id = leaveId; objLeaves1.LeaveName = (ds.Tables[0].Rows[i][0]).ToString(); lstLeaveType.Add(objLeaves1); i++; } objLeaves = objLeaves1; return true; } }
/// <summary> /// Returns all type of leaves /// </summary> /// <returns>List of types of leaves(objects)</returns> public List<Leaves> GetAllTypeOfLeaves() { DBDataHelper.ConnectionString = ConfigurationManager.ConnectionStrings["CSBiometricAttendance"].ConnectionString; DataTable dt = new DataTable(); DataSet ds; int i = 0; using (DBDataHelper objDDBDataHelper = new DBDataHelper()) { ds = objDDBDataHelper.GetDataSet("spGetAllTypeOfLeaves ", SQLTextType.Stored_Proc); List<Leaves> lstLeaveType = new List<Leaves>(); foreach (DataRow rows in ds.Tables[0].Rows) { Leaves objLeaves = new Leaves(); objLeaves.Id = Convert.ToInt32(ds.Tables[0].Rows[i][0]); objLeaves.LeaveName = (ds.Tables[0].Rows[i][1]).ToString(); lstLeaveType.Add(objLeaves); i++; } return lstLeaveType; } }