//public static bool Update(WorkerLeaveModel model)
        //{
        //    SaovietCheckInEntities db = new SaovietCheckInEntities();
        //    var @WorkerLeaveId = new SqlParameter("@WorkerLeaveId", model.WorkerLeaveId);
        //    var @WorkerId = new SqlParameter("@WorkerId", model.WorkerId);
        //    var @StartDate = new SqlParameter("@StartDate", model.StartDate);
        //    var @EndDate = new SqlParameter("@EndDate", model.EndDate);
        //    var @LeaveType = new SqlParameter("@LeaveType", model.LeaveType);
        //    if (db.ExecuteStoreCommand("EXEC spm_UpdateWorkerLeave_1 @WorkerLeaveId, @WorkerId, @StartDate, @EndDate, @LeaveType", @WorkerLeaveId, @WorkerId, @StartDate, @EndDate, @LeaveType) > 0)
        //    {
        //        return true;
        //    }
        //    return false;
        //}

        public static bool Delete(int id)
        {
            SaovietCheckInEntities db = new SaovietCheckInEntities();
            var @SpecialTransferId    = new SqlParameter("@SpecialTransferId", id);

            if (db.ExecuteStoreCommand("EXEC spm_DeleteSpecialTransfer @SpecialTransferId", @SpecialTransferId) > 0)
            {
                return(true);
            }
            return(false);
        }
        public static bool Delete(int workerLeaveId)
        {
            SaovietCheckInEntities db = new SaovietCheckInEntities();
            var @WorkerLeaveId        = new SqlParameter("@WorkerLeaveId", workerLeaveId);

            if (db.ExecuteStoreCommand("EXEC spm_DeleteWorkerLeave @WorkerLeaveId", @WorkerLeaveId) > 0)
            {
                return(true);
            }
            return(false);
        }
        public static bool Delete(string patternNo)
        {
            var @PatternNo            = new SqlParameter("@PatternNo", patternNo);
            SaovietCheckInEntities db = new SaovietCheckInEntities();

            if (db.ExecuteStoreCommand("EXEC spm_DeleteAssemblyIncentive @PatternNo", @PatternNo) >= 1)
            {
                return(true);
            }
            return(false);
        }
Beispiel #4
0
        public static bool ChangeWorkerId(string workerId, string newWorkerId)
        {
            SaovietCheckInEntities db = new SaovietCheckInEntities();
            var @WorkerId             = new SqlParameter("@WorkerId", workerId);
            var @NewWorkerId          = new SqlParameter("@NewWorkerId", newWorkerId);

            if (db.ExecuteStoreCommand("spm_UpdateWorkerId @WorkerId, @NewWorkerId", @WorkerId, @NewWorkerId) > 0)
            {
                return(true);
            }
            return(false);
        }
