private void button1_Click(object sender, EventArgs e) { int DesignationId = 0; int.TryParse(txtDesignationID.Text, out DesignationId); var designation_obj = new Designation { Id = DesignationId, Name = txtDesignationName.Text }; var designationDao = new DesignationDao(); designationDao.SaveDesignation(designation_obj); ShowDesignations(); }
public int UpdateDesignation(Designation designationObj) { using (var db = new eTempleDbDB()) { return db.Update(designationObj); } }
public void SaveDesignation(Designation designationObj) { using (var db = new eTempleDbDB()) { db.Save(designationObj); } }
/// <summary> /// Function to save designation details. /// </summary> /// <param name="designation">designation information.</param> public void InsertOrUpdate(Designation designation) { if (designation == null) { throw new ArgumentNullException(DesignationConstant); } if (designation.DesignationID == default(int)) { this.unitOfWork.Context.Entry(designation).State = EntityState.Added; } else { this.unitOfWork.Context.Entry(designation).State = EntityState.Modified; } }
/// <summary> /// Validates a person object. /// </summary> public PersonValidator() { RuleFor(x => x.Id).NotEmpty(); RuleFor(x => x.LastName).NotEmpty().Length(1, 40) .WithMessage("The last name must not be left blank and must not exceed 40 characters."); RuleFor(x => x.FirstName).Length(0, 40) .WithMessage("The first name must not exceed 40 characters."); RuleFor(x => x.MiddleName).Length(0, 40) .WithMessage("The middle name must not exceed 40 characters."); RuleFor(x => x.Suffix).Length(0, 40) .WithMessage("The suffix must not exceed 40 characters."); RuleFor(x => x.SSN).NotEmpty().Must(x => System.Text.RegularExpressions.Regex.IsMatch(x, @"^(?!\b(\d)\1+-(\d)\1+-(\d)\1+\b)(?!123-45-6789|219-09-9999|078-05-1120)(?!666|000|9\d{2})\d{3}(?!00)\d{2}(?!0{4})\d{4}$")) .WithMessage("The SSN must be valid and contain only numbers."); RuleFor(x => x.DateOfBirth).NotEmpty() .WithMessage("The DOB must not be left blank."); RuleFor(x => x.PRD).NotEmpty() .WithMessage("The DOB must not be left blank."); RuleFor(x => x.Sex).NotNull() .WithMessage("The sex must not be left blank."); RuleFor(x => x.Remarks).Length(0, 150) .WithMessage("Remarks must not exceed 150 characters."); RuleFor(x => x.Command).NotEmpty().WithMessage("A person must have a command. If you are trying to indicate this person left the command, please set his or her duty status to 'LOSS'."); RuleFor(x => x.Department).NotEmpty().WithMessage("A person must have a department. If you are trying to indicate this person left the command, please set his or her duty status to 'LOSS'."); RuleFor(x => x.Division).NotEmpty().WithMessage("A person must have a division. If you are trying to indicate this person left the command, please set his or her duty status to 'LOSS'."); RuleFor(x => x.Ethnicity).Must(x => { if (x == null) { return(true); } Ethnicity ethnicity = DataProvider.CurrentSession.Get <Ethnicity>(x.Id); if (ethnicity == null) { return(false); } return(ethnicity.Equals(x)); }) .WithMessage("The ethnicity wasn't valid. It must match exactly a list item in the database."); RuleFor(x => x.ReligiousPreference).Must(x => { if (x == null) { return(true); } ReligiousPreference pref = DataProvider.CurrentSession.Get <ReligiousPreference>(x.Id); if (pref == null) { return(false); } return(pref.Equals(x)); }) .WithMessage("The religious preference wasn't valid. It must match exactly a list item in the database."); RuleFor(x => x.Designation).Must(x => { if (x == null) { return(true); } Designation designation = DataProvider.CurrentSession.Get <Designation>(x.Id); if (designation == null) { return(false); } return(designation.Equals(x)); }) .WithMessage("The designation wasn't valid. It must match exactly a list item in the database."); RuleFor(x => x.Division).Must((person, x) => { if (x == null) { return(true); } Division division = DataProvider.CurrentSession.Get <Division>(x.Id); if (division == null) { return(false); } return(division.Equals(x)); }) .WithMessage("The division wasn't a valid division. It must match exactly."); RuleFor(x => x.Department).Must(x => { if (x == null) { return(true); } Department department = DataProvider.CurrentSession.Get <Department>(x.Id); if (department == null) { return(false); } return(department.Equals(x)); }) .WithMessage("The department was invalid."); RuleFor(x => x.Command).Must(x => { if (x == null) { return(true); } Command command = DataProvider.CurrentSession.Get <Command>(x.Id); if (command == null) { return(false); } return(command.Equals(x)); }) .WithMessage("The command was invalid."); RuleFor(x => x.PrimaryNEC).Must((person, x) => { if (x == null) { return(true); } NEC nec = DataProvider.CurrentSession.Get <NEC>(x.Id); if (nec == null) { return(false); } if (!nec.Equals(x)) { return(false); } //Now let's also make sure this isn't in the secondary NECs. if (person.SecondaryNECs.Any(y => y.Id == x.Id)) { return(false); } return(true); }) .WithMessage("The primary NEC must not exist in the secondary NECs list."); RuleFor(x => x.Supervisor).Length(0, 40) .WithMessage("The supervisor field may not be longer than 40 characters."); RuleFor(x => x.WorkCenter).Length(0, 40) .WithMessage("The work center field may not be longer than 40 characters."); RuleFor(x => x.WorkRoom).Length(0, 40) .WithMessage("The work room field may not be longer than 40 characters."); RuleFor(x => x.Shift).Length(0, 40) .WithMessage("The shift field may not be longer than 40 characters."); RuleFor(x => x.WorkRemarks).Length(0, 150) .WithMessage("The work remarks field may not be longer than 150 characters."); RuleFor(x => x.UIC).Must(x => { if (x == null) { return(true); } UIC uic = DataProvider.CurrentSession.Get <UIC>(x.Id); if (uic == null) { return(false); } return(uic.Equals(x)); }) .WithMessage("The UIC was invalid."); RuleFor(x => x.JobTitle).Length(0, 40) .WithMessage("The job title may not be longer than 40 characters."); RuleFor(x => x.UserPreferences).Must((person, x) => { return(x.Keys.Count <= 20); }) .WithMessage("You may not submit more than 20 preference keys."); RuleForEach(x => x.UserPreferences).Must((person, x) => { return(x.Value.Length <= 1000); }) .WithMessage("No preference value may be more than 1000 characters."); When(x => x.IsClaimed, () => { RuleFor(x => x.EmailAddresses).Must((person, x) => { return(x.Any(y => y.IsDodEmailAddress)); }).WithMessage("You must have at least one mail.mil address."); }); RuleForEach(x => x.SubscribedEvents).Must((person, subEvent) => { if (person.SubscribedEvents.Count(x => x.Key == subEvent.Key) != 1) { return(false); } var changeEvent = ChangeEvents.ChangeEventHelper.AllChangeEvents.FirstOrDefault(x => x.Id == subEvent.Key); if (changeEvent == null) { return(false); } if (!changeEvent.ValidLevels.Contains(subEvent.Value)) { return(false); } return(true); }) .WithMessage("One or more of your subscription events were not valid."); //Set validations RuleFor(x => x.EmailAddresses) .SetCollectionValidator(new EmailAddress.EmailAddressValidator()); RuleFor(x => x.PhoneNumbers) .SetCollectionValidator(new PhoneNumber.PhoneNumberValidator()); RuleFor(x => x.PhysicalAddresses) .SetCollectionValidator(new PhysicalAddress.PhysicalAddressValidator()); }
protected Designation GetObject(DataRow dr) { Designation objDesignation = new Designation(); objDesignation.DesignationId = (dr["DesignationId"] == DBNull.Value) ? 0 : (Int32)dr["DesignationId"]; objDesignation.Designation = (dr["Designation"] == DBNull.Value) ? "" : (String)dr["Designation"]; objDesignation.DepartmentId = (dr["DepartmentId"] == DBNull.Value) ? 0 : (Int32)dr["DepartmentId"]; objDesignation.CompanyId = (dr["CompanyId"] == DBNull.Value) ? 0 : (Int32)dr["CompanyId"]; objDesignation.IsActive = (dr["IsActive"] == DBNull.Value) ? false : (Boolean)dr["IsActive"]; objDesignation.UpdateBy = (dr["UpdateBy"] == DBNull.Value) ? 0 : (Int32)dr["UpdateBy"]; objDesignation.UpdateDate = (dr["UpdateDate"] == DBNull.Value) ? DateTime.MinValue : (DateTime)dr["UpdateDate"]; return objDesignation; }
public ActionResult DesignationAdd(Designation designation, IdentityInfoDto ıdentityInfo) { _designationService.Add(designation); return(RedirectToAction("IdentityUpdateLaterDesignation", "Identity", ıdentityInfo)); }
protected void btnSubmit_Click(object sender, EventArgs e) { A_Handler = new DesignationHandler(); A1 = new Designation(); //A1.Des_id = Convert.ToInt32(txtDes_id.Text); A1.Reg_id = Convert.ToInt32(ddlReg_id.SelectedValue); A1.Des_name = txtDes_name.Text; A1.Des_code = Convert.ToInt32(txtDes_code.Text); A1.IsTeaching = Convert.ToInt32(DropDownList1.Text); if (btnSubmit.Text == "Submit") { bool B = A_Handler.AddNewDesignation(A1); if (B == true) { Label1.Text = "Record Inserted"; MSG = "Record Inserted"; } else { Label1.Text = "Record Not Inserted"; MSG = "Record Not Inserted"; } } else if (btnSubmit.Text == "Update") { A1.Des_id = Convert.ToInt32(txtDes_id.Text); bool B = A_Handler.UpdateDesignation(A1); if (B == true) { Label1.Text = "Record Updated"; MSG = "Record Not Updated"; } else { Label1.Text = "Record Not Updated"; MSG = "Record Not Updated"; } } else if (btnSubmit.Text == "Delete") { A1.Des_id = Convert.ToInt32(txtDes_id.Text); bool B = A_Handler.DeleteDesignation(A1); if (B == true) { Label1.Text = "Record Deleted"; MSG = "Record Deleted"; } else { Label1.Text = "Record Not Deleted"; MSG = "Record Not Deleted"; } } //Response.Redirect("~/ADMIN/Designation_list.aspx?msg="+MSG); }
public IActionResult Delete(int id) { Designation em = _empRepo.DeleteData(id); return(RedirectToAction("AllDetails")); }
public ActionResult AddDesignation(Designation designation) { ViewBag.Message = aPayrollManager.AddDesignation(designation); ViewBag.Designations = aPayrollManager.GetAllDesignation(); return(View()); }
private void AddDesignation( Designation des ) { // add to game Find.DesignationManager.AddDesignation( des ); // add to internal list Designations.Add( des ); }
public IActionResult Edit(Designation designation) { _db.Designation.Update(designation); _db.SaveChanges(); return(RedirectToAction("Index")); }
public IActionResult Create(Designation designation) { _db.Designation.Add(designation); _db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Post(Designation vm) { Designation pt = vm; if (ModelState.IsValid) { if (vm.DesignationId <= 0) { pt.CreatedDate = DateTime.Now; pt.ModifiedDate = DateTime.Now; pt.CreatedBy = User.Identity.Name; pt.ModifiedBy = User.Identity.Name; pt.ObjectState = Model.ObjectState.Added; _DesignationService.Create(pt); try { _unitOfWork.Save(); } catch (Exception ex) { string message = _exception.HandleException(ex); ModelState.AddModelError("", message); return(View("Create", vm)); } LogActivity.LogActivityDetail(LogVm.Map(new ActiivtyLogViewModel { DocTypeId = new DocumentTypeService(_unitOfWork).FindByName(MasterDocTypeConstants.Designation).DocumentTypeId, DocId = pt.DesignationId, ActivityType = (int)ActivityTypeContants.Added, })); return(RedirectToAction("Create").Success("Data saved successfully")); } else { List <LogTypeViewModel> LogList = new List <LogTypeViewModel>(); Designation temp = _DesignationService.Find(pt.DesignationId); Designation ExRec = Mapper.Map <Designation>(temp); temp.DesignationName = pt.DesignationName; temp.IsActive = pt.IsActive; temp.ModifiedDate = DateTime.Now; temp.ModifiedBy = User.Identity.Name; temp.ObjectState = Model.ObjectState.Modified; _DesignationService.Update(temp); LogList.Add(new LogTypeViewModel { ExObj = ExRec, Obj = temp, }); XElement Modifications = new ModificationsCheckService().CheckChanges(LogList); try { _unitOfWork.Save(); } catch (Exception ex) { string message = _exception.HandleException(ex); ModelState.AddModelError("", message); return(View("Create", pt)); } LogActivity.LogActivityDetail(LogVm.Map(new ActiivtyLogViewModel { DocTypeId = new DocumentTypeService(_unitOfWork).FindByName(MasterDocTypeConstants.Designation).DocumentTypeId, DocId = temp.DesignationId, ActivityType = (int)ActivityTypeContants.Modified, xEModifications = Modifications, })); return(RedirectToAction("Index").Success("Data saved successfully")); } } return(View("Create", vm)); }
private void staffAddBtn_Click(object sender, EventArgs e) { /* * string firstName = fNameTxtBox.Text; * string lastName = lNameTxtBox.Text; * string Nic = addNICtxtBox.Text; * string pAddress = pAddTxtBox.Text; * string sAddress = sAddTxtBox.Text; * string[] telNumber = new string[2]; * telNumber[0] = telMobileTxtBox.Text; * telNumber[1] = telLanTxtBox.Text; * string email = emailTxtBox.Text; * string facebook = fNameTxtBox.Text; * string linkedIn = linkedTxtBox.Text; * float basicSal = float.Parse(basicSalTxtBox.Text.ToString()); * float otRate = float.Parse(otRateTxtBox.Text.ToString()); * * Designation desg = new Designation(desgCmbBox.SelectedItem.ToString()); * * MySqlDataReader reader = DBConnection.getData("Select desig_id from Designation where designation='" + desg.DesignationName + "'"); * * if (reader.Read()) * desg.DesigId = reader.GetInt32("desig_id"); * * Staff stf = new Staff(firstName, lastName, Nic, pAddress, sAddress, telNumber, email, facebook, linkedIn, basicSal, otRate); * * reader.Close(); * * Database.addStaff(stf); */ string firstName = fNameTxtBox.Text; string lastName = lNameTxtBox.Text; string Nic = addNICtxtBox.Text; string pAddress = pAddTxtBox.Text; string sAddress = sAddTxtBox.Text; string[] telNumber = new string[2]; telNumber[0] = telMobileTxtBox.Text; telNumber[1] = telLanTxtBox.Text; string email = emailTxtBox.Text; string facebook = fNameTxtBox.Text; string linkedIn = linkedTxtBox.Text; float basicSal = float.Parse(basicSalTxtBox.Text.ToString()); float otRate = float.Parse(otRateTxtBox.Text.ToString()); Designation desg = new Designation(desgCmbBox.SelectedItem.ToString()); Staff stf = new Staff(firstName, lastName, Nic, pAddress, sAddress, telNumber, email, facebook, linkedIn, basicSal, otRate); int stfid = 0; try { MySqlDataReader reader = DBConnection.getData("Select desig_id from Designation where designation_name='" + desg.DesignationName + "'"); while (reader.Read()) { desg.DesigId = reader.GetInt32("desig_id"); } reader.Close(); stf.Designation = desg; Database.addStaff(stf); MessageBox.Show("New member added successfully.", "New member Adding", MessageBoxButtons.OK); reader = DBConnection.getData("Select staff_id from staff where nic='" + Nic + "'"); while (reader.Read()) { stfid = int.Parse(reader["staff_id"].ToString()); } reader.Close(); UserOperation operation = new UserOperation(new Role.UserLog(Logglobals.id), "Added a new Staff member", stfid); try{ Database.addOp(operation); } catch (Exception) { } clear(); } catch (Exception ex) { MessageBox.Show("Every detail must be added!\n" + ex, "New member Adding", MessageBoxButtons.OK); } // metroGrid1.DataSource = getUserList(); //MemberListForm mem = new MemberListForm(); //mem.Show(); //closeForm(); }
public void UpdateDesignation(Designation entity, Designation model) { //entity.UserId = model.UserId; entity.Title = model.Title; entity.IsActive = model.IsActive; }
private void detach_Designations(Designation entity) { this.SendPropertyChanging(); entity.Staff = null; }
/// <summary> /// Function to delete designation information. /// </summary> /// <param name="id">designation id</param> /// <param name="userId">The user identifier.</param> public void Delete(int id, int userId) { var designation = new Designation { DesignationID = id, ModifiedByDeveloperID = userId }; this.unitOfWork.Context.Entry(designation).State = EntityState.Deleted; }
public Designation Add(Designation designation) { _context.designations.Add(designation); _context.SaveChanges(); return(designation); }
private List<Designation> DataTableToDesignation(DataTable dt) { List<Designation> Detail = new List<Designation>(); foreach (DataRow item in dt.Rows) { Designation empResult = new Designation(); empResult.user_exp_id = Convert.ToInt32(item["user_exp_id"].ToString()); empResult.user_job_title = item["user_job_title"].ToString(); Detail.Add(empResult); } return Detail; }
public Task <CommonResponce> Update(Designation DesignationToInsert) { throw new NotImplementedException(); }
partial void DeleteDesignation(Designation instance);
public async Task <IActionResult> AddDesignationAsync([FromBody] Designation newDesignation) { ApplicationUser currentUser = await _userManager.FindByEmailAsync(User.Identity.Name); return(Ok(await _designationManagementRepository.AddDesignationAsync(newDesignation, currentUser))); }
public ViewResult Details(int id) { Designation em = _empRepo.GetDesignation(id); return(View(em)); }
public async Task <IActionResult> UpdateDesignationAsync(int id, [FromBody] Designation updatedDesignation) { ApplicationUser currentUser = await _userManager.FindByEmailAsync(User.Identity.Name); return(Ok(await _designationManagementRepository.UpdateDesignationAsync(id, updatedDesignation, currentUser))); }
public int DesignationInsertUpdate(Designation objDep) { return(DesignationDAL.Instance.DesignationInsertUpdate(objDep)); }
internal int SaveDesignation(Designation objDesignation) { return(desigDal.SaveDesignation(objDesignation)); }
public ActionResult DesignationUpdate(Designation designation) { _designationService.Update(designation); return(RedirectToAction("")); }
internal int DeleteDesignation(Designation objDesignation) { return(desigDal.DeleteDesignation(objDesignation)); }
public void AddInitializer(Expression value, Designation designator = null) { Object.CheckObject(value); this.init_list.Add(new Pair<Designation, Expression>(designator, value)); }
public bool CheckIsExist(Designation designation) { return(designationRepository.Get(chk => chk.Name == designation.Name) == null ? false : true); }
public override bool TryDoJob() { // keep track of work done bool workDone = false; // clean up designations that were completed. CleanDeadDesignations(); // clean up designations that are (now) in the wrong area. CleanAreaDesignations(); // add designations in the game that could have been handled by this job AddRelevantGameDesignations(); // designate plants until trigger is met. int count = Trigger.CurCount + CurrentDesignatedCount; if ( count < Trigger.Count ) { var targets = GetValidForagingTargetsSorted(); for ( int i = 0; i < targets.Count && count < Trigger.Count; i++ ) { Designation des = new Designation( targets[i], DesignationDefOf.HarvestPlant ); count += targets[i].YieldNow(); AddDesignation( des ); workDone = true; } } return workDone; }
public ActionResult Edit(int id) { Designation aDesignation = _iDesignationManager.GetById(id); return(View(aDesignation)); }
private void ShowDesignation(Designation designationobj) { txtDesignationID.Text = designationobj.Id.ToString(); txtDesignationName.Text = designationobj.Name; }
private void BuildModelForDesignation(DbDataReader objDataReader, Designation objDesignation) { DataTable objDataTable = objDataReader.GetSchemaTable(); foreach (DataRow dr in objDataTable.Rows) { String column = dr.ItemArray[0].ToString(); switch (column) { case "DesignationId": if (!Convert.IsDBNull(objDataReader["DesignationId"])) { objDesignation.DesignationId = Convert.ToByte(objDataReader["DesignationId"]); } break; case "DesignationName": if (!Convert.IsDBNull(objDataReader["DesignationName"])) { objDesignation.DesignationName = objDataReader["DesignationName"].ToString(); } break; case "IsActive": if (!Convert.IsDBNull(objDataReader["IsActive"])) { objDesignation.IsActive = Convert.ToBoolean(objDataReader["IsActive"].ToString()); } break; case "CreatedBy": if (!Convert.IsDBNull(objDataReader["CreatedBy"])) { objDesignation.CreatedBy = Convert.ToInt16(objDataReader["CreatedBy"]); } break; case "CreatedDate": if (!Convert.IsDBNull(objDataReader["CreatedDate"])) { objDesignation.CreatedDate = Convert.ToDateTime(objDataReader["CreatedDate"].ToString()); } break; case "UpdatedBy": if (!Convert.IsDBNull(objDataReader["UpdatedBy"])) { objDesignation.UpdatedBy = Convert.ToInt16(objDataReader["UpdatedBy"].ToString()); } break; case "UpdatedDate": if (!Convert.IsDBNull(objDataReader["UpdatedDate"])) { objDesignation.UpdatedDate = Convert.ToDateTime(objDataReader["UpdatedDate"].ToString()); } break; case "SortedBy": if (!Convert.IsDBNull(objDataReader["SortedBy"])) { objDesignation.SortedBy = Convert.ToByte(objDataReader["SortedBy"].ToString()); } break; case "Remarks": if (!Convert.IsDBNull(objDataReader["Remarks"])) { objDesignation.Remarks = objDataReader["Remarks"].ToString(); } break; default: break; } } }
public bool Add(Designation aDesignation) { int rowAffected = _iDesignationGateway.Add(aDesignation); return(rowAffected > 0); }
public bool Update(Designation aDesignation) { int rowAffected = _iDesignationGateway.Update(aDesignation); return(rowAffected > 0); }
/// <summary> /// Function to validate designation delete information. /// </summary> /// <param name="designation">Designation information</param> /// <returns> /// List of errors /// </returns> public ErrorListItem ValidateDelete(Designation designation) { if (designation == null) { throw new ArgumentNullException(DesignationConstant); } return this.unitOfWork.Context.ValidateDeleteDesignationInformation(designation.DesignationID > 0 ? designation.DesignationID : default(int?)).FirstOrDefault(); }
public bool Delete(Designation model) { throw new System.NotImplementedException(); }
private void AddDesignation( Pawn p ) { // create designation Designation des = new Designation( p, DesignationDefOf.Hunt ); // pass to adder AddDesignation( des ); }
protected void BtnSave_Click(object sender, EventArgs e) { if (System.Web.HttpContext.Current.User.Identity.IsAuthenticated == true) { if (JobPost_Save.GetJobPost_SaveRecords("JobPostId=" + Request.QueryString["Id"] + " and JobSeekerId=" + this.Page.User.Identity.Name).Rows.Count > 0) { LblMessage.Text = "You have already saved this Job"; LblMessage.CssClass = "text-danger"; return; } else { JobPost_Save.AddJobPost_Save(int.Parse(this.Page.User.Identity.Name), int.Parse(Request.QueryString["Id"])); LblMessage.Text = "Saved Successfully"; LblMessage.CssClass = "text-success"; Person ObjPerson = new Person(int.Parse(this.Page.User.Identity.Name)); JobPost ObjJobPost = new JobPost(int.Parse(Request.QueryString["Id"])); if (ObjPerson.EnableEmail == true) { MailMessage ObjMailMessage = new MailMessage(); ObjMailMessage.Subject = "You have successfully saved a Job From Online Job Portal"; ObjMailMessage.Body = "Job Title:" + ObjJobPost.JobTitle + "\nCompany: " + CompanyDetails.GetCompanyDetailsRecords("Id=" + ObjJobPost.CompanyId).Rows[0]["CompanyName"] + "\nDesignation:" + Designation.GetDesignationRecords("Id=" + ObjJobPost.DesignationId).Rows[0]["DesignationName"] + "\nDepartment :" + Department.GetDepartmentRecords("Id=" + ObjJobPost.DepartmentId).Rows[0]["DepartmentName"]; ObjMailMessage.From = new MailAddress("*****@*****.**"); ObjMailMessage.To.Add(new MailAddress("*****@*****.**")); ObjMailMessage.To.Add(new MailAddress(ObjPerson.EmailId)); //ObjMailMessage.To.Add(new MailAddress("*****@*****.**")); SmtpClient ObjSmtpClient = new SmtpClient(); ObjSmtpClient.Host = "smtp.gmail.com"; ObjSmtpClient.Port = 587; ObjSmtpClient.EnableSsl = true; ObjSmtpClient.Credentials = new NetworkCredential("*****@*****.**", "Gigabyte786#"); try { ObjSmtpClient.Send(ObjMailMessage); } catch (Exception Ex) { } } } } else { LblMessage.Text = "Please Login To Save"; LblMessage.CssClass = "text-danger"; } }
public void AddDesignation( Pawn p, DesignationDef def ) { // create and add designation to the game and our managed list. Designation des = new Designation( p, def ); Designations.Add( des ); Find.DesignationManager.AddDesignation( des ); }
public bool MoveNext() { uint num = (uint)this.$PC; this.$PC = -1; switch (num) { case 0u: this.FailOnDespawnedOrNull(TargetIndex.A); this.FailOnThingMissingDesignation(TargetIndex.A, DesignationDefOf.RearmTrap); gotoThing = new Toil(); gotoThing.initAction = delegate() { this.pawn.pather.StartPath(base.TargetThingA, PathEndMode.Touch); }; gotoThing.defaultCompleteMode = ToilCompleteMode.PatherArrival; gotoThing.FailOnDespawnedNullOrForbidden(TargetIndex.A); this.$current = gotoThing; if (!this.$disposing) { this.$PC = 1; } return(true); case 1u: this.$current = Toils_General.Wait(800, TargetIndex.None).WithProgressBarToilDelay(TargetIndex.A, false, -0.5f); if (!this.$disposing) { this.$PC = 2; } return(true); case 2u: { Toil finalize = new Toil(); finalize.initAction = delegate() { Thing thing = this.job.targetA.Thing; Designation designation = base.Map.designationManager.DesignationOn(thing, DesignationDefOf.RearmTrap); if (designation != null) { designation.Delete(); } Building_TrapRearmable building_TrapRearmable = thing as Building_TrapRearmable; building_TrapRearmable.Rearm(); this.pawn.records.Increment(RecordDefOf.TrapsRearmed); }; finalize.defaultCompleteMode = ToilCompleteMode.Instant; this.$current = finalize; if (!this.$disposing) { this.$PC = 3; } return(true); } case 3u: this.$PC = -1; break; } return(false); }
private void AddDesignation( Plant p, DesignationDef def = null ) { // create designation Designation des = new Designation( p, def ); // pass to adder AddDesignation( des ); }
partial void UpdateDesignation(Designation instance);