Пример #1
0
        private bool SaveProgress()
        {
            this.OnSaveCheckDenyEvent(EventArgs.Empty);
            IList <EducationInfo> list = new List <EducationInfo>();

            for (int i = 0; i < this.deducation.RowCount - 1; i++)
            {
                DataGridViewRow dataGridViewRow = this.deducation.Rows[i];
                EducationInfo   educationInfo   = new EducationInfo();
                educationInfo.EducationNo     = ((dataGridViewRow.Cells["gridEducationNo"].Value == null) ? "" : dataGridViewRow.Cells["gridEducationNo"].Value.ToString());
                educationInfo.EducationSDate  = ((dataGridViewRow.Cells["startdate"].Value == null || dataGridViewRow.Cells["startdate"].Value == DBNull.Value || dataGridViewRow.Cells["startdate"].Value.ToString() == "") ? "" : ((DateTime)dataGridViewRow.Cells["startdate"].Value).ToString("yyyy-MM-dd"));
                educationInfo.EducationEDate  = ((dataGridViewRow.Cells["enddate"].Value == null || dataGridViewRow.Cells["enddate"].Value == DBNull.Value || dataGridViewRow.Cells["enddate"].Value.ToString() == "") ? "" : ((DateTime)dataGridViewRow.Cells["enddate"].Value).ToString("yyyy-MM-dd"));
                educationInfo.EducationOrg    = ((dataGridViewRow.Cells["school"].Value == null || dataGridViewRow.Cells["school"].Value == DBNull.Value) ? "" : dataGridViewRow.Cells["school"].Value.ToString());
                educationInfo.EducationMajor  = ((dataGridViewRow.Cells["major"].Value == null || dataGridViewRow.Cells["major"].Value == DBNull.Value) ? "" : dataGridViewRow.Cells["major"].Value.ToString());
                educationInfo.EducationDegree = ((dataGridViewRow.Cells["degree"].Value == null || dataGridViewRow.Cells["degree"].Value == DBNull.Value) ? "" : dataGridViewRow.Cells["degree"].Value.ToString());
                educationInfo.EducationOrder  = this.deducation.RowCount - i;
                if (educationInfo.EducationSDate == "" || educationInfo.EducationOrg == "" || educationInfo.EducationMajor == "" || educationInfo.EducationDegree == "")
                {
                    MessageBox.Show("开始年月、校(院)及系名称、专业、学位为必填字段,检测到部分字段未填写完整", "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                    return(false);
                }
                list.Add(educationInfo);
            }
            this.OnSaveCheckPassedEvent(EventArgs.Empty);
            this._educationInfoService.UpdateEducations(list);
            list = this._educationInfoService.GetEducationList();
            this.LoadData(list);
            return(true);
        }
Пример #2
0
        public async Task <IActionResult> PutEducationInfo(long id, EducationInfo educationInfo)
        {
            if (id != educationInfo.Id)
            {
                return(BadRequest());
            }

            _context.Entry(educationInfo).State = EntityState.Modified;

            try
            {
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!educationInfoExist(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Пример #3
0
        public bool Update(EducationInfo model)
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append("update Education set ");
            stringBuilder.Append("EducationNo=@EducationNo,");
            stringBuilder.Append("EducationSDate=@EducationSDate,");
            stringBuilder.Append("EducationEDate=@EducationEDate,");
            stringBuilder.Append("EducationOrg=@EducationOrg,");
            stringBuilder.Append("EducationMajor=@EducationMajor,");
            stringBuilder.Append("EducationDegree=@EducationDegree,");
            stringBuilder.Append("EducationOrder=@EducationOrder");
            stringBuilder.Append(" where EducationNo=@EducationNo");
            SQLiteParameter[] array = new SQLiteParameter[]
            {
                new SQLiteParameter("@EducationNo", DbType.String),
                new SQLiteParameter("@EducationSDate", DbType.String),
                new SQLiteParameter("@EducationEDate", DbType.String),
                new SQLiteParameter("@EducationOrg", DbType.String),
                new SQLiteParameter("@EducationMajor", DbType.String),
                new SQLiteParameter("@EducationDegree", DbType.String),
                new SQLiteParameter("@EducationOrder", DbType.Int32, 4)
            };
            array[0].Value = model.EducationNo;
            array[1].Value = model.EducationSDate;
            array[2].Value = model.EducationEDate;
            array[3].Value = model.EducationOrg;
            array[4].Value = model.EducationMajor;
            array[5].Value = model.EducationDegree;
            array[6].Value = model.EducationOrder;
            string text = "";

            base.ExecuteNonQuery(stringBuilder.ToString(), array, out text);
            return(true);
        }
Пример #4
0
        public async Task <ActionResult <EducationInfo> > PostEducationInfos(EducationInfo educationInfo)
        {
            _context.EducationInfos.Add(educationInfo);
            await _context.SaveChangesAsync();

            return(CreatedAtAction(nameof(EducationInfo), new { id = educationInfo.Id }, educationInfo));
        }
        public async Task <int> UpdateAsync(EducationInfo educationObj)
        {
            using (var conn = OpenDBConnection())
            {
                StringBuilder sql = new StringBuilder(string.Empty);

                sql.AppendLine("  UPDATE dbo.Education             ");
                sql.AppendLine("  SET CollegeName = @CollegeName,  ");
                sql.AppendLine("       Major = @Major,             ");
                sql.AppendLine("       OrderIndex = @OrderIndex,   ");
                sql.AppendLine("       Status = @Status,           ");
                sql.AppendLine("       StartDate = @StartDate,     ");
                sql.AppendLine("       EndDate = @EndDate,         ");
                sql.AppendLine("       UpdatedAt = @UpdatedAt,     ");
                sql.AppendLine("       UpdatedBy = @UpdatedBy,     ");
                sql.AppendLine("       PersonId = @PersonId        ");
                sql.AppendLine("  WHERE Id = @Id                   ");

                var param = new
                {
                    id          = educationObj.Id,
                    collegeName = educationObj.CollegeName,
                    major       = educationObj.Major,
                    orderIndex  = educationObj.OrderIndex,
                    status      = educationObj.Status,
                    startDate   = educationObj.StartDate,
                    endDate     = educationObj.EndDate,
                    updatedAt   = educationObj.UpdatedAt,
                    updatedBy   = educationObj.UpdatedBy,
                    personId    = educationObj.PersonId,
                };
                return(await conn.ExecuteAsync(sql.ToString(), param));
            }
        }
 public JsonResult EducationInfoEdit(EducationInfo educationinfo)
 {
     if (ModelState.IsValid)
     {
         educationInfoRepository.Update(educationinfo);
     }
     return(Json("Success"));
 }
Пример #7
0
        public async Task <int> DeleteAsync(int id)
        {
            EducationInfo model = await ReadByIdAsync(id);

            EntityExtension.FlagForDelete(model, IdentityService.Username, UserAgent, true);
            DbSet.Update(model);
            return(await DbContext.SaveChangesAsync());
        }
 public JsonResult EducationInfoCreate(EducationInfo educationinfo)
 {
     if (ModelState.IsValid)
     {
         educationInfoRepository.Insert(educationinfo);
     }
     return(Json("Success"));
 }
Пример #9
0
 private void SaveData()
 {
     this.info            = this.baseinfo.GetData();
     this.educationinfo   = this.education.GetData();
     this.foodsafeinfo    = this.foodsafe.GetData();
     this.jtinfo          = this.jtsafe.GetData();
     this.ldpersoninfo    = this.ldperson.GetData();
     this.safeproduceinfo = this.safeproduce.GetData();
     this.xfsafeinfo      = this.xfsafe.GetData();
 }
        public void renderV2Education(EducationInfo educationInfo, Font titleFont, Font simpleFont, PdfPTable career, PdfPCell line)
        {
            //Tuscias langelis
            PdfPCell empty = new PdfPCell(new Phrase(" "));

            empty.Border = Rectangle.NO_BORDER;
            int      counter        = 0;
            PdfPCell educationTitle = new PdfPCell(new Phrase(educationInfo.Name, titleFont));

            educationTitle.Border = Rectangle.NO_BORDER;

            PdfPCell educationValues = new PdfPCell();

            educationValues.Border = Rectangle.NO_BORDER;
            PdfPTable educT = new PdfPTable(2);

            educT.SplitLate = false;
            float[] educTWidth = { 1f, 1f };
            //Ciklas testavimui,nes nera galimybes ivesti 3 skirtingu

            foreach (var sectionItem in educationInfo.Items)
            {
                foreach (Field field in sectionItem.Values)
                {
                    if (!string.IsNullOrEmpty(field.Value))
                    {
                        counter++;
                        PdfPCell eduValue = new PdfPCell(new Phrase(field.Value, simpleFont));
                        eduValue.Border = Rectangle.NO_BORDER;
                        eduValue.HorizontalAlignment = 1;
                        educT.AddCell(eduValue);
                    }
                    else
                    {
                        educT.AddCell(empty);
                    }
                }
                educT.AddCell(empty);
                educT.AddCell(empty);
            }
            if (counter > 0)
            {
                career.AddCell(educationTitle);
                career.AddCell(line);
                career.AddCell(empty);
            }
            else
            {
                career.AddCell(empty);
            }

            educationValues.AddElement(educT);
            career.AddCell(educationValues);
        }
Пример #11
0
 public virtual void UpdateEducationInfo(EducationInfo obj, string id, string EId)
 {
     if (EId == null)
     {
         Context.AddCommand(() => DbSet.UpdateOneAsync(Builders <Applicant> .Filter.Eq("_id", ObjectId.Parse(id)), Builders <Applicant> .Update.Push("EducationInfos", obj)));
     }
     else
     {
         ObjectId OId = ObjectId.Parse(id);
         Context.AddCommand(() => DbSet.UpdateOneAsync(Builders <Applicant> .Filter.Where(x => x.Id == OId && x.EducationInfos.Any(m => m.EId == EId)),
                                                       Builders <Applicant> .Update.Set(x => x.EducationInfos.ElementAt(-1), obj)));
     }
     // DbSet.UpdateOneAsync(Builders<Applicant>.Filter.Eq("_id", ObjectId.Parse(id)), Builders<Applicant>.Update.Push("EducationInfos", obj));
 }
Пример #12
0
        public async Task <int> UpdateAsync(int id, EducationInfo model)
        {
            var data = await ReadByIdAsync(id);

            //Formal Education Experience
            data.Grade       = model.Grade;
            data.Institution = model.Institution;
            data.Majors      = model.Majors;
            data.YearStart   = model.YearStart;
            data.YearEnd     = model.YearEnd;

            DbSet.Update(data);
            return(await DbContext.SaveChangesAsync());
        }
        public async Task <int> InsertAsync(EducationInfo educationObj)
        {
            using (var conn = OpenDBConnection())
            {
                StringBuilder sql = new StringBuilder(string.Empty);

                sql.AppendLine("  INSERT INTO                       ");
                sql.AppendLine("       dbo.Education (CollegeName,  ");
                sql.AppendLine("       Major,                       ");
                sql.AppendLine("       OrderIndex,                  ");
                sql.AppendLine("       Status,                      ");
                sql.AppendLine("       StartDate,                   ");
                sql.AppendLine("       EndDate,                     ");
                sql.AppendLine("       CreatedAt,                   ");
                sql.AppendLine("       CreatedBy,                   ");
                sql.AppendLine("       UpdatedAt,                   ");
                sql.AppendLine("       UpdatedBy,                   ");
                sql.AppendLine("       PersonId)                    ");
                sql.AppendLine("  OUTPUT INSERTED.ID                ");
                sql.AppendLine("  VALUES (@CollegeName,             ");
                sql.AppendLine("       @Major,                      ");
                sql.AppendLine("       @OrderIndex,                 ");
                sql.AppendLine("       @Status,                     ");
                sql.AppendLine("       @StartDate,                  ");
                sql.AppendLine("       @EndDate,                    ");
                sql.AppendLine("       @CreatedAt,                  ");
                sql.AppendLine("       @CreatedBy,                  ");
                sql.AppendLine("       @UpdatedAt,                  ");
                sql.AppendLine("       @UpdatedBy,                  ");
                sql.AppendLine("       @PersonId)                   ");

                var param = new
                {
                    collegeName = educationObj.CollegeName,
                    major       = educationObj.Major,
                    orderIndex  = educationObj.OrderIndex,
                    status      = educationObj.Status,
                    startDate   = educationObj.StartDate,
                    endDate     = educationObj.EndDate,
                    createdAt   = educationObj.CreatedAt,
                    createdBy   = educationObj.CreatedBy,
                    updatedAt   = educationObj.UpdatedAt,
                    updatedBy   = educationObj.UpdatedBy,
                    personId    = educationObj.PersonId
                };

                return(await conn.ExecuteScalarAsync <int>(sql.ToString(), param));
            }
        }
Пример #14
0
        //[Fact]
        //public void ApplicantController_Create_Test()
        //{
        //    AutoMapperConfiguration.Configure();
        //    Applicant applicant = this.FakeApplicant();
        //    ApplicantViewModel applicantVM = new ApplicantViewModel(){IAgree = true};
        //    applicantVM=Mapper.Map(applicant, applicantVM);

        //    var controller = TestHelper.kernel.Get<ApplicantController>();
        //    ActionResult actionResult = controller.Create(applicantVM);
        //    Assert.True(actionResult != null);
        //}

        //[Fact]
        //public void TenderApplicationController_Create_Test()
        //{
        //    var controller = TestHelper.kernel.Get<TenderApplicationController>();
        //    ViewResult actionResult = controller.ListTender();
        //    Assert.True(actionResult != null);
        //}

        #endregion

        #region Methods

        private Applicant FakeApplicant()
        {
            var applicant = new Applicant();

            applicant.FirstName = "alaik";
            var educationInfo = new EducationInfo
            {
                College = "asdasd", Level = EducationLevel.Bachelor
            };
            var educationInfo2 = new EducationInfo
            {
                College = "12312", Level = EducationLevel.Master
            };

            applicant.EducationInfos.Add(educationInfo);
            applicant.EducationInfos.Add(educationInfo2);
            return(applicant);
        }
Пример #15
0
        public async Task <ActionResult <EducationInfo> > PostEducationInfos([FromBody] EducationInfoFormViewModel educationInfo)
        {
            VerifyUser();
            var model = new EducationInfo()
            {
                EducationInfoId = educationInfo.EducationInfoId,
                Grade           = educationInfo.Grade,
                Institution     = educationInfo.Institution,
                Majors          = educationInfo.Majors,
                YearStart       = educationInfo.YearStart,
                YearEnd         = educationInfo.YearEnd
            };

            EntityExtension.FlagForCreate(model, _identityService.Username, UserAgent);
            _context.EducationInfos.Add(model);
            await _context.SaveChangesAsync();

            return(Created("", model));
        }
Пример #16
0
 public AddCompanyInfo(BaseInfo info, EducationInfo educationinfo, FoodSafeInfo foodsafeinfo,
                       JTsafeInfo jtinfo, LDpersonInfo ldpersoninfo, SafeProduceInfo safeproduceinfo, XFsafeInfo xfsafeinfo)
 {
     bModify = true;
     InitializeComponent();
     this.baseinfo.SetData(info);
     this.education.SetData(educationinfo);
     this.foodsafe.SetData(foodsafeinfo);
     this.jtsafe.SetData(jtinfo);
     this.ldperson.SetData(ldpersoninfo);
     this.safeproduce.SetData(safeproduceinfo);
     this.xfsafe.SetData(xfsafeinfo);
     if (Global.authority == Authority.Looker)
     {
         this.okBtn.Enabled    = false;
         this.AddjgBtn.Enabled = false;
     }
     else
     {
         this.okBtn.Enabled    = true;
         this.AddjgBtn.Enabled = true;
     }
 }
Пример #17
0
        public bool Add(EducationInfo model)
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append("insert into Education(");
            stringBuilder.Append("EducationNo,EducationSDate,EducationEDate,EducationOrg,EducationMajor,EducationDegree,EducationOrder)");
            stringBuilder.Append(" values (");
            stringBuilder.Append("@EducationNo,@EducationSDate,@EducationEDate,@EducationOrg,@EducationMajor,@EducationDegree,@EducationOrder)");
            SQLiteParameter[] parameters = new SQLiteParameter[]
            {
                new SQLiteParameter("@EducationNo", model.EducationNo),
                new SQLiteParameter("@EducationSDate", model.EducationSDate),
                new SQLiteParameter("@EducationEDate", model.EducationEDate),
                new SQLiteParameter("@EducationOrg", model.EducationOrg),
                new SQLiteParameter("@EducationMajor", model.EducationMajor),
                new SQLiteParameter("@EducationDegree", model.EducationDegree),
                new SQLiteParameter("@EducationOrder", model.EducationOrder)
            };
            string text = "";

            base.ExecuteNonQuery(stringBuilder.ToString(), parameters, out text);
            return(true);
        }
 public ActionResult SaveUser5(ComplexUserDTO user, EducationInfo Edu)
 {
     ViewBag.Msg = GetMessage(user);
     return View("Create5");
 }
        public async Task <bool> SwapOrderIndexAsync(EducationInfo currentObj, EducationInfo turnedObj)
        {
            using (var conn = OpenDBConnection())
                using (var transaction = conn.BeginTransaction())
                {
                    #region Current/Turned
                    StringBuilder sqlCurrent = new StringBuilder(string.Empty);
                    // Query statement for Current Object
                    sqlCurrent.AppendLine("  UPDATE dbo.Education                    ");
                    sqlCurrent.AppendLine("  SET CollegeName = @CollegeNameCurrent,  ");
                    sqlCurrent.AppendLine("       Major = @MajorCurrent,             ");
                    sqlCurrent.AppendLine("       OrderIndex = @OrderIndexCurrent,   ");
                    sqlCurrent.AppendLine("       Status = @StatusCurrent,           ");
                    sqlCurrent.AppendLine("       StartDate = @StartDateCurrent,     ");
                    sqlCurrent.AppendLine("       EndDate = @EndDateCurrent,         ");
                    sqlCurrent.AppendLine("       UpdatedAt = @UpdatedAtCurrent,     ");
                    sqlCurrent.AppendLine("       UpdatedBy = @UpdatedByCurrent,     ");
                    sqlCurrent.AppendLine("       PersonId = @PersonIdCurrent        ");
                    sqlCurrent.AppendLine("  WHERE Id = @IdCurrent                   ");

                    var paramCurrent = new
                    {
                        idCurrent          = currentObj.Id,
                        collegeNameCurrent = currentObj.CollegeName,
                        majorCurrent       = currentObj.Major,
                        orderIndexCurrent  = currentObj.OrderIndex,
                        statusCurrent      = currentObj.Status,
                        startDateCurrent   = currentObj.StartDate,
                        endDateCurrent     = currentObj.EndDate,
                        updatedAtCurrent   = currentObj.UpdatedAt,
                        updatedByCurrent   = currentObj.UpdatedBy,
                        personIdCurrent    = currentObj.PersonId,
                    };
                    // Query statement for Turned Object
                    StringBuilder sqlTurned = new StringBuilder(string.Empty);
                    sqlTurned.AppendLine("  UPDATE dbo.Education                   ");
                    sqlTurned.AppendLine("  SET CollegeName = @CollegeNameTurned,  ");
                    sqlTurned.AppendLine("       Major = @MajorTurned,             ");
                    sqlTurned.AppendLine("       OrderIndex = @OrderIndexTurned,   ");
                    sqlTurned.AppendLine("       Status = @StatusTurned,           ");
                    sqlTurned.AppendLine("       StartDate = @StartDateTurned,     ");
                    sqlTurned.AppendLine("       EndDate = @EndDateTurned,         ");
                    sqlTurned.AppendLine("       UpdatedAt = @UpdatedAtTurned,     ");
                    sqlTurned.AppendLine("       UpdatedBy = @UpdatedByTurned,     ");
                    sqlTurned.AppendLine("       PersonId = @PersonIdTurned        ");
                    sqlTurned.AppendLine("  WHERE Id = @IdTurned;                  ");

                    var paramTurned = new
                    {
                        idTurned          = turnedObj.Id,
                        collegeNameTurned = turnedObj.CollegeName,
                        majorTurned       = turnedObj.Major,
                        orderIndexTurned  = turnedObj.OrderIndex,
                        statusTurned      = turnedObj.Status,
                        startDateTurned   = turnedObj.StartDate,
                        endDateTurned     = turnedObj.EndDate,
                        updatedAtTurned   = turnedObj.UpdatedAt,
                        updatedByTurned   = turnedObj.UpdatedBy,
                        personIdTurned    = turnedObj.PersonId,
                    };
                    #endregion
                    int isSuccessCurrent = await conn.ExecuteAsync(sqlCurrent.ToString(), paramCurrent, transaction);

                    int isSuccessTurned = await conn.ExecuteAsync(sqlTurned.ToString(), paramTurned, transaction);

                    if (isSuccessCurrent > 0 && isSuccessTurned > 0)
                    {
                        transaction.Commit();
                        return(true);
                    }
                    return(false);
                }
        }
Пример #20
0
 public async Task <int> CreateAsync(EducationInfo model)
 {
     EntityExtension.FlagForCreate(model, IdentityService.Username, UserAgent);
     DbSet.Add(model);
     return(await DbContext.SaveChangesAsync());
 }
 public ActionResult SaveUser5(ComplexUserDTO user, EducationInfo Edu)
 {
     ViewBag.Msg = GetMessage(user);
     return(View("Create5"));
 }
Пример #22
0
        public IActionResult EducationInfoCreate()
        {
            var EducationInfo = new EducationInfo();

            return(View(EducationInfo));
        }
Пример #23
0
        private void ViewCompanyInfo()
        {
            BaseInfo        baseinfo      = new BaseInfo();
            EducationInfo   educationinfo = new EducationInfo();
            FoodSafeInfo    foodinfo      = new FoodSafeInfo();
            JTsafeInfo      jtinfo        = new JTsafeInfo();
            LDpersonInfo    ldinfo        = new LDpersonInfo();
            SafeProduceInfo spinfo        = new SafeProduceInfo();
            XFsafeInfo      xfinfo        = new XFsafeInfo();

            try
            {
                string    strSql = "Select * From CompanyInfo where Id = " + Convert.ToInt32(this.dataGridView1.SelectedRows[0].Cells[0].Value) + "";
                DataTable dt     = SqlHelper.dataTable(strSql);
                if (dt.Rows.Count == 0)
                {
                    return;
                }
                baseinfo.CompanyName      = dt.Rows[0][1].ToString();
                baseinfo.Faren            = dt.Rows[0][2].ToString();
                baseinfo.FaPhoneNum       = dt.Rows[0][3].ToString();
                baseinfo.CompanyAddressA  = dt.Rows[0][4].ToString();
                baseinfo.CompanyAddressB  = dt.Rows[0][5].ToString();
                baseinfo.ChenBaoPerson    = dt.Rows[0][6].ToString();
                baseinfo.ChenBaoPhoneNum  = dt.Rows[0][7].ToString();
                baseinfo.ChenBaoAddress   = dt.Rows[0][8].ToString();
                baseinfo.HasYingyeId      = dt.Rows[0][9].ToString();
                baseinfo.JingYingContent  = dt.Rows[0][10].ToString();
                baseinfo.ZhuceNum         = dt.Rows[0][11].ToString();
                baseinfo.CompanyPersonNum = dt.Rows[0][12].ToString();
                baseinfo.HasShiTang       = dt.Rows[0][13].ToString();
                baseinfo.EatPersonNum     = dt.Rows[0][14].ToString();
                baseinfo.ChangDi          = dt.Rows[0][15].ToString();
                baseinfo.SleepPersonNum   = dt.Rows[0][16].ToString();
                baseinfo.JianzhuSquere    = dt.Rows[0][17].ToString();
                baseinfo.JianzhuType      = dt.Rows[0][18].ToString();
                baseinfo.CompanyStatus    = dt.Rows[0][19].ToString();
                baseinfo.PhotoPath1       = (byte[])dt.Rows[0][20];
                baseinfo.PhotoPath2       = (byte[])dt.Rows[0][21];
                baseinfo.PhotoPath3       = (byte[])dt.Rows[0][22];


                educationinfo.Type = dt.Rows[0][23].ToString();
                if (dt.Rows[0][24] != null)
                {
                    educationinfo.BuidTime = Convert.ToDateTime(dt.Rows[0][24]);
                }
                educationinfo.ClassNum            = dt.Rows[0][25].ToString();
                educationinfo.HouseType           = dt.Rows[0][26].ToString();
                educationinfo.StudentNum          = dt.Rows[0][27].ToString();
                educationinfo.HouseProperty       = dt.Rows[0][28].ToString();
                educationinfo.TeacherNum          = dt.Rows[0][29].ToString();
                educationinfo.OwnerProperty       = dt.Rows[0][30].ToString();
                educationinfo.OwnerName           = dt.Rows[0][31].ToString();
                educationinfo.ZhandiSquere        = dt.Rows[0][32].ToString();
                educationinfo.HuodongSquere       = dt.Rows[0][33].ToString();
                educationinfo.SchoolJianzhuSquere = dt.Rows[0][34].ToString();

                foodinfo.CompanyType = dt.Rows[0][35].ToString();
                foodinfo.HasLicense  = dt.Rows[0][36].ToString();
                foodinfo.LicenseName = dt.Rows[0][37].ToString();


                jtinfo.StrCarNum = dt.Rows[0][38].ToString();
                jtinfo.IsProf    = dt.Rows[0][39].ToString();
                jtinfo.TranBy    = dt.Rows[0][40].ToString();
                jtinfo.TranType  = dt.Rows[0][41].ToString();

                ldinfo.LivePersonNum  = dt.Rows[0][42].ToString();
                ldinfo.LiveHouseNum   = dt.Rows[0][43].ToString();
                ldinfo.HouseFloorNum  = dt.Rows[0][44].ToString();
                ldinfo.GetWarmStyle   = dt.Rows[0][45].ToString();
                ldinfo.HasWarnning    = dt.Rows[0][46].ToString();
                ldinfo.HirePersonType = dt.Rows[0][47].ToString();
                ldinfo.HasPromiseBook = dt.Rows[0][48].ToString();
                ldinfo.IsBackUp       = dt.Rows[0][49].ToString();
                ldinfo.BuildSquere    = dt.Rows[0][50].ToString();
                ldinfo.OwnerPerson    = dt.Rows[0][51].ToString();
                ldinfo.Telephone      = dt.Rows[0][52].ToString();

                spinfo.SP1     = dt.Rows[0][53].ToString();
                spinfo.SP2     = dt.Rows[0][54].ToString();
                spinfo.SP3     = dt.Rows[0][55].ToString();
                spinfo.SP4     = dt.Rows[0][56].ToString();
                spinfo.SP5     = dt.Rows[0][57].ToString();
                spinfo.SP6     = dt.Rows[0][58].ToString();
                spinfo.SP7     = dt.Rows[0][59].ToString();
                spinfo.SP8     = dt.Rows[0][60].ToString();
                spinfo.SP9     = dt.Rows[0][61].ToString();
                spinfo.SP10    = dt.Rows[0][62].ToString();
                spinfo.SP11    = dt.Rows[0][63].ToString();
                spinfo.SP12    = dt.Rows[0][64].ToString();
                spinfo.SP13    = dt.Rows[0][65].ToString();
                spinfo.SP14    = dt.Rows[0][66].ToString();
                spinfo.SP15    = dt.Rows[0][67].ToString();
                spinfo.SP16    = dt.Rows[0][68].ToString();
                spinfo.SP17    = dt.Rows[0][69].ToString();
                spinfo.SP18    = dt.Rows[0][70].ToString();
                spinfo.SP19    = dt.Rows[0][71].ToString();
                spinfo.SP20    = dt.Rows[0][72].ToString();
                spinfo.SP21    = dt.Rows[0][73].ToString();
                spinfo.SP22    = dt.Rows[0][74].ToString();
                spinfo.SP23    = dt.Rows[0][75].ToString();
                spinfo.SP24    = dt.Rows[0][76].ToString();
                spinfo.SP25    = dt.Rows[0][77].ToString();
                spinfo.SP26    = dt.Rows[0][78].ToString();
                spinfo.SP27    = dt.Rows[0][79].ToString();
                spinfo.SP28    = dt.Rows[0][80].ToString();
                spinfo.SP29    = dt.Rows[0][81].ToString();
                spinfo.SP30    = dt.Rows[0][82].ToString();
                spinfo.SP31    = dt.Rows[0][83].ToString();
                spinfo.SP32    = dt.Rows[0][84].ToString();
                spinfo.SP33    = dt.Rows[0][85].ToString();
                spinfo.SP34    = dt.Rows[0][86].ToString();
                spinfo.SP35    = dt.Rows[0][87].ToString();
                spinfo.SP36    = dt.Rows[0][88].ToString();
                spinfo.SP37    = dt.Rows[0][89].ToString();
                spinfo.SP38    = dt.Rows[0][90].ToString();
                spinfo.SP39    = dt.Rows[0][91].ToString();
                spinfo.SP40    = dt.Rows[0][92].ToString();
                spinfo.SP41    = dt.Rows[0][93].ToString();
                spinfo.YinHNum = dt.Rows[0][94].ToString();


                xfinfo.ManagerName   = dt.Rows[0][95].ToString();
                xfinfo.XFTelephone   = dt.Rows[0][96].ToString();
                xfinfo.HasSafeSystem = dt.Rows[0][97].ToString();
                xfinfo.DianXiaoJian  = dt.Rows[0][98].ToString();
                xfinfo.HasSafeBook   = dt.Rows[0][99].ToString();

                AddCompanyInfo companydlg = new AddCompanyInfo(baseinfo, educationinfo, foodinfo, jtinfo, ldinfo, spinfo, xfinfo);
                companydlg.ShowDialog();
            }
            catch
            {
            }
        }
        public CVModel GenerateTestData()
        {
            ContactInfo contactInfo = new ContactInfo()
            {
                Items = new List <ContactInfoItem>()
                {
                    new ContactInfoItem()
                    {
                        {
                            ContactInfoItem.FirstName, new Field()
                            {
                                Id        = 1,
                                Label     = "First name",
                                Type      = FieldTypes.SingleLiner,
                                Mandatory = true
                            }
                        },
                        {
                            ContactInfoItem.LastName, new Field()
                            {
                                Id        = 2,
                                Label     = "Last name",
                                Type      = FieldTypes.SingleLiner,
                                Mandatory = true
                            }
                        },
                        {
                            ContactInfoItem.Email, new Field()
                            {
                                Id        = 4,
                                Label     = "Email",
                                Type      = FieldTypes.SingleLiner,
                                Mandatory = true
                            }
                        },
                        {
                            ContactInfoItem.Address, new Field()
                            {
                                Id        = 5,
                                Label     = "Address",
                                Type      = FieldTypes.SingleLiner,
                                Mandatory = false
                            }
                        },
                        {
                            ContactInfoItem.Phone, new Field()
                            {
                                Id        = 6,
                                Label     = "Phone",
                                Type      = FieldTypes.Tel,
                                Mandatory = true
                            }
                        },
                        {
                            ContactInfoItem.Facebook, new Field()
                            {
                                Id        = 7,
                                Label     = "Facebook",
                                Type      = FieldTypes.SingleLiner,
                                Mandatory = false
                            }
                        }
                    }
                }
            };
            PersonalInfo personalInfo = new PersonalInfo()
            {
                Items = new List <PersonalInfoItem>()
                {
                    new PersonalInfoItem()
                    {
                        {
                            PersonalInfoItem.Photo, new Field()
                            {
                                Id    = 1,
                                Label = "Nuotrauka",
                                //Reik image, bet dar neveikia
                                Type      = FieldTypes.File,
                                Mandatory = false
                            }
                        },
                        {
                            PersonalInfoItem.Summary, new Field()
                            {
                                Id    = 2,
                                Label = "Summary",
                                //Reik multilane, bet dar neveikia
                                Type      = FieldTypes.MultiLiner,
                                Mandatory = false
                            }
                        },
                        {
                            PersonalInfoItem.Interest, new Field()
                            {
                                Id    = 3,
                                Label = "Personal internals",
                                //Reik multilane, bet dar neveikia
                                Type      = FieldTypes.MultiLiner,
                                Mandatory = false
                            }
                        },
                        {
                            PersonalInfoItem.DateOfBirth, new Field()
                            {
                                Id        = 4,
                                Label     = "Date of birth",
                                Type      = FieldTypes.Date,
                                Mandatory = true
                            }
                        }
                    }
                }
            };
            CareerInfo careerInfo = new CareerInfo()
            {
                Items = new List <CareerInfoItem>()
                {
                    new CareerInfoItem()
                    {
                        //Reikia suglaovti, kaip teisingai lesiti ivesti pvz 3 darbovietes
                        {
                            CareerInfoItem.Start, new Field()
                            {
                                Id = 1,
                                //Jauciu, kaip Text paliksim, tik gal pasiūlysim pavyzdį duomenų įvedimo xxxx-xxxx
                                Label     = "Year interval begining",
                                Type      = FieldTypes.Date,
                                Mandatory = false
                            }
                        },
                        {
                            CareerInfoItem.End, new Field()
                            {
                                Id = 1,
                                //Jauciu, kaip Text paliksim, tik gal pasiūlysim pavyzdį duomenų įvedimo xxxx-xxxx
                                Label     = "Year interval ending",
                                Type      = FieldTypes.Date,
                                Mandatory = false
                            }
                        },
                        {
                            CareerInfoItem.CompanyName, new Field()
                            {
                                Id        = 2,
                                Label     = "Company name",
                                Type      = FieldTypes.SingleLiner,
                                Mandatory = false
                            }
                        },
                        {
                            CareerInfoItem.JobTitle, new Field()
                            {
                                Id        = 3,
                                Label     = "Job title",
                                Type      = FieldTypes.SingleLiner,
                                Mandatory = false
                            }
                        },
                        {
                            CareerInfoItem.Description, new Field()
                            {
                                Id = 4,
                                //Reik multilane, bet dar neveikia
                                Label     = "Description",
                                Type      = FieldTypes.MultiLiner,
                                Mandatory = false
                            }
                        }
                    }
                }
            };
            EducationInfo educationInfo = new EducationInfo()
            {
                Items = new List <EducationInfoItem>()
                {
                    new EducationInfoItem()
                    {
                        //Reikia vesti skaicius nuo 0 iki 100
                        {
                            EducationInfoItem.Duration, new Field()
                            {
                                Id    = 1,
                                Label = "Duration",
                                //Jauciu, kaip Text paliksim, tik gal pasiūlysim pavyzdį duomenų įvedimo xxxx-xxxx
                                Type      = FieldTypes.SingleLiner,
                                Mandatory = false
                            }
                        },
                        {
                            EducationInfoItem.End, new Field()
                            {
                                Id    = 1,
                                Label = "Year interval ending",
                                //Jauciu, kaip Text paliksim, tik gal pasiūlysim pavyzdį duomenų įvedimo xxxx-xxxx
                                Type      = FieldTypes.Date,
                                Mandatory = false
                            }
                        },
                        {
                            EducationInfoItem.Course, new Field()
                            {
                                Id        = 2,
                                Label     = "Course",
                                Type      = FieldTypes.SingleLiner,
                                Mandatory = false
                            }
                        },
                        {
                            EducationInfoItem.Institution, new Field()
                            {
                                Id        = 3,
                                Label     = "Name of institution",
                                Type      = FieldTypes.SingleLiner,
                                Mandatory = false
                            }
                        }
                    }
                }
            };
            SkillsInfo skillsInfo = new SkillsInfo()
            {
                Items = new List <SkillsInfoItem>()
                {
                    new SkillsInfoItem()
                    {
                        {
                            SkillsInfoItem.Skill, new Field()
                            {
                                Id    = 1,
                                Label = "Enter your skill",
                                //Reik apibrezt,kad nuo 0 iki 100
                                Type      = FieldTypes.SingleLiner,
                                Mandatory = false
                            }
                        }
                    }
                }
            };

            CVModel CV = new CVModel();

            CV.ContactInfo   = contactInfo;
            CV.CareerInfo    = careerInfo;
            CV.EducationInfo = educationInfo;
            CV.PersonalInfo  = personalInfo;
            CV.SkillsInfo    = skillsInfo;
            CV.FormTarget    = "/Builder/GenerateDocument";


            return(CV);
        }
 public void DeleteEducationInfo(EducationInfo educationInfo)
 {
     educationInfoRepository.Delete(educationInfo);
 }
 public void UpdateEducationInfo(EducationInfo educationInfo)
 {
     educationInfoRepository.Update(educationInfo);
 }
 public void CreateEducationInfo(EducationInfo educationInfo)
 {
     educationInfoRepository.Add(educationInfo);
 }
Пример #28
0
        public async Task <EducationViewModel <SaveEducationResource> > CreateEducation(CreateEducationResource educationObj)
        {
            model.AppResult.Result = false;
            // Validate CollegeName, Major
            if (string.IsNullOrEmpty(educationObj.CollegeName) ||
                string.IsNullOrEmpty(educationObj.Major) ||
                educationObj.Major.Length > 255 ||
                educationObj.CollegeName.Length > 255)
            {
                model.AppResult.Message = "CollegeName/Major invalid";
                return(model);
            }
            // Validate Start/End Date
            if (!Functions.ValidateInputTime(educationObj.StartDate, educationObj.EndDate))
            {
                model.AppResult.Message = Constant.DATETIME_ERROR;
                return(model);
            }
            // Validate PersonId
            var taskValidPeronId = await _educationRepository.ValidatePersonIdAsync(educationObj.PersonId);

            if (taskValidPeronId < 1)
            {
                model.AppResult.Message = Constant.PERSONID_ERROR;
                return(model);
            }

            // Define DateTime.Year = "1111" is null
            var valueStartDate = Functions.ConvertDateTime(educationObj.StartDate);
            var valueEndDate   = Functions.ConvertDateTime(educationObj.EndDate);
            // Find maximum value of OrderIndex
            int maximumOrderIndex = await _educationRepository.MaximumOrderIndexAsync(educationObj.PersonId);

            maximumOrderIndex = (maximumOrderIndex <= 0) ? 1 : maximumOrderIndex + 1;
            // Insert info into temporary model
            var tempEducationInfo = new EducationInfo()
            {
                CollegeName = Regex.Replace(educationObj.CollegeName.Trim(), @"\s{2,}", " "),
                Major       = Regex.Replace(educationObj.Major.Trim(), @"\s{2,}", " "),
                StartDate   = valueStartDate,
                EndDate     = (valueEndDate.Year == 1111) ? (DateTime?)null : valueEndDate, // Define DateTime.Year = "1111" is null
                PersonId    = educationObj.PersonId,
                UpdatedBy   = null,
                UpdatedAt   = null,
                CreatedBy   = Helpers.HttpContext.CurrentUser,
                CreatedAt   = DateTime.Now,
                Status      = true,
                OrderIndex  = maximumOrderIndex
            };
            var tempEducationInfoId = await _educationRepository.InsertAsync(tempEducationInfo);

            // Set response to FE
            model.ObjModel.Id          = tempEducationInfoId;
            model.ObjModel.OrderIndex  = tempEducationInfo.OrderIndex;
            model.ObjModel.CollegeName = tempEducationInfo.CollegeName;
            model.ObjModel.Major       = tempEducationInfo.Major;
            model.ObjModel.StartDate   = tempEducationInfo.StartDate.Year.ToString();
            model.ObjModel.EndDate     = (tempEducationInfo.EndDate is null) ? string.Empty : string.Format(tempEducationInfo.EndDate?.Year.ToString());

            model.AppResult.Result     = true;
            model.AppResult.Message    = Constant.INSERT_SUCCESS;
            model.AppResult.DataResult = model.ObjModel;

            return(model);
        }