示例#1
0
        private void Insert()
        {
            try
            {
                var makerPosition     = string.Empty;
                var currentDepartment = string.Empty;
                if (hdfIsMakerPosition.Text == @"0")
                {
                    makerPosition = cbxMakerPosition.Text;
                }
                else
                {
                    makerPosition = cbxMakerPosition.SelectedItem.Text;
                }
                if (hdfIsCurrentDepartment.Text == @"0")
                {
                    currentDepartment = cbxCurrentDepartment.Text;
                }
                else
                {
                    currentDepartment = cbxCurrentDepartment.SelectedItem.Text;
                }

                var business = new hr_BusinessHistory
                {
                    DecisionNumber    = txtDecisionNumber.Text.Trim(),
                    DecisionDate      = dfDecisionDate.SelectedDate,
                    DecisionMaker     = txtDecisionMaker.Text.Trim(),
                    ExpireDate        = dfExpireDate.SelectedDate,
                    ShortDecision     = txtShortDecision.Text,
                    CurrentPosition   = txtCurrentPosition.Text,
                    CurrentDepartment = currentDepartment.TrimStart('-'),
                    DecisionPosition  = makerPosition,
                    BusinessType      = hdfBusinessType.Text,
                    CreatedDate       = DateTime.Now,
                    EditedDate        = DateTime.Now,
                    Description       = txtDescription.Text.Trim()
                };
                if (!string.IsNullOrEmpty(hdfChonCanBo.Text))
                {
                    business.RecordId = int.Parse("0" + hdfChonCanBo.Text);
                }
                // upload file
                var path = string.Empty;
                if (fufTepTinDinhKem.HasFile)
                {
                    string directory = Server.MapPath("../");
                    path = UploadFile(fufTepTinDinhKem, Constant.PathAttachFile);
                }

                business.FileScan = path != "" ? path : hdfTepTinDinhKem.Text;

                hr_BusinessHistoryServices.Create(business);
                gridMoveTo.Reload();
            }
            catch (Exception e)
            {
                Dialog.Alert("Có lỗi xảy ra trong quá trình thêm mới: {0}".FormatWith(e.Message));
            }
        }
示例#2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="obj"></param>
        public void Update(hr_BusinessHistory obj)
        {
            var record = hr_BusinessHistoryServices.GetById(obj.Id);

            if (record == null)
            {
                return;
            }
            record.RecordId              = obj.RecordId;
            record.Id                    = obj.Id;
            record.DecisionDate          = obj.DecisionDate;
            record.DecisionMaker         = obj.DecisionMaker;
            record.DecisionNumber        = obj.DecisionNumber;
            record.DecisionPosition      = obj.DecisionPosition;
            record.ShortDecision         = obj.ShortDecision;
            record.EffectiveDate         = obj.EffectiveDate;
            record.ExpireDate            = obj.ExpireDate;
            record.Description           = obj.Description;
            record.CurrentPosition       = obj.CurrentPosition;
            record.CurrentDepartment     = obj.CurrentDepartment;
            record.OldPosition           = obj.OldPosition;
            record.OldDepartment         = obj.OldDepartment;
            record.NewPosition           = obj.NewPosition;
            record.SourceDepartment      = obj.SourceDepartment;
            record.DestinationDepartment = obj.DestinationDepartment;
            record.FileScan              = obj.FileScan;
            record.BusinessType          = obj.BusinessType;
            record.EmulationTitle        = obj.EmulationTitle;
            record.Money                 = obj.Money;
            hr_BusinessHistoryServices.Update(record);
        }
