Пример #1
0
 //GET: Association/EditWorkPlan/5
 public ActionResult EditWorkPlan(int Id, int idLogin)
 {
     this.ViewBag.Id = idLogin;
     workPlan        = employeeData.getWorkPlanById(Id);
     workPlan.Id     = Id;
     return(View(workPlan));
 }
Пример #2
0
        /// <summary>
        /// 获取年度计划详情
        /// </summary>
        /// <param name="wid"></param>
        /// <returns></returns>
        public WorkPlan GetWorkPlanDetial(int wid)
        {
            WorkPlan _result = new WorkPlan();

            try
            {
                //获取年度计划详情
                string      sql     = @"  select p.id,`year`,startTime,endTime,p.`name`,content,scale,address,addressCity,addressCityID,
                                addressProvince,addressProvinceID,workPlanTypeID ,t.`Name` workPlanTypeName
                                from de2_workplan as p
                                left join de2_workplantype as t on p.workPlanTypeID=t.id where p.id=@id";
                MySqlClient _Client = new MySqlClient();
                _result = _Client.ExecuteQuery <WorkPlan>(sql, new MySqlParameter("@id", wid)).FirstOrDefault();
                //获取联系人
                if (_result == null)
                {
                    return(_result);
                }
                _result.Contacts = GetWorkPlanContacts(wid);
            }
            catch (Exception ex)
            {
                LogFactory _LogFactory = new LogFactory(this.GetType());
                _LogFactory.CreateLog(LogType.Error, "获取年度计划详情", "GetWorkPlanDetial", ex);
            }
            return(_result);
        }
Пример #3
0
        //проверить и дописать
        public void UpdateWorkPlan(User user, WorkPlan workPlan)
        {
            var repUser = DataBase.UserRepository.Read(user.Id);

            repUser.WorkPlan = (WorkPlan)workPlan;
            DataBase.UserRepository.Update(repUser);
        }
