public IActionResult PictureUpload(PictureDto body) { using EFCoreContextWrite context = new EFCore.EFCoreContextWrite(); if (!string.IsNullOrEmpty(body.PictureTitle) && !string.IsNullOrEmpty(body.PictureExplain)) { string token = _httpContext.HttpContext.Request.Headers["Authorization"]; AuthRedis.GetUserByToken(token, out UserInfo userInfo); PictureInfo PictureInfos = new PictureInfo() { Id = SequenceID.GetSequenceID(), CreateTime = DateTime.Now, Disable = false, PictureContent = body.url, UserID = userInfo.id, LastModifiedTime = DateTime.Now, PictureExplain = body.PictureExplain, PictureTitle = body.PictureTitle, RecommendIndex = body.Index, PictureType = body.PictureType, PhotoType = body.PhotoType }; context.Add(PictureInfos); context.SaveChanges(); PictureRedis.Del(); } return(Ok(new ApiResponse())); }
public override void OnActionExecuted(ActionExecutedContext context) { RequestLogs logs = new RequestLogs() { Id = SequenceID.GetSequenceID(), ApiName = context.HttpContext.Request.GetEncodedUrl(), IP = context.HttpContext.Connection.RemoteIpAddress.ToString(), Headers = JsonConvert.SerializeObject(context.HttpContext.Request.Headers), QueryString = context.HttpContext.Request.QueryString.Value, StatusCode = context.HttpContext.Response.StatusCode, Result = JsonConvert.SerializeObject(context.Result) }; string token = context.HttpContext.Request.Headers["Authorization"]; if (!string.IsNullOrEmpty(token)) { if (AuthRedis.GetUserByToken(token, out UserInfo userInfo)) { logs.UID = userInfo.id; } } DBRequestLogs _logs = new DBRequestLogs(); _logs.Create(logs); }
private void handleSequencerClicked(SequenceID inSequencerID) { StartSequencerEvent newEvent = new StartSequencerEvent(inSequencerID); if (_uiDelegate != null) { log.Debug("Adding the startTestSequence event to the processing queue"); _uiDelegate.enqueueEvent(newEvent); } }
public Test Add(CreateUpdateTestDto body) { Test test = new Test() { Id = SequenceID.GetSequenceID(), Name = body.TestName }; _EFBaseService.Add(test); TestRedis.Del(); return(test); }
public IActionResult TestEFCoreAndRedisAdd([FromBody] CreateUpdateTestDto body) { Test test = new Test() { Id = SequenceID.GetSequenceID(), Name = body.TestName }; var tests = _baseService.Add(test); if (tests <= 0) { return(Ok(new ApiResponse(code: CodeAndMessage.新增失败))); } return(Ok(new ApiResponse(test))); }
public override int GetHashCode() { int hash = 1; if (Version != 0) { hash ^= Version.GetHashCode(); } if (SequenceID != 0) { hash ^= SequenceID.GetHashCode(); } if (Oneway != false) { hash ^= Oneway.GetHashCode(); } hash ^= metadata_.GetHashCode(); hash ^= rawAny_.GetHashCode(); if (ReservedInt1 != 0) { hash ^= ReservedInt1.GetHashCode(); } if (ReservedInt2 != 0) { hash ^= ReservedInt2.GetHashCode(); } if (ReservedStr1.Length != 0) { hash ^= ReservedStr1.GetHashCode(); } if (ReservedStr2.Length != 0) { hash ^= ReservedStr2.GetHashCode(); } if (ReservedBytes1.Length != 0) { hash ^= ReservedBytes1.GetHashCode(); } if (ReservedBytes2.Length != 0) { hash ^= ReservedBytes2.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
private void btnLoadFile_Click(object sender, EventArgs e) { FileHandler txtload = new FileHandler(); SequenceID.setProd_id(1); // Initialize the Sequence Id product_list.ReturnList().Clear(); product_list = txtload.readFile(); // Clean the List Box listBoxProducts.Items.Clear(); foreach (Product emp in product_list.ReturnList()) { listBoxProducts.Items.Add(product_list.ShowListInBox(emp)); } }
private void btnLoadFile_Click(object sender, EventArgs e) { FileHandler txtload = new FileHandler(); SequenceID.setEmployee_id(1); // Initialize the Sequence Id employees.ReturnList().Clear(); employees = txtload.readFile(); // Clean the List Box listBoxEmployees.Items.Clear(); foreach (Employee emp in employees.ReturnList()) { listBoxEmployees.Items.Add(employees.ShowListInBox(emp)); } }
/// <summary> /// moreAdd /// </summary> /// <param name="body"></param> /// <returns></returns> public bool moreAdd(int i) { Test test = new Test(); for (int j = 0; j <= i; j++) { test = new Test() { Id = SequenceID.GetSequenceID(), Name = "hangfire" }; _EFBaseService.Add(test); } TestRedis.Del(); return(true); }
public IActionResult Register(RegisterDto body) { var userList = _BaseService.GetListWriteBy <Users>(x => x.Email == body.Email); int count = userList.Where(x => x.CreateTime.AddHours(2) > DateTime.Now).Count(); if (count > 0) { return(Ok(new ApiNResponse(code: CodeAndMessage.重复邮箱在俩小时内注册, message: "Repeat email to register within two hours"))); } int userinfo = userList.Where(x => x.Email == body.Email && x.CreateTime.AddHours(2) < DateTime.Now).Count(); if (userinfo > 0) { var userlist = userList.Single(x => x.Email == body.Email); userlist.CreateTime = DateTime.Now; userlist.Count = userlist.Count + 1; _BaseService.ModifyNo(userlist); _SendService.SendEmail(body.Email, body.Email, "123456"); } else { Users users = new Users() { Id = SequenceID.GetSequenceID(), AuthRole = AuthRole.User, CreateTime = DateTime.Now, Disable = false, Email = body.Email, LastModifiedTime = DateTime.Now, LoginType = LoginType.LimitWeb, UserName = body.Email.ToString(), ComPany = body.ComPany, NickName = body.NickName, Count = 1, PassWord = HashPass.HashString("123456", "MD5") }; _BaseService.Add(users); _SendService.SendEmail(body.Email, users.UserName, "123456"); } return(Ok(new ApiResponse())); }
[AuthFilter]//身份认证,不带token或者token错误会被拦截器拦截进不来这个接口 public IActionResult WordsUpLoad(WordDto body) { string token = _httpContext.HttpContext.Request.Headers["Authorization"]; AuthRedis.GetUserByToken(token, out UserInfo userInfo); using EFCoreContextWrite context = new EFCore.EFCoreContextWrite(); if (body.Eid == null) { int count = context.WordInfo.Where(x => x.PictureID == body.id).Count(); if (count > 0) { return(Ok(new ApiResponse(code: CodeAndMessage.已存在对应的资讯文档))); } WordInfo WordInfos = new WordInfo() { Id = SequenceID.GetSequenceID(), CreateTime = DateTime.Now, Disable = false, HtmlContent = body.HtmlContent, PictureID = body.id, LastModifiedTime = DateTime.Now, HtmlExplain = body.HtmlExplain, HtmlTitle = body.HtmlTitle, AttachedPath = body.AttachedPath }; context.Add(WordInfos); context.SaveChanges(); WordRedis.Del(); } else { var WordInfo = context.WordInfo.Single(x => x.Id == body.Eid); WordInfo.LastModifiedTime = DateTime.Now; WordInfo.HtmlContent = body.HtmlContent; WordInfo.HtmlExplain = body.HtmlExplain; WordInfo.HtmlTitle = body.HtmlTitle; WordInfo.AttachedPath = body.AttachedPath; context.SaveChanges(); WordRedis.Del(); } return(Ok(new ApiResponse())); }
// [AuthFilter]//身份认证,不带token或者token错误会被拦截器拦截进不来这个接口 public IActionResult GetMongoDB(DateTime StartTime, DateTime EndTime, int Skip, int limit) { DBRequestLogs _logs = new DBRequestLogs(); var list = _logs.Get(StartTime, EndTime, Skip, limit).GroupBy(x => x.ApiName.Split("?")[0]); Dictionary <string, Dictionary <DateTime, int> > Time = new Dictionary <string, Dictionary <DateTime, int> >(); foreach (var item in list) { foreach (var Citem in item.GroupBy(x => x.CreateTime.Day)) { TimeDto timeDto = new TimeDto() { DateTime = Citem.Key, Count = Citem.Count() }; List <TimeDto> ChangeTiem = new List <TimeDto>(); ChangeTiem.Add(timeDto); Time.Add(item.Key + Citem.Key, SequenceID.CompletionTime(StartTime, EndTime, ChangeTiem)); } } return(Ok(new ApiResponse(Time, Time.Count()))); }
[AuthFilter]//身份认证,不带token或者token错误会被拦截器拦截进不来这个接口 public IActionResult RegisterFree(RegisterFreeDto body) { int count = _BaseService.GetListWriteBy <Users>(x => x.UserName == body.UserName).Count(); if (count > 0) { return(Ok(new ApiResponse(code: CodeAndMessage.用户名重复))); } Users users = new Users() { Id = SequenceID.GetSequenceID(), AuthRole = AuthRole.User, CreateTime = DateTime.Now, Disable = false, Email = body.Email, LastModifiedTime = DateTime.Now, LoginType = LoginType.FreeWeb, UserName = body.UserName, PassWord = HashPass.HashString(body.PassWord, "MD5"), }; _BaseService.Add(users); return(Ok(new ApiResponse())); }
public int CompareTo(object obj) { var typedObj = (SequencedComplexItem)obj; return(SequenceID.CompareTo(typedObj.SequenceID)); }
private void btnAdd_Click(object sender, EventArgs e) { Product prod = null; int temp_seq = 0; if (!product_list.isUnique(txtSN.Text)) { MessageBox.Show("There is another product with this SN...", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (cmbTypeProd.Text == "Book") { if (!DataValidator.verifyData(txtBPages.Text, new Regex(DataValidator.patternNumber))) { MessageBox.Show("Pages has to be a numeric value", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } prod = new Book(Convert.ToInt16(txtBPages.Text), (EnumBookGenre)cmbBGenre.SelectedItem); temp_seq = prod.Item; //Store last sequence } else if (cmbTypeProd.Text == "Software") { if (!DataValidator.verifyData(txtSCapacity.Text, new Regex(DataValidator.patternNumber))) { MessageBox.Show("Software Capacity has to be a numeric value", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } prod = new Software(txtSCapacity.Text, (EnumSoftType)cmbSoftType.SelectedItem); temp_seq = prod.Item; //Store last sequence } else { MessageBox.Show("Must be select a Type of Product...", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } try { prod.SerialNumber = txtSN.Text; prod.Type = (EnumProdType)cmbTypeProd.SelectedItem; prod.Titname = txtTitle.Text; prod.Author = txtAuthor.Text; // Validating Price if (!DataValidator.verifyData(txtPrice.Text, new Regex(DataValidator.patternMoney))) { MessageBox.Show("Price has to be a numeric value", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } prod.Price = Convert.ToDouble(txtPrice.Text); //Validating Date if (!DataValidator.verifyData(txtHDay.Text, new Regex(DataValidator.patternDay))) { MessageBox.Show("Wrong day...Must be between 1 and 31", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); SequenceID.setProd_id(temp_seq); // Decrease the sequence return; } if (!DataValidator.verifyData(txtHMonth.Text, new Regex(DataValidator.patternMonth))) { MessageBox.Show("Wrong month...Must be between 1 and 12", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); SequenceID.setProd_id(temp_seq); // Decrease the sequence return; } if (!DataValidator.verifyData(txtHYear.Text, new Regex(DataValidator.patternYear))) { MessageBox.Show("Wrong year...Must be between 1900 and 2099", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); SequenceID.setProd_id(temp_seq); // Decrease the sequence return; } prod.Ed_pubDate = new Date(txtHDay.Text, txtHMonth.Text, txtHYear.Text); // Validating Stock if (!DataValidator.verifyData(txtStock.Text, new Regex(DataValidator.patternNumber))) { MessageBox.Show("Stock has to be a numeric value", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } prod.Stock = Convert.ToInt16(txtStock.Text); // Adding to list product_list.add(prod); this.listBoxProducts.Items.Add(product_list.ShowListInBox(prod)); btnReset.PerformClick(); MessageBox.Show("Product Added", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information); save_flag = true; } catch { MessageBox.Show("Missing or incorrects values to enter...Check and Try again", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnModify_Click(object sender, EventArgs e) { Product prod = null; int temp_seq = 0; try { if (cmbTypeProd.Text == "Book") { if (!DataValidator.verifyData(txtBPages.Text, new Regex(DataValidator.patternNumber))) { MessageBox.Show("Pages must be a numeric value", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } prod = new Book(Convert.ToInt16(txtBPages.Text), (EnumBookGenre)cmbBGenre.SelectedItem); temp_seq = prod.Item; //Store last sequence } else if (cmbTypeProd.Text == "Software") { if (!DataValidator.verifyData(txtSCapacity.Text, new Regex(DataValidator.patternNumber))) { MessageBox.Show("Software Capacity has to be a numeric value", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } prod = new Software(txtSCapacity.Text, (EnumSoftType)cmbSoftType.SelectedItem); temp_seq = prod.Item; //Store last sequence } else { MessageBox.Show("Must be selected an Employee's Category...", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } try { prod.SerialNumber = txtSN.Text; prod.Type = (EnumProdType)cmbTypeProd.SelectedItem; prod.Titname = txtTitle.Text; prod.Author = txtAuthor.Text; // Validating Price if (!DataValidator.verifyData(txtPrice.Text, new Regex(DataValidator.patternMoney))) { MessageBox.Show("Price has to be a numeric value", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } prod.Price = Convert.ToDouble(txtPrice.Text); //Validating Date if (!DataValidator.verifyData(txtHDay.Text, new Regex(DataValidator.patternDay))) { MessageBox.Show("Wrong day...Must be between 1 and 31", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); SequenceID.setProd_id(temp_seq); // Decrease the sequence return; } if (!DataValidator.verifyData(txtHMonth.Text, new Regex(DataValidator.patternMonth))) { MessageBox.Show("Wrong month...Must be between 1 and 12", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); SequenceID.setProd_id(temp_seq); // Decrease the sequence return; } if (!DataValidator.verifyData(txtHYear.Text, new Regex(DataValidator.patternYear))) { MessageBox.Show("Wrong year...Must be between 1900 and 2099", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); SequenceID.setProd_id(temp_seq); // Decrease the sequence return; } prod.Ed_pubDate = new Date(txtHDay.Text, txtHMonth.Text, txtHYear.Text); // Validating Stock if (!DataValidator.verifyData(txtStock.Text, new Regex(DataValidator.patternNumber))) { MessageBox.Show("Stock has to be a numeric value", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } prod.Stock = Convert.ToInt16(txtStock.Text); prod.SerialNumber = tempsn; //Assign last displayed SN prod.Item = temp_id; if (txtSN.Text != prod.SerialNumber) { MessageBox.Show("Can't to modify the SN in the Modify option. It should use Add button", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (update_index > -1) { // Update list Box and list of Products product_list.modify(prod, prod.SerialNumber); listBoxProducts.Items.Clear(); foreach (Product temp in product_list.ReturnList()) { this.listBoxProducts.Items.Add(product_list.ShowListInBox(temp)); } btnReset.PerformClick(); update_index = -1; save_flag = true; MessageBox.Show("Product Mofified", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("It must to select an item and display it. Use Display Option", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch { MessageBox.Show("Missing or incorrects values to enter...Check and Try again", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch { MessageBox.Show("Missing or incorrects values to enter...Check and Try again", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void btnModify_Click(object sender, EventArgs e) { Employee emp = null; string ccode = ""; int temp_seq = 0; try { if (cmbCategory.Text == "FullTime") { ccode = "FT"; if (!DataValidator.verifyData(txtFTAnnualSalary.Text, new Regex(DataValidator.patternMoney))) { MessageBox.Show("Annual Salary must be a numeric value", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } emp = new FullTime((EnumPosition)cmbFTPosition.SelectedItem, Convert.ToDouble(txtFTAnnualSalary.Text)); temp_seq = emp.getId(); //Store last sequence } else if (cmbCategory.Text == "PartTime") { ccode = "PT-"; if (cmbPTContractType.Text == "Consultant_Trainers") { ccode += "CON"; if (!DataValidator.verifyData(txtPTContractMonth.Text, new Regex(DataValidator.patternNumber))) { MessageBox.Show("Contract Month must be a number", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (!DataValidator.verifyData(txtPTTCHourlySal.Text, new Regex(DataValidator.patternHours))) { MessageBox.Show("Week hours must be a numeric value", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (!DataValidator.verifyData(txtPTCTWeekHours.Text, new Regex(DataValidator.patternHours))) { MessageBox.Show("Hours must be a numeric value", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } emp = new ConsultantTrainer((EnumContractType)cmbPTContractType.SelectedItem, Convert.ToInt16(txtPTContractMonth.Text), Convert.ToDouble(txtPTTCHourlySal.Text), Convert.ToDouble(txtPTCTWeekHours.Text)); temp_seq = emp.getId(); //Store last sequence } else if (cmbPTContractType.Text == "Internship_Student") { ccode += "INT"; if (!DataValidator.verifyData(txtPTInternSal.Text, new Regex(DataValidator.patternMoney))) { MessageBox.Show("Internship Salary must be a numeric value", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } emp = new Internship(Convert.ToDouble(txtPTInternSal.Text), (EnumContractType)cmbPTContractType.SelectedItem, Convert.ToInt16(txtPTContractMonth.Text)); temp_seq = emp.getId(); //Store last sequence } else { MessageBox.Show("Must be selected a Contract Type...", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show("Must be selected an Employee's Category...", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } try { emp.setFname(txtFirstName.Text); emp.setLname(txtLastName.Text); if (!DataValidator.verifyData(txtSIN.Text, new Regex(DataValidator.patternSIN))) { MessageBox.Show("Social Security must be a code like this ###-###-###", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); SequenceID.setEmployee_id(temp_seq); // Decrease the sequence return; } emp.setDepartment((EnumDepartment)cmbDept.SelectedItem); emp.setCategory((EnumCategory)cmbCategory.SelectedItem); if (!DataValidator.verifyData(txtHDay.Text, new Regex(DataValidator.patternDay))) { MessageBox.Show("Wrong day...Must be between 1 and 31", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); SequenceID.setEmployee_id(temp_seq); // Decrease the sequence return; } if (!DataValidator.verifyData(txtHMonth.Text, new Regex(DataValidator.patternMonth))) { MessageBox.Show("Wrong month...Must be between 1 and 12", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); SequenceID.setEmployee_id(temp_seq); // Decrease the sequence return; } if (!DataValidator.verifyData(txtHYear.Text, new Regex(DataValidator.patternYear))) { MessageBox.Show("Wrong year...Must be between 1900 and 2099", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); SequenceID.setEmployee_id(temp_seq); // Decrease the sequence return; } emp.setHire_date(new Date(txtHDay.Text, txtHMonth.Text, txtHYear.Text)); if (!DataValidator.verifyData(txtBDay.Text, new Regex(DataValidator.patternDay))) { MessageBox.Show("Wrong day...Must be between 1 and 31", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); SequenceID.setEmployee_id(temp_seq); // Decrease the sequence return; } if (!DataValidator.verifyData(txtBMonth.Text, new Regex(DataValidator.patternMonth))) { MessageBox.Show("Wrong month...Must be between 1 and 12", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); SequenceID.setEmployee_id(temp_seq); // Decrease the sequence return; } if (!DataValidator.verifyData(txtBYear.Text, new Regex(DataValidator.patternYear))) { MessageBox.Show("Wrong year...Must be between 1900 and 2099", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); SequenceID.setEmployee_id(temp_seq); // Decrease the sequence return; } emp.setBirthday(new Date(txtBDay.Text, txtBMonth.Text, txtBYear.Text)); if (!DataValidator.verifyData(txtAddStrNo.Text, new Regex(DataValidator.patternNumber))) { MessageBox.Show("Wrong Street No... Must be a number", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); SequenceID.setEmployee_id(temp_seq); // Decrease the sequence return; } if (!DataValidator.verifyData(txtAddApt.Text, new Regex(DataValidator.patternApt))) { MessageBox.Show("Wrong Appartment/House No... Must be a number", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); SequenceID.setEmployee_id(temp_seq); // Decrease the sequence return; } if (!DataValidator.verifyData(txtAddApt.Text, new Regex(DataValidator.patternApt))) { MessageBox.Show("Wrong Zip Code... Must be like this X#X-#X#", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); SequenceID.setEmployee_id(temp_seq); // Decrease the sequence return; } emp.setAddress(new Address(txtAddStrNo.Text, txtAddStrName.Text, txtAddApt.Text, txtAddCity.Text, txtAddState.Text, txtAddCountry.Text, txtAddZipCode.Text)); if (!DataValidator.verifyData(txtHCountCode.Text, new Regex(DataValidator.patternCountcode))) { MessageBox.Show("Wrong Phone Country Code", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); SequenceID.setEmployee_id(temp_seq); // Decrease the sequence return; } if (!DataValidator.verifyData(txtHCityCode.Text, new Regex(DataValidator.patternCitycode))) { MessageBox.Show("Wrong Phone City Code...Must be a 3 digits number", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); SequenceID.setEmployee_id(temp_seq); // Decrease the sequence return; } if (!DataValidator.verifyData(txtHLocalCode.Text, new Regex(DataValidator.patternLocalcode))) { MessageBox.Show("Wrong Phone Local...Must be a 7 digits number", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); SequenceID.setEmployee_id(temp_seq); // Decrease the sequence return; } emp.setHome_ph(new Phone(txtHCountCode.Text, txtHCityCode.Text, txtHLocalCode.Text)); if (!DataValidator.verifyData(txtCCountCode.Text, new Regex(DataValidator.patternCountcode))) { MessageBox.Show("Wrong Phone Country Code", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); SequenceID.setEmployee_id(temp_seq); // Decrease the sequence return; } if (!DataValidator.verifyData(txtCCityCode.Text, new Regex(DataValidator.patternCitycode))) { MessageBox.Show("Wrong Phone City Code...Must be a 3 digits number", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); SequenceID.setEmployee_id(temp_seq); // Decrease the sequence return; } if (!DataValidator.verifyData(txtCLocalCode.Text, new Regex(DataValidator.patternLocalcode))) { MessageBox.Show("Wrong Phone Local...Must be a 7 digits number", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); SequenceID.setEmployee_id(temp_seq); // Decrease the sequence return; } emp.setCel_ph(new Phone(txtCCountCode.Text, txtCCityCode.Text, txtCLocalCode.Text)); if (!DataValidator.verifyData(txtEmail.Text, new Regex(DataValidator.patternEmail))) { MessageBox.Show("Wrong email address", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); SequenceID.setEmployee_id(temp_seq); // Decrease the sequence return; } emp.setEmail(txtEmail.Text); emp.setSocial_security(tempsin); //Assign last displayed SIN txtTwoWeeksSal.Text = emp.getTwoWeeks_salary().ToString("#.##") + " $"; emp.setId(temp_id); emp.setContract(ccode); txtKey.Text = emp.getContract(); if (txtSIN.Text != emp.getSocial_security()) { MessageBox.Show("Can't to modify the SIN in the Modify option. It should use Add button", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } if (update_index > -1) { // Update list Box and list of employees //listBoxEmployees.Items.Insert(update_index, emp); employees.modify(emp, emp.getSocial_security()); listBoxEmployees.Items.Clear(); foreach (Employee temp in employees.ReturnList()) { this.listBoxEmployees.Items.Add(employees.ShowListInBox(temp)); } btnReset.PerformClick(); update_index = -1; save_flag = true; MessageBox.Show("Employee Mofified", "Confirmation", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show("It must to select an item and display it. Use Display Option", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch { MessageBox.Show("Missing or incorrects values to enter...Check and Try again", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } catch { MessageBox.Show("2222222222222Missing or incorrects values to enter...Check and Try again", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
public StartSequencerEvent(SequenceID inSequenceID) { _sequenceID = inSequenceID; identifier = EventIdentifier.StartSequencerRequest; }