示例#3
0
        public BusinessHistoryModel(hr_BusinessHistory business)
        {
            _businessHistory = business ?? new hr_BusinessHistory();

            RecordId              = _businessHistory.RecordId;
            Id                    = _businessHistory.Id;
            DecisionDate          = _businessHistory.DecisionDate;
            DecisionMaker         = _businessHistory.DecisionMaker;
            DecisionNumber        = _businessHistory.DecisionNumber;
            DecisionPosition      = _businessHistory.DecisionPosition;
            ShortDecision         = _businessHistory.ShortDecision;
            EffectiveDate         = _businessHistory.EffectiveDate;
            ExpireDate            = _businessHistory.ExpireDate;
            LeaveDate             = _businessHistory.LeaveDate;
            LeaveProject          = _businessHistory.LeaveProject;
            Description           = _businessHistory.Description;
            CurrentPosition       = _businessHistory.CurrentPosition;
            CurrentDepartment     = _businessHistory.CurrentDepartment;
            OldPosition           = _businessHistory.OldPosition;
            OldDepartment         = _businessHistory.OldDepartment;
            NewPosition           = _businessHistory.NewPosition;
            SourceDepartment      = _businessHistory.SourceDepartment;
            DestinationDepartment = _businessHistory.DestinationDepartment;
            FileScan              = _businessHistory.FileScan;
            BusinessType          = _businessHistory.BusinessType;
            EmulationTitle        = _businessHistory.EmulationTitle;
            Money                 = _businessHistory.Money;
            PlanJobTitleId        = _businessHistory.PlanJobTitleId;
            PlanPhaseId           = _businessHistory.PlanPhaseId;
        }
        /// <summary>
        ///
        /// </summary>
        private void Insert()
        {
            try
            {
                var makerPosition  = hdfIsMakerPosition.Text == @"0" ? cbxMakerPosition.Text : cbxMakerPosition.SelectedItem.Text;
                var destDepartment = hdfIsDestDepartment.Text == @"0" ? cbxDestDepartment.Text : cbxDestDepartment.SelectedItem.Text;

                var business = new hr_BusinessHistory
                {
                    DecisionNumber        = txtDecisionNumber.Text.Trim(),
                    DecisionDate          = dfDecisionDate.SelectedDate,
                    DecisionMaker         = txtDecisionMaker.Text.Trim(),
                    SourceDepartment      = txtSourceDepartment.Text,
                    ShortDecision         = txtShortDecision.Text,
                    CurrentPosition       = txtCurrentPosition.Text,
                    CurrentDepartment     = txtCurrentDepartment.Text,
                    EmulationTitle        = txtEmulationTitle.Text,
                    DestinationDepartment = destDepartment.TrimStart('-'),
                    DecisionPosition      = makerPosition,
                    BusinessType          = hdfBusinessType.Text,
                    CreatedDate           = DateTime.Now,
                    EditedDate            = DateTime.Now,
                    Description           = txtDescription.Text.Trim()
                };
                if (!string.IsNullOrEmpty(txtMoney.Text))
                {
                    business.Money = double.Parse("0" + txtMoney.Text);
                }
                if (!string.IsNullOrEmpty(hdfChonCanBo.Text))
                {
                    business.RecordId = int.Parse("0" + hdfChonCanBo.Text);
                }
                // upload file
                var path = string.Empty;
                if (fufTepTinDinhKem.HasFile)
                {
                    // var directory = Server.MapPath("../");
                    path = UploadFile(fufTepTinDinhKem, Constant.PathAttachFile);
                }

                business.FileScan = path != "" ? path : hdfTepTinDinhKem.Text;

                hr_BusinessHistoryServices.Create(business);
                gridEmulation.Reload();
            }
            catch (Exception e)
            {
                Dialog.Alert("Có lỗi xảy ra trong quá trình thêm mới: {0}".FormatWith(e.Message));
            }
        }
示例#5
0
 /// <summary>
 /// edit data
 /// </summary>
 /// <param name="planJob"></param>
 private void EditData(hr_BusinessHistory planJob)
 {
     if (!string.IsNullOrEmpty(hdfEmployeeSelectedId.Text))
     {
         planJob.RecordId = Convert.ToInt32(hdfEmployeeSelectedId.Text);
     }
     if (!string.IsNullOrEmpty(hdfPlanJobTitleId.Text))
     {
         planJob.PlanJobTitleId = Convert.ToInt32(hdfPlanJobTitleId.Text);
     }
     if (!string.IsNullOrEmpty(hdfPlanPhaseId.Text))
     {
         planJob.PlanPhaseId = Convert.ToInt32(hdfPlanPhaseId.Text);
     }
 }
示例#6
0
        /// <summary>
        ///
        /// </summary>
        private void Insert()
        {
            var planJob = new hr_BusinessHistory()
            {
                BusinessType = hdfBusinessType.Text,
                CreatedBy    = CurrentUser.User.UserName,
                CreatedDate  = DateTime.Now
            };

            //Edit data
            EditData(planJob);

            //Create
            hr_BusinessHistoryServices.Create(planJob);
            //Reset
            ResetForm();
        }
示例#7
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="info"></param>
 public void Insert(hr_BusinessHistory info)
 {
     hr_BusinessHistoryServices.Create(info);
 }