Пример #4
0
        public ModelInvokeResult <WorkPlanPK> Create(WorkPlan workPlan)
        {
            ModelInvokeResult <WorkPlanPK> result = new ModelInvokeResult <WorkPlanPK> {
                Success = true
            };

            try
            {
                List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>();
                if (workPlan.PlanId == GlobalManager.GuidAsAutoGenerate)
                {
                    workPlan.PlanId = Guid.NewGuid();
                }
                /***********************begin 自定义代码*******************/
                workPlan.OperatedBy = NormalSession.UserId.ToGuid();
                workPlan.OperatedOn = DateTime.Now;
                /***********************end 自定义代码*********************/
                statements.Add(new IBatisNetBatchStatement {
                    StatementName = workPlan.GetCreateMethodName(), ParameterObject = workPlan.ToStringObjectDictionary(false), Type = SqlExecuteType.INSERT
                });
                /***********************begin 自定义代码*******************/
                /***********************此处添加自定义代码*****************/
                /***********************end 自定义代码*********************/
                BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements);
                result.instance = new WorkPlanPK {
                    PlanId = workPlan.PlanId
                };
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
Пример #5
0
        public async Task <bool> UpdateWorkPlan(DTOWorkPlan workPlan)
        {
            WorkPlan mapWorkPlan = _mapper.Map <WorkPlan>(workPlan);

            _workPlanRepository.Update(mapWorkPlan);

            bool success = true;

            try
            {
                await _workPlanRepository.SaveChanges();
            }
            catch
            {
                if (!_workPlanRepository.WorkPlanExists(workPlan.WorkPlanID))
                {
                    success = false;
                }
                else
                {
                    throw;
                }
            }

            return(success);
        }
Пример #6
0
    public void Initialize(uint difficulty)
    {
        currentDate = new System.DateTime(startYear, startMonth, 1);
        progress    = 0.0f;

        goalCell = Grid.grid.GetRandomCellID(1, 1);

        workPlan    = new WorkPlan();
        finances    = new Finances();
        simParam    = new SimulationParameters(difficulty);
        statEffects = new StatusEffects();

        onNewDay = null;

        // dayEvents = new List<ScenarioEvent>();
        // nightEvents = new List<ScenarioEvent>();

        StopAllCoroutines();
        workingAnimation = null;
        workingProcess   = null;
        nightProcess     = null;
        nightAnimation   = null;
        helperCounter    = 0;
        helperCounter2   = 0;

        workPlan.SetExcavationArea(Grid.grid.GetRandomCellID(), ControlManager.minVizFieldRadius);
    }
        /**
         * Método que atribui um tfc a um certo aluno recebido por parametro, sendo um RUC
         */
        public async Task <IActionResult> AtribuirTFCasRUC(int?id, int?studentId)
        {
            var      student  = _context.Student.FromSqlRaw("Select * from Student where StudentId = " + studentId).ToList().FirstOrDefault();
            WorkPlan workplan = _context.WorkPlan
                                .FromSqlRaw("Select * from WorkPlan as wp join Student as s on wp.PlanId = s.PlanIdFk where s.StudentNumber = " + student.StudentNumber)
                                .ToList().FirstOrDefault();
            var tfc = _context.Tfc.FromSqlRaw("Select * from Tfc where TfcId = " + id).ToList().FirstOrDefault();

            if (workplan == null || workplan.TfcType != tfc.TfcType)
            {
                return(NotFound());
            }
            var pedidoTfc = _context.TfcProposal.FromSqlRaw("Select * from TfcProposal where StudentNumber = " + student.StudentNumber).ToList().FirstOrDefault();

            try
            {
                workplan.TfcIdFk   = id;
                workplan.Confirmed = 1;
                if (pedidoTfc != null)
                {
                    _context.Remove(pedidoTfc);
                }
                _context.SaveChanges();
                Alert("Tfc Atribuido!", "O tfc selecionado foi atribuido a " + student.FirstName + " com sucesso!", NotificationType.success);
            }
            catch
            {
                Alert("Ocorreu um erro!", "Não foi possivel atribuir o tfc a " + student.FirstName + "!", NotificationType.error);
            }

            return(RedirectToAction("Index", "Teachers"));
        }
Пример #8
0
        private static void updateWorkPlan()
        {
            WorkPlanProider _Provider = new WorkPlanProider();
            WorkPlan        _WorkPlan = new WorkPlan();

            _WorkPlan.id                = 5;
            _WorkPlan.address           = "sd";
            _WorkPlan.addressCity       = "sdsd";
            _WorkPlan.addressCityID     = 1;
            _WorkPlan.addressProvince   = "sddd";
            _WorkPlan.addressProvinceID = 1;
            _WorkPlan.content           = "sddd";
            _WorkPlan.scale             = 10;
            _WorkPlan.startTime         = DateTime.Now;
            _WorkPlan.endTime           = DateTime.Now;
            _WorkPlan.workPlanTypeID    = 1;
            _WorkPlan.year              = "2017";
            _WorkPlan.name              = "工作计划3";
            WorkPlanContacts _WorkPlanContacts = new WorkPlanContacts();

            _WorkPlanContacts.id           = 2;
            _WorkPlanContacts.phone        = "13811961223";
            _WorkPlanContacts.statue       = "edit";
            _WorkPlanContacts.contactsName = "test2ee";
            _WorkPlan.Contacts.Add(_WorkPlanContacts);
            _Provider.UpdateWorkPlan(_WorkPlan);
        }
Пример #9
0
        protected override object GetEditObject()
        {
            if (_facade == null)
            {
                _facade = new MaterialFacade(this.DataProvider);
            }
            WorkPlan workPlan = this._facade.CreateNewWorkPlan();

            workPlan.PlanDate  = FormatHelper.TODateInt(this.txtdateDateEdit.Text);
            workPlan.BigSSCode = FormatHelper.CleanString(this.txtBigSSCodeGroupEdit.Text.Trim().ToUpper());
            workPlan.MoCode    = FormatHelper.PKCapitalFormat(FormatHelper.CleanString(this.txtMOCodeGroupEdit.Text, 40));
            workPlan.MoSeq     = Convert.ToDecimal(FormatHelper.CleanString(this.txtMOSeqEdit.Text.Trim().ToUpper()));

            workPlan = (WorkPlan)_facade.GetWorkPlan(workPlan.BigSSCode, workPlan.PlanDate, workPlan.MoCode, workPlan.MoSeq);
            if (workPlan == null)
            {
                return(null);
            }

            if (this.timePromiseTimeEdit.Text.Trim().Length > 0)
            {
                workPlan.PromiseTime = FormatHelper.TOTimeInt(this.timePromiseTimeEdit.Text);
            }

            return(workPlan);
        }
Пример #10
0
        /// <summary>
        /// 保存联系人
        /// </summary>
        /// <param name="Data">数据</param>
        /// <returns></returns>
        public bool SaveWorkPlanContacts(WorkPlan Data)
        {
            try
            {
                if (Data.Contacts == null || Data.Contacts.Count == 0)
                {
                    return(true);
                }
                var result = false;
                foreach (var item in Data.Contacts)
                {
                    switch (item.statue.ToLower())
                    {
                    case "add":
                        result = AddWorkPlanContacts(item, Data.id);
                        break;

                    case "edit":
                        result = UpdateWorkPlanContacts(item);
                        break;

                    case "del":
                        result = DelWorkPlanContacts(item.id);
                        break;
                    }
                }
                return(true);
            }
            catch (Exception ex)
            {
                LogFactory _LogFactory = new LogFactory(this.GetType());
                _LogFactory.CreateLog(LogType.Error, "保存联系人", "SaveWorkPlanContacts", ex);
                return(false);
            }
        }
Пример #11
0
 public static WorkPlan ChangeFromDto(WorkPlan plan, WorkPlan source)
 {
     plan.DeskGuaranteed  = source.DeskGuaranteed;
     plan.MaxOfficeDay    = source.MaxOfficeDay;
     plan.MinOfficeDay    = source.MinOfficeDay;
     plan.Plan            = source.Plan;
     plan.PlanDescription = source.PlanDescription;
     plan.Priority        = source.Priority;
     return(plan);
 }
Пример #12
0
        /**
         * Devolve o ficheiro de proposta de tfc externo
         */
        public async Task <FileResult> GetExternalProposalFile(int?StudentNumber)
        {
            WorkPlan workplan = _context.WorkPlan
                                .FromSqlRaw("Select * from WorkPlan as wp join Student as s on wp.PlanId = s.PlanIdFk where s.StudentNumber = " + StudentNumber)
                                .ToList().FirstOrDefault();
            string fileName = workplan.TfcType + "_" + StudentNumber + ".pdf";

            byte[] fileBytes = System.IO.File.ReadAllBytes(workplan.PlanFile);
            return(File(fileBytes, System.Net.Mime.MediaTypeNames.Application.Octet, fileName));
        }
Пример #13
0
 public async Task UpdateAsync(WorkPlan workPlan)
 {
     try
     {
         DataContext dataContext = new DataContext();
         dataContext.WorkPlans.Update(workPlan);
         await dataContext.SaveChangesAsync();
     } catch (Exception ex)
     {
         ClassLoger.Error("WorkPlanDal.UpdateAsync", ex);
     }
 }
        /**
         * Método que devolve a string to tipo de tfc de um certo estudante
         */
        public string GetTfcType(int studentId)
        {
            WorkPlan workplan = _context.WorkPlan.FromSqlRaw("Select * from WorkPlan as wp join Student as s on wp.PlanId = s.PlanIdFk where s.StudentNumber = " + studentId).ToList().FirstOrDefault();

            if (workplan == null)
            {
                return("");
            }
            else
            {
                var tfcTypeString = workplan.TfcType;
                return(tfcTypeString);
            }
        }
Пример #15
0
 public RunWorkPlan(
     DataSet dataSet,
     Cardinality cardinality,
     IndexType indexType,
     ReservationBufferSize reservationBufferSize,
     CacheSize cacheSize,
     Drive drive,
     CacheType cacheType,
     WorkPlan workPlan)
     : base(dataSet, cardinality, indexType, reservationBufferSize, cacheType, cacheSize)
 {
     Drive = drive;
     WorkPlan = workPlan;
 }
Пример #16
0
        protected override void UpdateDomainObject(object domainObject)
        {
            if (_facade == null)
            {
                _facade = new MaterialFacade(this.DataProvider);
            }

            WorkPlan workPlan = domainObject as WorkPlan;

            workPlan.MaterialStatus = MaterialWarningStatus.MaterialWarningStatus_Responsed;

            this._facade.UpdateWorkPlan(workPlan);
            this.RequestData();
        }
        public ActionResult formTfc(string TfcType)
        {
            var      studentNumber = int.Parse(User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.Name).Value.ToString());
            WorkPlan workplan      = _context.WorkPlan
                                     .FromSqlRaw("Select * from WorkPlan as wp join Student as s on wp.PlanId = s.PlanIdFk where s.StudentNumber = " + studentNumber)
                                     .ToList().FirstOrDefault();

            if (workplan == null)
            {
                using (SqlConnection scnConnection = new SqlConnection(ApplicationDbContext.ConnectionString))
                {
                    scnConnection.Open();
                    string strQuery = "Insert into WorkPlan(Confirmed, TfcType) values (0,@TfcType)";

                    SqlCommand scmCommand = new SqlCommand(strQuery, scnConnection);
                    scmCommand.Parameters.AddWithValue("@TfcType", TfcType);

                    scmCommand.ExecuteNonQuery();
                }
                var lastInsertId = _context.WorkPlan.Max(wp => wp.PlanId);
                using (SqlConnection scnConnection = new SqlConnection(ApplicationDbContext.ConnectionString))
                {
                    scnConnection.Open();
                    string strQuery = "Update Student Set PlanIdFk = @lastInsertId Where StudentNumber = @StudentId";

                    SqlCommand scmCommand = new SqlCommand(strQuery, scnConnection);
                    scmCommand.Parameters.AddWithValue("@lastInsertId", lastInsertId);
                    scmCommand.Parameters.AddWithValue("@StudentId", GetCurrentStudentID(User));

                    scmCommand.ExecuteNonQuery();
                }
            }
            else
            {
                using (SqlConnection scnConnection = new SqlConnection(ApplicationDbContext.ConnectionString))
                {
                    scnConnection.Open();
                    string strQuery = "Update WorkPlan Set TfcType = @TfcType Where PlanId = @PlanId";

                    SqlCommand scmCommand = new SqlCommand(strQuery, scnConnection);
                    scmCommand.Parameters.AddWithValue("@PlanId", workplan.PlanId);
                    scmCommand.Parameters.AddWithValue("@TfcType", TfcType);

                    scmCommand.ExecuteNonQuery();
                }
            }

            return(RedirectToAction("Perfil", "Students"));
        }