Beispiel #5
0
        public static bool Insert(WorkerLoginModel model)
        {
            var @CardId               = new SqlParameter("@CardId", model.CardId);
            var @WorkerId             = new SqlParameter("@WorkerId", model.WorkerId);
            var @LineId               = new SqlParameter("@LineId", model.LineId);
            SaovietCheckInEntities db = new SaovietCheckInEntities();

            if (db.ExecuteStoreCommand("EXEC spm_InsertWorkerLogin @CardId,@WorkerId,@LineId", @CardId, @WorkerId, @LineId) >= 1)
            {
                return(true);
            }
            return(false);
        }
        public static bool Update(string lineId, DateTime requestTime, DateTime acceptedTime)
        {
            var @LineId       = new SqlParameter("@LineId", lineId);
            var @RequestTime  = new SqlParameter("@RequestTime", requestTime);
            var @AcceptedTime = new SqlParameter("@AcceptedTime", acceptedTime);

            SaovietCheckInEntities db = new SaovietCheckInEntities();

            if (db.ExecuteStoreCommand("EXEC spm_UpdateCieControlIncentive @LineId, @RequestTime,@AcceptedTime", @LineId, @RequestTime, @AcceptedTime) >= 1)
            {
                return(true);
            }
            return(false);
        }
        public static bool Insert(WorkerLeaveModel model)
        {
            SaovietCheckInEntities db = new SaovietCheckInEntities();
            var @WorkerId             = new SqlParameter("@WorkerId", model.WorkerId);
            var @StartDate            = new SqlParameter("@StartDate", model.StartDate);
            var @EndDate   = new SqlParameter("@EndDate", model.EndDate);
            var @LeaveType = new SqlParameter("@LeaveType", model.LeaveType);

            if (db.ExecuteStoreCommand("EXEC spm_InsertWorkerLeave_1 @WorkerId, @StartDate, @EndDate, @LeaveType", @WorkerId, @StartDate, @EndDate, @LeaveType) > 0)
            {
                return(true);
            }
            return(false);
        }
        public static bool Transfer(string lineId, DateTime date, string cardId, string workerId, string lineIdNew)
        {
            var @LineId               = new SqlParameter("@LineId", lineId);
            var @Date                 = new SqlParameter("@Date", date);
            var @CardId               = new SqlParameter("@CardId", cardId);
            var @WorkerId             = new SqlParameter("@WorkerId", workerId);
            var @LineIdNew            = new SqlParameter("@LineIdNew", lineIdNew);
            SaovietCheckInEntities db = new SaovietCheckInEntities();

            if (db.ExecuteStoreCommand("EXEC spm_TransferLineId @LineId,@Date,@CardId,@WorkerId,@LineIdNew", @LineId, @Date, @CardId, @WorkerId, @LineIdNew) >= 1)
            {
                return(true);
            }
            return(false);
        }
        public static bool Update(AssemblyIncentiveModel model)
        {
            var @Id             = new SqlParameter("@Id", model.Id);
            var @PatternNo      = new SqlParameter("@PatternNo", model.PatternNo);
            var @ShoeName       = new SqlParameter("@ShoeName", model.ShoeName);
            var @Efficiency     = new SqlParameter("@Efficiency", model.Efficiency);
            var @AssemblyOutput = new SqlParameter("@AssemblyOutput", model.AssemblyOutput);
            var @Incentive      = new SqlParameter("@Incentive", model.Incentive);

            SaovietCheckInEntities db = new SaovietCheckInEntities();

            if (db.ExecuteStoreCommand("EXEC spm_UpdateAssemblyIncentive @Id, @PatternNo, @ShoeName, @Efficiency, @AssemblyOutput, @Incentive", @Id, @PatternNo, @ShoeName, @Efficiency, @AssemblyOutput, @Incentive) >= 1)
            {
                return(true);
            }
            return(false);
        }
        public static bool Insert(CieControlIncentiveModel model)
        {
            var @WorkHrsBefore   = new SqlParameter("@WorkHrsBefore", model.WorkHrsBefore);
            var @WorkHrsAfter    = new SqlParameter("@WorkHrsAfter", model.WorkHrsAfter);
            var @IncentiveBefore = new SqlParameter("@IncentiveBefore", model.IncentiveBefore);
            var @IncentiveAfter  = new SqlParameter("@IncentiveAfter", model.IncentiveAfter);

            var @LineId      = new SqlParameter("@LineId", model.LineId);
            var @RequestTime = new SqlParameter("@RequestTime", model.RequestTime);
            var @Reason      = new SqlParameter("@Reason", model.Reason);

            SaovietCheckInEntities db = new SaovietCheckInEntities();

            if (db.ExecuteStoreCommand("EXEC spm_InsertCieControlIncentive @WorkHrsBefore, @WorkHrsAfter, @IncentiveBefore, @IncentiveAfter, @LineId, @RequestTime, @Reason", @WorkHrsBefore, @WorkHrsAfter, @IncentiveBefore, @IncentiveAfter, @LineId, @RequestTime, @Reason) >= 1)
            {
                return(true);
            }
            return(false);
        }
        //public static List<WorkerLeaveModel> Select(int year, int month)
        //{
        //    SaovietCheckInEntities db = new SaovietCheckInEntities();
        //    var @Year = new SqlParameter("@Year", year);
        //    var @Month = new SqlParameter("@Month", month);
        //    return db.ExecuteStoreQuery<WorkerLeaveModel>("EXEC spm_SelectWorkerLeaveByYearMonth @Year, @Month", @Year, @Month).ToList();
        //}

        public static bool Insert(List <SpecialTransferModel> modelList)
        {
            bool result = true;
            SaovietCheckInEntities db = new SaovietCheckInEntities();

            foreach (SpecialTransferModel model in modelList)
            {
                var @WorkerId          = new SqlParameter("@WorkerId", model.WorkerId);
                var @TransferType      = new SqlParameter("@TransferType", model.TransferType);
                var @DestinationLineId = new SqlParameter("@DestinationLineId", model.DestinationLineId);
                var @Date = new SqlParameter("@Date", model.Date);
                var @Time = new SqlParameter("@Time", model.Time);
                if (db.ExecuteStoreCommand("EXEC spm_InsertSpecialTransfer @WorkerId, @TransferType, @DestinationLineId, @Date, @Time", @WorkerId, @TransferType, @DestinationLineId, @Date, @Time) <= 0)
                {
                    result = false;
                }
            }
            return(result);
        }
        public static bool Insert(LinePerformanceDetailModel model)
        {
            var @LineId               = new SqlParameter("@LineId", model.LineId);
            var @Date                 = new SqlParameter("@Date", model.Date);
            var @CardId               = new SqlParameter("@CardId", model.CardId);
            var @WorkerId             = new SqlParameter("@WorkerId", model.WorkerId);
            var @OthersPosition       = new SqlParameter("@OthersPosition", model.OthersPosition);
            var @TimeOut              = new SqlParameter("@TimeOut", model.TimeOut);
            var @IncentiveGrade       = new SqlParameter("@IncentiveGrade", model.IncentiveGrade);
            var @Incentive            = new SqlParameter("@Incentive", model.Incentive);
            var @SpecsIncentive       = new SqlParameter("@SpecsIncentive", model.SpecsIncentive);
            var @ExcessIncentive      = new SqlParameter("@ExcessIncentive", model.ExcessIncentive);
            SaovietCheckInEntities db = new SaovietCheckInEntities();

            if (db.ExecuteStoreCommand("EXEC spm_InsertLinePerformanceDetail_1 @LineId,@Date,@CardId,@WorkerId,@OthersPosition,@TimeOut,@IncentiveGrade,@Incentive,@SpecsIncentive,@ExcessIncentive", @LineId, @Date, @CardId, @WorkerId, @OthersPosition, @TimeOut, @IncentiveGrade, @Incentive, @SpecsIncentive, @ExcessIncentive) >= 1)
            {
                return(true);
            }
            return(false);
        }
