protected void Page_Load(object sender, EventArgs e) { IDesignation DesignationManager; try { if (!IsPostBack) { DesignationManager = (IDesignation)ObjectFactory.CreateInstance("BusinessProcess.Administration.BDesignation, BusinessProcess.Administration"); DataSet theDS = DesignationManager.GetDesignation(); this.grdDesignation.DataSource = theDS.Tables[0]; this.grdDesignation.DataBind(); if (ViewState["grdDataSource"] == null) { ViewState["grdDataSource"] = theDS.Tables[0]; } ViewState["SortDirection"] = "Desc"; BindGrid(); } } catch (Exception err) { MsgBuilder theBuilder = new MsgBuilder(); theBuilder.DataElements["MessageText"] = err.Message.ToString(); IQCareMsgBox.Show("#C1", theBuilder, this); return; } finally { DesignationManager = null; } }
public static bool RemoveAllDesignationsOn(DesignationManager __instance, Thing t, bool standardCanceling = false) { bool matchFound = false; for (int index = 0; index < __instance.allDesignations.Count; ++index) { Designation designation = __instance.allDesignations[index]; if ((!standardCanceling || designation.def.designateCancelable) && designation.target.Thing == t) { designation.Notify_Removing(); matchFound = true; } } if (!matchFound) { return(false); } lock (__instance) { List <Designation> newAllDesignations = new List <Designation>(__instance.allDesignations); newAllDesignations.RemoveAll(d => (!standardCanceling || d.def.designateCancelable) && d.target.Thing == t); __instance.allDesignations = newAllDesignations; } return(false); }
public TeacherController() { designationManager = new DesignationManager(); departmentManager = new DepartmentManager(); teacherManager = new TeacherManager(); courseManager = new CourseManager(); }
public EmployeeController() { designationManager = new DesignationManager(); fileUpload = new FTPFileUpload(); employeeManager = new EmployeeManager(); userAccessManager = new UserAccessManager(); }
public MapComponentSeenFog(Map map) : base(map) { mapCellLength = map.cellIndices.NumGridCells; mapSizeX = map.Size.x; mapSizeZ = map.Size.z; fogGrid = map.fogGrid; thingGrid = map.thingGrid; mapDrawer = map.mapDrawer; designationManager = this.map.designationManager; maxFactionLoadId = 0; foreach (Faction faction in Find.World.factionManager.AllFactionsListForReading) { maxFactionLoadId = Math.Max(maxFactionLoadId, faction.loadID); } factionsShownCells = new int[maxFactionLoadId + 1][]; knownCells = new bool[mapCellLength]; viewBlockerCells = new bool[mapCellLength]; idxToCellCache = new IntVec3[mapCellLength]; compHideFromPlayerGrid = new List <CompHideFromPlayer> [mapCellLength]; compAffectVisionGrid = new List <CompAffectVision> [mapCellLength]; for (int i = 0; i < mapCellLength; i++) { idxToCellCache[i] = CellIndicesUtility.IndexToCell(i, mapSizeX); compHideFromPlayerGrid[i] = new List <CompHideFromPlayer>(16); compAffectVisionGrid[i] = new List <CompAffectVision>(16); } }
public List <TeacherModel> GetAllTeachers() { List <TeacherModel> teachers = new List <TeacherModel>(); SqlConnection connection = new SqlConnection(connectionString); string query = "SELECT * FROM teacher_tbl"; SqlCommand command = new SqlCommand(query, connection); connection.Open(); SqlDataReader reader = command.ExecuteReader(); while (reader.Read()) { DepartmentManager aDepartmentManager = new DepartmentManager(); DesignationManager aDesignationManager = new DesignationManager(); TeacherModel aTeacherModel = new TeacherModel(); aTeacherModel.TeacherId = Convert.ToInt32(reader["teacherId"].ToString()); aTeacherModel.TeacherName = reader["teacherName"].ToString(); aTeacherModel.TeacherAddress = reader["teacherAddress"].ToString(); aTeacherModel.TeacherEmail = reader["teacherEmail"].ToString(); aTeacherModel.TeacherNumber = reader["teacherNumber"].ToString(); aTeacherModel.DesignationId = int.Parse(reader["designationId"].ToString()); aTeacherModel.Designation = aDesignationManager.GetDesignationById(aTeacherModel.DesignationId); aTeacherModel.DepartmentId = int.Parse(reader["departmentId"].ToString()); aTeacherModel.Department = aDepartmentManager.GetDepartmentById(aTeacherModel.DepartmentId); aTeacherModel.TeacherCreditToBeTaken = Convert.ToInt32(reader["teacherCreditToBeTaken"].ToString()); teachers.Add(aTeacherModel); } connection.Close(); return(teachers); }
public EmployeesController() { _employeeManager = new EmployeeManager(); _organizationManager = new OrganizationManager(); _branchManager = new BranchManager(); _departmentManager = new DepartmentManager(); _designationManager = new DesignationManager(); }
public TeacherController() { aDepartmentManager = new DepartmentManager(); aDesignationManager = new DesignationManager(); aTeacherManager = new TeacherManager(); aCourseManager = new CourseManager(); aAssignCourseManager = new AssignCourseManager(); }
public static bool Prefix(DesignationManager __instance) { if (!PRModSettings.renderDesignations && __instance.map.GetComponent <MapComponent_RenderManager>().Rendering) { return(false); } return(true); }
public EmployeeEntry() { _branchManager = new BranchManager(); _employeeUserManager = new EmployeeUserManager(); _roleManager = new RoleManager(); _sectionManager = new SectionManager(); _designationManager = new DesignationManager(); }
private FactionMapData(int factionId, Map map) : this(map) { this.factionId = factionId; designationManager = new DesignationManager(map); areaManager = new AreaManager(map); zoneManager = new ZoneManager(map); }
protected void btnSave_Click(object sender, EventArgs e) { if (FieldValidation() == false) { return; } IDesignation DesignationManager; try { //DisplayMode=0 is for Displaying userlist //DisplayMode=1 is for Displaying userlist int DisplayMode = 0; if (rdouserName.Checked == true) { DisplayMode = 0; } else if (rdouserlist.Checked == true) { DisplayMode = 1; } /// if (Request.QueryString["Upd"] == "0") { DesignationManager = (IDesignation)ObjectFactory.CreateInstance("BusinessProcess.Administration.BDesignation, BusinessProcess.Administration"); int DesignationId = DesignationManager.SaveNewDesignation(txtDesignationName.Text, Convert.ToInt32(Session["AppUserId"]), Convert.ToInt32(txtSeq.Text), DisplayMode, Convert.ToInt32(Session["SystemId"])); string Url = string.Format("{0}?TableName={1}&CategoryId={2}&LstName={3}&Fid={4}&Upd={5}&CCID={6}&ModId={7}", "frmAdmin_CustomList.aspx", ViewState["TableName"].ToString(), ViewState["CategoryId"], ViewState["ListName"].ToString(), ViewState["FID"].ToString(), 1, ViewState["CCID"].ToString(), ViewState["ModuleId"].ToString()); Response.Redirect(Url); //clear_fields(); } else if (Request.QueryString["Upd"] == "1") { DesignationManager = (IDesignation)ObjectFactory.CreateInstance("BusinessProcess.Administration.BDesignation, BusinessProcess.Administration"); if (DesignationName.ToString() != txtDesignationName.Text) { int DesignationId = DesignationManager.UpdateDesignation(Convert.ToInt32(Request.QueryString["SelectedId"]), txtDesignationName.Text, Convert.ToInt32(Session["AppUserId"]), Convert.ToInt32(this.ddStatus.SelectedValue), Convert.ToInt32(txtSeq.Text), 1, DisplayMode, Convert.ToInt32(Session["SystemId"])); IQCareMsgBox.Show("DesignationUpdate", this); } else { int DesignationId = DesignationManager.UpdateDesignation(Convert.ToInt32(Request.QueryString["SelectedId"]), txtDesignationName.Text, Convert.ToInt32(Session["AppUserId"]), Convert.ToInt32(this.ddStatus.SelectedValue), Convert.ToInt32(txtSeq.Text), 0, DisplayMode, Convert.ToInt32(Session["SystemId"])); IQCareMsgBox.Show("DesignationUpdate", this); } string Url = string.Format("{0}?TableName={1}&CategoryId={2}&LstName={3}&Fid={4}&Upd={5}&CCID={6}&ModId={7}", "frmAdmin_CustomList.aspx", ViewState["TableName"].ToString(), ViewState["CategoryId"], ViewState["ListName"].ToString(), ViewState["FID"].ToString(), ViewState["Update"].ToString(), ViewState["CCID"].ToString(), ViewState["ModuleId"].ToString()); Response.Redirect(Url); } } catch (Exception err) { MsgBuilder theBuilder = new MsgBuilder(); theBuilder.DataElements["MessageText"] = err.Message.ToString(); IQCareMsgBox.Show("#C1", theBuilder, this); return; } finally { DesignationManager = null; } }
public ActionResult SaveTeacher() { DesignationManager aDesignationManager = new DesignationManager(); DepartmentManager aDepartmentManager = new DepartmentManager(); ViewBag.designations = aDesignationManager.GetAllDesignations(); ViewBag.departments = aDepartmentManager.GetAllDepartmentInfo(); return(View()); }
protected void Page_Load(object sender, EventArgs e) { // (Master.FindControl("lblheader") as Label).Text = "Customise List"; (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblRoot") as Label).Visible = false; (Master.FindControl("levelOneNavigationUserControl1").FindControl("lblheader") as Label).Text = "Customise List"; lblH2.Text = Request.QueryString["name"]; if (lblH2.Text == "Add") { ddStatus.Visible = false; lblStatus.Visible = false; lblH2.Text = "Add Designation"; } else if (lblH2.Text == "Edit") { lblH2.Text = "Edit Designation"; } IDesignation DesignationManager; if (!IsPostBack) { try { if (Request.QueryString["name"] == "Edit") { DesignationId = Convert.ToInt32(Request.QueryString["DesignationId"]); DesignationManager = (IDesignation)ObjectFactory.CreateInstance("BusinessProcess.Administration.BDesignation, BusinessProcess.Administration"); DataSet theDS = DesignationManager.GetDesignationByID(DesignationId); this.txtDesignationName.Text = theDS.Tables[0].Rows[0]["Designation_Name"].ToString(); if (theDS.Tables[0].Rows[0]["Status"].ToString() == "Active") { this.ddStatus.SelectedValue = "0"; } else { this.ddStatus.SelectedValue = "1"; } this.txtSeq.Text = theDS.Tables[0].Rows[0]["Sequence"].ToString(); } } catch (Exception err) { MsgBuilder theBuilder = new MsgBuilder(); theBuilder.DataElements["MessageText"] = err.Message.ToString(); IQCareMsgBox.Show("#C1", theBuilder, this); return; } finally { DesignationManager = null; } } }
public static void RemoveAllDesignationsOn(DesignationManager __instance, Thing t) { if (__instance.map.designationManager.DesignationOn(t, AllowToolDefOf.HaulUrgentlyDesignation) == null) { return; } __instance.map.GetComponent <MapComp_AllowTool>().designatedThings.Remove(t); }
public static void RemoveDesignation(DesignationManager __instance, Designation des) { if (des.def != AllowToolDefOf.HaulUrgentlyDesignation) { return; } __instance.map.GetComponent <MapComp_AllowTool>().designatedThings.Remove(des.target.Thing); }
public UserController() { userManager = new UserManager(); designationManager = new DesignationManager(); projectManager = new ProjectManager(); assignProjectManager = new AssignProjectManager(); uploadFile = new UploadFile(); userAccess = new UserAccessManager(); }
protected void btnSave_Click(object sender, EventArgs e) { if (FieldValidation() == false) { return; } IDesignation DesignationManager; try { //DisplayMode=0 is for Displaying userlist //DisplayMode=1 is for Displaying userlist int DisplayMode = 0; if (rdouserName.Checked == true) { DisplayMode = 0; } else if (rdouserlist.Checked == true) { DisplayMode = 1; } /// if (Request.QueryString["Upd"] == "0") { DesignationManager = (IDesignation)ObjectFactory.CreateInstance("BusinessProcess.Administration.BDesignation, BusinessProcess.Administration"); int DesignationId = DesignationManager.SaveNewDesignation(txtDesignationName.Text, 1, Convert.ToInt32(txtSeq.Text), DisplayMode); clear_fields(); } else if (Request.QueryString["Upd"] == "1") { DesignationManager = (IDesignation)ObjectFactory.CreateInstance("BusinessProcess.Administration.BDesignation, BusinessProcess.Administration"); if (DesignationName != txtDesignationName.Text) { int DesignationId = DesignationManager.UpdateDesignation(Convert.ToInt32(Request.QueryString["SelectedId"]), txtDesignationName.Text, 1, Convert.ToInt32(this.ddStatus.SelectedValue), Convert.ToInt32(txtSeq.Text), 1, DisplayMode); IQCareMsgBox.Show("DesignationUpdate", this); } else { int DesignationId = DesignationManager.UpdateDesignation(Convert.ToInt32(Request.QueryString["SelectedId"]), txtDesignationName.Text, 1, Convert.ToInt32(this.ddStatus.SelectedValue), Convert.ToInt32(txtSeq.Text), 0, DisplayMode); IQCareMsgBox.Show("DesignationUpdate", this); } } } catch (Exception err) { MsgBuilder theBuilder = new MsgBuilder(); theBuilder.DataElements["MessageText"] = err.Message.ToString(); IQCareMsgBox.Show("#C1", theBuilder, this); return; } finally { DesignationManager = null; } }
private GameWorld() { _designationManager = new DesignationManager(this); _buildingManager = new BuildingManager(this); _itemManager = new ItemManager(this); _actorManager = new ActorManager(this); _environment = new Environment.Environment(_worldSize, this); _spatialTreeIndex = new SpatialTreeIndex(WorldSize, new [] { 3, 3, 3, 3 }, new [] { 3, 3, 3, 3 }); TimedEventManager = new TimedEventManager(this); _factoryManager = new FactoryManager(this); }
private void saveDesignationButton_Click(object sender, System.EventArgs e) { Designation aDesignation = new Designation(); aDesignation.Code = codeTextBox.Text; aDesignation.Title = titleTextBox.Text; DesignationManager aDesignationManager = new DesignationManager(); string msg = aDesignationManager.Save(aDesignation); MessageBox.Show(msg); }
protected void saveButton_Click(object sender, EventArgs e) { if (!IsValid) { return; } try { aTeacherManager = new TeacherManager(); Teacher aTeacher = new Teacher(); aTeacher.Name = nameTextBox.Value; aTeacher.Address = addressTextBox.Value; aTeacher.Email = emailTextBox.Value; aTeacher.ContactNo = contactNoTextBox.Value; aTeacher.AssignCredit = Convert.ToDouble(assignCreditTextBox.Value); DesignationManager aDesignationManager = new DesignationManager(); aTeacher.ADesignation = aDesignationManager.GetDesignation(Convert.ToInt16(designationDropDownList.Text)); DepartmentManager aDepartmentManager = new DepartmentManager(); aTeacher.ADepartment = aDepartmentManager.GetDepartment(Convert.ToInt16(departmentDropDownList.Text)); string teacherId = aTeacherManager.GetTeacherId(Convert.ToInt16(departmentDropDownList.Text)); aTeacher.TeacherId = aTeacher.ADepartment.DepartmentCode.ToString() + "-" + teacherId + contactNoTextBox.Value; string msg = aTeacherManager.SaveTeacher(aTeacher); if (msg == aTeacher.TeacherId) { msgLabel.ForeColor = Color.Green; msgLabel.Text = aTeacher.Name + " your Id is :" + msg; ClearAllTextBoxes(); } else { msgLabel.ForeColor = Color.Red; msgLabel.Text = msg; } } catch (SqlException sqlException) { msgLabel.ForeColor = Color.Red; msgLabel.Text = "Database error.See details error: " + sqlException.Message; } catch (Exception exception) { msgLabel.ForeColor = Color.Red; string errorMessage = "Unknow error occured."; errorMessage += exception.Message; if (exception.InnerException != null) { errorMessage += exception.InnerException.Message; } msgLabel.Text = errorMessage; } }
public ActionResult SaveTeacher(Teacher aTeacher) { DesignationManager aDesignationManager = new DesignationManager(); DepartmentManager aDepartmentManager = new DepartmentManager(); TeacherManager aTeacherManager = new TeacherManager(); ViewBag.designations = aDesignationManager.GetAllDesignations(); ViewBag.departments = aDepartmentManager.GetAllDepartmentInfo(); if (aTeacher.Name == null || aTeacher.Address == null || aTeacher.Email == null || aTeacher.ContactNo == null || aTeacher.DesignationId == 0 || aTeacher.DepartmentId == 0 || aTeacher.CreditTobeTaken == 0.0) { ViewBag.message = "Input Values"; } else { List <Teacher> aList = aTeacherManager.GetAllTeachers(); var teacheremail = aList.FirstOrDefault(e => e.Email == aTeacher.Email); if (aTeacher.CreditTobeTaken < 0 || teacheremail != null) { if (aTeacher.CreditTobeTaken < 0 && teacheremail != null) { ViewBag.message = "Credit must contain a non-negative value And Email Already Exist"; } else if (aTeacher.CreditTobeTaken < 0) { ViewBag.message = "Credit must contain a non-negative value"; } else if (teacheremail != null) { ViewBag.message = "Email Already Exist"; } } else { if (aTeacherManager.SaveTeacher(aTeacher) > 0) { ViewBag.message = "Teacher Saved Successfully"; } else { ViewBag.message = "Save Failed"; } } } return(View()); }
public static void ToggleHaulDesignation(this Thing t) { DesignationManager dm = t.MapHeld.designationManager; Designation des = dm.DesignationOn(t, DesignationDefOf.Haul); if (des != null) { dm.RemoveDesignation(des); } else { dm.AddDesignation(new Designation(t, DesignationDefOf.Haul)); } }
public static IEnumerable <Designation> SpawnedDesignationsOfDefEnumerable(DesignationManager __instance, DesignationDef def) { List <Designation> allDesignationsSnapshot = __instance.allDesignations; int count = allDesignationsSnapshot.Count; for (int i = 0; i < count; ++i) { Designation allDesignation = allDesignationsSnapshot[i]; if (allDesignation.def == def && (!allDesignation.target.HasThing || allDesignation.target.Thing.Map == __instance.map)) { yield return(allDesignation); } } }
public static bool RemoveDesignation(DesignationManager __instance, Designation des) { des.Notify_Removing(); if (!__instance.allDesignations.Contains(des)) { return(false); } lock (__instance) { List <Designation> newAllDesignations = new List <Designation>(__instance.allDesignations); newAllDesignations.Remove(des); __instance.allDesignations = newAllDesignations; } return(false); }
private void addButton_Click(object sender, EventArgs e) { NewDesignation aDesignation = new NewDesignation(); aDesignation.Name = designationTextBox.Text; DesignationManager aDesignationManager = new DesignationManager(); if (aDesignationManager.SaveAll(aDesignation)) { MessageBox.Show("Designation Sucessfully Added"); } else { MessageBox.Show("Error"); } }
public static bool DesignationOn(DesignationManager __instance, ref Designation __result, Thing t, DesignationDef def) { if (def == null) //weird CanBeBuried CanExtractSkull Ideology requirement is null { for (int index = 0; index < __instance.allDesignations.Count; ++index) { Designation allDesignation = __instance.allDesignations[index]; if (allDesignation.target.Thing == t && allDesignation.def == def) { __result = allDesignation; return(false); } } __result = null; return(false); } return(true); }
protected void btnSave_Click(object sender, EventArgs e) { if (FieldValidation() == false) { return; } IDesignation DesignationManager; try { if (Request.QueryString["name"] == "Add") { DesignationManager = (IDesignation)ObjectFactory.CreateInstance("BusinessProcess.Administration.BDesignation, BusinessProcess.Administration"); int DesignationId = DesignationManager.SaveNewDesignation(txtDesignationName.Text, 1, Convert.ToInt32(txtSeq.Text)); if (DesignationId == 0) { IQCareMsgBox.Show("DesignationExists", this); return; } else { IQCareMsgBox.Show("DesignationSave", this); clear_fields(); } } else if (Request.QueryString["name"] == "Edit") { DesignationManager = (IDesignation)ObjectFactory.CreateInstance("BusinessProcess.Administration.BDesignation, BusinessProcess.Administration"); int DesignationId = DesignationManager.UpdateDesignation(Convert.ToInt32(Request.QueryString["designationid"]), txtDesignationName.Text, 1, Convert.ToInt32(this.ddStatus.SelectedValue), Convert.ToInt32(txtSeq.Text)); IQCareMsgBox.Show("DesignationUpdate", this); } } catch (Exception err) { MsgBuilder theBuilder = new MsgBuilder(); theBuilder.DataElements["MessageText"] = err.Message.ToString(); IQCareMsgBox.Show("#C1", theBuilder, this); return; } finally { DesignationManager = null; } }
public static bool RemoveAllDesignationsOfDef(DesignationManager __instance, DesignationDef def) { lock (__instance) { List <Designation> newAllDesignations = new List <Designation>(__instance.allDesignations); for (int index = newAllDesignations.Count - 1; index >= 0; --index) { if (newAllDesignations[index].def != def) { continue; } newAllDesignations[index].Notify_Removing(); newAllDesignations.RemoveAt(index); } __instance.allDesignations = newAllDesignations; } return(false); }
public IEnumerable <SelectListItem> GetAllDesignationList() { List <SelectListItem> designationListItems = new List <SelectListItem>() { new SelectListItem() { Text = "---Select---", Value = "" }, }; List <Designation> designationList = new DesignationManager().GetAllDesignations(); foreach (Designation designations in designationList) { SelectListItem designationListItem = new SelectListItem(); designationListItem.Text = designations.DesignationName; designationListItem.Value = designations.Id.ToString(); designationListItems.Add(designationListItem); } return(designationListItems); }