Пример #18
0
        public List <WorkPlan> UpdateWorkPlan(WorkPlan workPlan)
        {
            if (CheckNull(workPlan))
            {
                var updatedWorkPlan = DataBase.WorkPlanRepository.Read(workPlan.Id);
                if (CheckNull(updatedWorkPlan))
                {
                    DataBase.WorkPlanRepository.Update(WorkPlanChanger.ChangeFromDto(updatedWorkPlan, workPlan));
                    DataBase.Save();
                    return(GetWorkPlans());
                }
            }

            return(null);
        }
Пример #19
0
 public HttpResponseMessage AddWorkPlan([FromBody] WorkPlan Data)
 {
     try
     {
         WorkPlanProider _Provider = new WorkPlanProider();
         var             result    = _Provider.AddWorkPlan(Data);
         return(Request.CreateResponse(HttpStatusCode.OK, result));
     }
     catch (Exception ex)
     {
         LogFactory _LogFactory = new LogFactory(this.GetType());
         _LogFactory.CreateLog(LogType.Error, "新建工作计划", "AddWorkPlan", ex);
         return(Request.CreateResponse(HttpStatusCode.InternalServerError, ex.Message));
     }
 }
Пример #20
0
        /*UPDATE DOCUMENTS BY EMPLOYEE*/

        /// <summary>
        ///
        /// </summary>
        /// <param name="registryCode"></param>
        public void updateWorkPlan(WorkPlan workPlan)
        {
            string      queryWork   = null;
            Association association = new Association();

            using (SqlConnection sqlConnection = getConnection())
            {
                sqlConnection.Open();
                queryWork = "UPDATE WorkPlan SET assembly_date = '" + workPlan.AssemblyDate + "'" +
                            "WHERE WorkPlan.id_work = " + workPlan.Id;

                SqlCommand sqlWork = new SqlCommand(queryWork, sqlConnection);
                sqlWork.ExecuteNonQuery();
            }
        }