Beispiel #13
0
        public static bool Insert(LinePerformanceModel model)
        {
            var @LineId               = new SqlParameter("@LineId", model.LineId);
            var @Date                 = new SqlParameter("@Date", model.Date);
            var @Output               = new SqlParameter("@Output", model.Output);
            var @PatternNo            = new SqlParameter("@PatternNo", model.PatternNo);
            var @ArticleNo            = new SqlParameter("@ArticleNo", model.ArticleNo);
            var @IncentiveGradeA      = new SqlParameter("@IncentiveGradeA", model.IncentiveGradeA);
            var @ReportedWorkHour     = new SqlParameter("@ReportedWorkHour", model.ReportedWorkHour);
            var @IncentiveGradeASmall = new SqlParameter("@IncentiveGradeASmall", model.IncentiveGradeASmall);
            var @ExcessIncentive      = new SqlParameter("@ExcessIncentive", model.ExcessIncentive);
            var @QuotaTarget          = new SqlParameter("@QuotaTarget", model.QuotaTarget);
            SaovietCheckInEntities db = new SaovietCheckInEntities();

            if (db.ExecuteStoreCommand(@"EXEC spm_InsertLinePerformance_4 @LineId, @Date, @Output, @PatternNo, @ArticleNo, @IncentiveGradeA, @ReportedWorkHour, @IncentiveGradeASmall, @ExcessIncentive, @QuotaTarget",
                                       @LineId, @Date, @Output, @PatternNo, @ArticleNo, @IncentiveGradeA, @ReportedWorkHour, @IncentiveGradeASmall, @ExcessIncentive, @QuotaTarget) >= 1)
            {
                return(true);
            }
            return(false);
        }