Пример #21
0
        public async Task <bool> DeleteWorkPlan(int id)
        {
            WorkPlan workPlan = await _workPlanRepository.Delete(id);

            if (workPlan == null)
            {
                return(false);
            }
            else
            {
                await _workPlanRepository.SaveChanges();

                return(true);
            }
        }
Пример #22
0
 public ActionResult EditWorkPlan(int Id, string assemblyDate, int idLogin)
 {
     try
     {
         this.ViewBag.Id = idLogin;
         WorkPlan workPlan = new WorkPlan(Id, assemblyDate);
         employeeData.updateWorkPlan(workPlan);
         employeeData.insertBitacora(idLogin, "Modifico una asociacion");
         return(RedirectToAction("Search", "Employee", new { loginUser = idLogin }));
     }
     catch
     {
         return(View());
     }
 }
Пример #23
0
        // Нажатие кнопки "Добавить"
        private void addWorkPlan(object sender, RoutedEventArgs e)
        {
            string[] fio         = ((string)teacherNameComboBox.SelectedValue).Split();
            string   _firstname  = fio[0];
            string   _lastname   = fio[1];
            string   _middlename = fio[2];

            // Создаём новый рабочий план
            WorkPlan newWorkPlan = new WorkPlan();

            newWorkPlan.idTeacher = db.teacher
                                    .Where(item => item.lastname == _firstname &&
                                           item.firstname == _lastname &&
                                           item.middlename == _middlename)
                                    .Select(item => item.id)
                                    .Single();
            newWorkPlan.idSubject = db.subject
                                    .Where(item => item.subjectName == (string)subjectNameComboBox.SelectedValue)
                                    .Select(item => item.id)
                                    .First();
            newWorkPlan.beginDate      = ((DateTime)beginDate.SelectedDate).ToString("D");
            newWorkPlan.endDate        = ((DateTime)endDate.SelectedDate).ToString("D");
            newWorkPlan.lecturesTime   = (int)lecturesTime.Value;
            newWorkPlan.practiceTime   = (int)practiceTime.Value;
            newWorkPlan.laboratoryTime = (int)laboratoryTime.Value;
            newWorkPlan.description    = descriptionTextBox.Text;

            // Добавляем созданный план
            db.workPlan.Add(newWorkPlan);

            try
            {
                db.SaveChanges();   // Пытаемся сохранить изменения
                this.Close();       // Закрываем окно, в случае успеха
            }
            catch (Exception error)
            {
                errorTextBox.Visibility = System.Windows.Visibility.Visible; // Показываем текстовое поле
                errorTextBox.Text       = error.Message;                     // с текстом ошибки
                errorTextBox.Focus();                                        // устанавливаем фокус на это поле
                db.workPlan.Remove(newWorkPlan);                             // Удаляем созданный рабочий план из списка
            }
            finally
            {
                newWorkPlan = null;                             // Удаляем рабочий план
            }
        }
        public string UpdateTest_TestCase(IList <WorkPlan> workPlans)
        {
            SetUp(workPlans);
            var workPlan = new WorkPlan()
            {
                Id              = 1,
                DeskGuaranteed  = true,
                MaxOfficeDay    = 30,
                MinOfficeDay    = 12,
                Plan            = "Test plan",
                PlanDescription = "desc",
                Priority        = 1
            };
            var result = _adminService.UpdateWorkPlan(workPlan);

            return(result?.Find(x => x.Id == workPlan.Id)?.Plan);
        }
        public ModelInvokeResult <WorkPlanPK> Update(string strPlanId, WorkPlan workPlan)
        {
            ModelInvokeResult <WorkPlanPK> result = new ModelInvokeResult <WorkPlanPK> {
                Success = true
            };

            try
            {
                List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>();
                Guid?_PlanId = strPlanId.ToGuid();
                if (_PlanId == null)
                {
                    result.Success   = false;
                    result.ErrorCode = 59996;
                    return(result);
                }
                workPlan.PlanId = _PlanId;
                /***********************begin 自定义代码*******************/
                workPlan.OperatedBy = NormalSession.UserId.ToGuid();
                workPlan.OperatedOn = DateTime.Now;
                /***********************end 自定义代码*********************/
                statements.Add(new IBatisNetBatchStatement {
                    StatementName = workPlan.GetUpdateMethodName(), ParameterObject = workPlan.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE
                });
                /***********************begin 自定义代码*******************/
                /***********************此处添加自定义代码*****************/
                /***********************end 自定义代码*********************/
                BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements);
                result.instance = new WorkPlanPK {
                    PlanId = _PlanId
                };
                if (result.Success)
                {
                    SPParam spParam = new { }.ToSPParam();
                    spParam["OldManId"]  = workPlan.OldManId;
                    spParam["BatchFlag"] = 0;
                    BuilderFactory.DefaultBulder().ExecuteSPNoneQuery("SP_Pam_GenDailyWorkExcute", spParam);
                }
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
Пример #26
0
        protected override void UpdateDomainObject(object domainObject)
        {
            if (_Facade == null)
            {
                _Facade = new MaterialFacade(base.DataProvider);
            }

            WorkPlan workPlan = domainObject as WorkPlan;

            if (decimal.Parse(this.txtPlanInQTYEdit.Text) < decimal.Parse(this.txtActQty.Text))
            {
                WebInfoPublish.Publish(this, "$planqty_isnotequ_actqty", languageComponent1);
                return;
            }

            this._Facade.UpdateWorkPlan((WorkPlan)domainObject);
        }
Пример #27
0
        private void GetImportObjectType(ref object obj, string importType)
        {
            if (obj == null)
            {
                return;
            }

            DBDateTime now = FormatHelper.GetNowDBDateTime(this._DataProvider);

            switch (importType.ToUpper())
            {
            case "WORKPLAN":
                if (_MOFacade == null)
                {
                    _MOFacade = new MOFacade(_DataProvider);
                }

                WorkPlan workPlan = obj as WorkPlan;
                workPlan.MaintainUser   = _UserCode;
                workPlan.MaintainDate   = now.DBDate;
                workPlan.MaintainTime   = now.DBTime;
                workPlan.ActionStatus   = WorkPlanActionStatus.WorkPlanActionStatus_Init;
                workPlan.MaterialStatus = MaterialWarningStatus.MaterialWarningStatus_No;
                object mo = _MOFacade.GetMO(FormatHelper.PKCapitalFormat(FormatHelper.CleanString(workPlan.MoCode)));
                workPlan.ItemCode = ((MO)mo).ItemCode;

                break;

            case "MATERIALNEED":
                MaterialReqStd materialReqStd = obj as MaterialReqStd;
                materialReqStd.MaintainUser = _UserCode;
                materialReqStd.MaintainDate = now.DBDate;
                materialReqStd.MaintainTime = now.DBTime;
                break;

            case "PLANWORKTIME":
                PlanWorkTime planWorkTime = obj as PlanWorkTime;
                planWorkTime.MaintainUser = _UserCode;
                planWorkTime.MaintainDate = now.DBDate;
                planWorkTime.MaintainTime = now.DBTime;
                break;

            default:
                break;
            }
        }
        public ModelInvokeResult <WorkPlanPK> Nullify(string strPlanId)
        {
            ModelInvokeResult <WorkPlanPK> result = new ModelInvokeResult <WorkPlanPK> {
                Success = true
            };

            try
            {
                List <IBatisNetBatchStatement> statements = new List <IBatisNetBatchStatement>();
                Guid?_PlanId = strPlanId.ToGuid();
                if (_PlanId == null)
                {
                    result.Success   = false;
                    result.ErrorCode = 59996;
                    return(result);
                }
                WorkPlan workPlan = new WorkPlan {
                    PlanId = _PlanId, Status = 0
                };
                /***********************begin 自定义代码*******************/
                workPlan.OperatedBy = NormalSession.UserId.ToGuid();
                workPlan.OperatedOn = DateTime.Now;
                /***********************end 自定义代码*********************/
                statements.Add(new IBatisNetBatchStatement {
                    StatementName = workPlan.GetUpdateMethodName(), ParameterObject = workPlan.ToStringObjectDictionary(false), Type = SqlExecuteType.UPDATE
                });
                /***********************begin 自定义代码*******************/
                /***********************此处添加自定义代码*****************/
                /***********************end 自定义代码*********************/
                BuilderFactory.DefaultBulder().ExecuteNativeSqlNoneQuery(statements);
                result.instance = new WorkPlanPK {
                    PlanId = _PlanId
                };
                if (result.Success)
                {
                    OldManMappingServeManRemove(strPlanId);
                }
            }
            catch (Exception ex)
            {
                result.Success      = false;
                result.ErrorMessage = ex.Message;
            }
            return(result);
        }
Пример #29
0
        public async Task <int> AddAsync(WorkPlan workPlan)
        {
            int id = 0;

            try
            {
                DataContext dataContext = new DataContext();
                var         info        = await dataContext.WorkPlans.AddAsync(workPlan);

                await dataContext.SaveChangesAsync();

                id = info.Entity.ID;
            } catch (Exception ex)
            {
                ClassLoger.Error("WorkPlanDal.AddAsync", ex);
            }
            return(id);
        }
Пример #30
0
        public async Task <bool> AddWorkPlan(DTOWorkPlan workPlan)
        {
            WorkPlan mapWorkPlan = _mapper.Map <WorkPlan>(workPlan);

            _workPlanRepository.Add(mapWorkPlan);
            bool success = true;

            try
            {
                await _workPlanRepository.SaveChanges();
            }
            catch
            {
                success = false;
            }

            return(success);
        }
Пример #31
0
 public CreateWorkPlanForm(WorkPlan _plan)
 {
     InitializeComponent();
     plan = _plan;
     TextBoxJanuary.Text      = plan.january.ToString();
     TextBoxFebruary.Text     = plan.february.ToString();
     TextBoxMarch.Text        = plan.march.ToString();
     TextBoxApril.Text        = plan.april.ToString();
     TextBoxMay.Text          = plan.may.ToString();
     TextBoxJune.Text         = plan.june.ToString();
     TextBoxJule.Text         = plan.july.ToString();
     TextBoxAugust.Text       = plan.august.ToString();
     TextBoxSeptember.Text    = plan.september.ToString();
     TextBoxOctober.Text      = plan.october.ToString();
     TextBoxNovember.Text     = plan.november.ToString();
     TextBoxDecember.Text     = plan.december.ToString();
     DateTimePickerYear.Value = plan.year;
 }
Пример #32
0
 protected virtual String GetWorkPlan(WorkPlan wp)
 {
     if (wp == WorkPlan.Large) return "90";
     else if (wp == WorkPlan.Medium) return "60";
     else if (wp == WorkPlan.Small) return "30";
     else throw new Exception();
 }