public static int CreateEmptyCells(int SectionId, int TemplateId)
    {
        Period[] periods = Period.GetByTemplateId(TemplateId);

        for (int i = 1; i <= 6; i++)                           // 1--6  -->  Monday--Saturday
        {
            foreach (Period p in periods)
            {
                if (!WorkingHours.IsExists(i, SectionId, p.Id))
                {
                    WorkingHours wh = new WorkingHours(null, i, SectionId, p.Id);
                    wh.Save();
                }
            }
        }
        return periods.Length;
    }
        public void ReceiveWorkOrder(Resolver resolver)
        {
            IList<ReceiptDetail> receiptDetails = orderMgrE.ConvertTransformerToReceiptDetail(resolver.Transformers);
            //Receipt receipt = new Receipt();
            //foreach (Transformer transformer in resolver.Transformers)
            //{                
            //    ReceiptDetail receiptDetail = new ReceiptDetail();
            //    receiptDetail.OrderLocationTransaction = orderLocationTransactionMgrE.LoadOrderLocationTransaction(transformer.OrderLocTransId);
            //    receiptDetail.HuId = null;
            //    receiptDetail.ReceivedQty = transformer.CurrentQty;
            //    receiptDetail.RejectedQty = transformer.CurrentRejectQty;
            //    receiptDetail.ScrapQty = transformer.ScrapQty;
            //    receiptDetail.Receipt = receipt;
            //    receipt.AddReceiptDetail(receiptDetail);
            //}
            List<WorkingHours> workingHoursList = new List<WorkingHours>();
            foreach (string[] stringArray in resolver.WorkingHours)
            {
                WorkingHours workingHours = new WorkingHours();
                workingHours.Employee = employeeMgrE.LoadEmployee(stringArray[0]);
                workingHours.Hours = Convert.ToDecimal(stringArray[1]);
                workingHoursList.Add(workingHours);
            }

            Receipt receiptResult = orderMgrE.ReceiveOrder(receiptDetails, resolver.UserCode, null, null, workingHoursList, true, resolver.IsOddCreateHu);
            //(receiptDetailList, this.CurrentUser, null, null, null, true, isOddCreateHu);

            //OrderHead orderHead = orderHeadMgrE.LoadOrderHead(resolver.Code);
            IList<Hu> huList = new List<Hu>();
            IList<ReceiptDetail> receiptDetailList = receiptResult.ReceiptDetails;
            if (resolver.AutoPrintHu)
            {
                if (receiptDetailList == null || receiptDetailList.Count == 0)
                {
                    throw new BusinessErrorException("Inventory.Error.PrintHu.ReceiptDetail.Required");
                }
                foreach (ReceiptDetail receiptDetail in receiptDetailList)
                {
                    if (receiptDetail.HuId != null)
                    {
                        Hu hu = huMgrE.LoadHu(receiptDetail.HuId);
                        if (hu != null)
                        {
                            huList.Add(hu);
                        }
                    }
                }
                if (huList.Count > 0)
                {
                    IList<object> huDetailObj = new List<object>();
                    huDetailObj.Add(huList);
                    huDetailObj.Add(resolver.UserCode);
                    resolver.PrintUrl = reportMgrE.WriteToFile("BarCode.xls", huDetailObj, "BarCode.xls");
                }
            }
            resolver.Transformers = null;
            string huString = string.Empty;
            foreach (Hu hu in huList)
            {
                huString += " " + hu.HuId;
            }
            resolver.Result = languageMgrE.TranslateMessage("MasterData.WorkOrder.OrderHead.Receive.Successfully", resolver.UserCode, resolver.Code);
            if (huList.Count > 0)
            {
                resolver.Result += languageMgrE.TranslateMessage("Inventory.CreateHu.Successful", resolver.UserCode, huString);
            }
            resolver.Command = BusinessConstants.CS_BIND_VALUE_TRANSFORMER;
        }
 public virtual void DeleteWorkingHours(WorkingHours entity)
 {
     Delete(entity);
 }
 public virtual void UpdateWorkingHours(WorkingHours entity)
 {
     Update(entity);
 }
 public virtual void CreateWorkingHours(WorkingHours entity)
 {
     Create(entity);
 }
 public static WorkingHours[] Get(string FacultyId, int Day,String Session)
 {
     DataTable dt = Database.ExecuteQuery("SELECT * FROM Working_Hours_View WHERE Faculty_Id = '" +FacultyId+"' AND Day = " + Day +" AND Session <> '"+Session+"'");
     if (dt != null && dt.Rows.Count >= 1)
     {
         WorkingHours[] wh = new WorkingHours[dt.Rows.Count];
         int i = 0;
         foreach (DataRow r in dt.Rows)
         {
             wh[i] = new WorkingHours();
             wh[i].Id = int.Parse(r[0].ToString());
             wh[i].FacultyId = r[1].ToString();
             wh[i].Day = int.Parse(r[2].ToString());
             wh[i].SectionId = int.Parse(r[3].ToString());
             wh[i].PeriodId = int.Parse(r[4].ToString());
             i++;
         }
         return wh;
     }
     return null;
 }
 public static WorkingHours[] GetBySectionId(int SectionId)
 {
     DataTable dt = Database.ExecuteQuery("SELECT * FROM Working_Hours WHERE Section_Id = " + SectionId);
     if (dt != null && dt.Rows.Count >= 1)
     {
         WorkingHours[] wh = new WorkingHours[dt.Rows.Count];
         int i = 0;
         foreach (DataRow r in dt.Rows)
         {
             wh[i] = new WorkingHours();
             wh[i].Id = int.Parse(r[0].ToString());
             wh[i].FacultyId = r[1].ToString();
             wh[i].Day = int.Parse(r[2].ToString());
             wh[i].SectionId = int.Parse(r[3].ToString());
             wh[i].PeriodId = int.Parse(r[4].ToString());
             i++;
         }
         return wh;
     }
     return null;
 }
 public virtual void DeleteWorkingHours(WorkingHours entity)
 {
     entityDao.DeleteWorkingHours(entity);
 }
Example #9
0
 public string ReceiveWorkOrder(Resolver resolver)
 {
     Receipt receipt = new Receipt();
     foreach (Transformer transformer in resolver.Transformers)
     {
         ReceiptDetail receiptDetail = new ReceiptDetail();
         receiptDetail.OrderLocationTransaction = orderLocationTransactionMgr.LoadOrderLocationTransaction(transformer.OrderLocTransId);
         receiptDetail.HuId = null;
         receiptDetail.ReceivedQty = transformer.CurrentQty;
         receiptDetail.RejectedQty = transformer.CurrentRejectQty;
         receiptDetail.ScrapQty = transformer.ScrapQty;
         receiptDetail.Receipt = receipt;
         receipt.AddReceiptDetail(receiptDetail);
     }
     List<WorkingHours> workingHoursList = new List<WorkingHours>();
     foreach (string[] stringArray in resolver.WorkingHours)
     {
         WorkingHours workingHours = new WorkingHours();
         workingHours.Employee = employeeMgr.LoadEmployee(stringArray[0]);
         workingHours.Hours = Convert.ToDecimal(stringArray[1]);
         workingHoursList.Add(workingHours);
     }
     return orderMgr.ReceiveOrder(receipt, resolver.UserCode, workingHoursList).ReceiptNo;
 }
 public virtual void CreateWorkingHours(WorkingHours entity)
 {
     entityDao.CreateWorkingHours(entity);
 }
 public virtual void UpdateWorkingHours(WorkingHours entity)
 {
     entityDao.UpdateWorkingHours(entity);
 }
Example #12
0
 // Token: 0x06001FB3 RID: 8115 RVA: 0x000B6F60 File Offset: 0x000B5160
 private DatePicker(string id, ExDateTime[] selectedDates, ExDateTime month, int features, WorkingHours workingHours)
 {
     if (month == ExDateTime.MinValue)
     {
         month = selectedDates[0];
     }
     this.id             = id;
     this.selectedDates  = selectedDates;
     this.month          = month;
     this.features       = features;
     this.sessionContext = OwaContext.Current.SessionContext;
     if (workingHours == null)
     {
         this.workingHours = this.sessionContext.WorkingHours;
     }
     else
     {
         this.workingHours = workingHours;
     }
     this.InitializeDates();
 }
Example #13
0
 // Token: 0x06001FB0 RID: 8112 RVA: 0x000B6F2E File Offset: 0x000B512E
 public DatePicker(string id, WorkingHours workingHours, params ExDateTime[] selectedDates) : this(id, selectedDates, ExDateTime.MinValue, 0, workingHours)
 {
 }
Example #14
0
 private void Start()
 {
     player        = FindObjectOfType <Player>();
     workingHours  = player.workingHours;
     CurrentlyOpen = false;
 }
Example #15
0
        private void ExecuteEvents(TimelineHandler handler)
        {
            try
            {
                foreach (var timelineEvent in handler.TimeLineEvents)
                {
                    WorkingHours.Is(handler);

                    if (timelineEvent.DelayBefore > 0)
                    {
                        Thread.Sleep(timelineEvent.DelayBefore);
                    }

                    switch (timelineEvent.Command)
                    {
                    case "random":
                        while (true)
                        {
                            try
                            {
                                var url = timelineEvent.CommandArgs[new Random().Next(0, timelineEvent.CommandArgs.Count)].ToString();

                                if (Driver == null)
                                {
                                    this.Driver = new IE(url);
                                }
                                else
                                {
                                    Driver.GoTo(url);
                                }

                                this.Report(handler.HandlerType.ToString(), timelineEvent.Command, url, timelineEvent.TrackableId);
                            }
                            catch (Exception e)
                            {
                                _log.Trace(e);
                            }
                            Thread.Sleep(timelineEvent.DelayAfter);
                        }

                    case "browse":
                        Driver.GoTo(timelineEvent.CommandArgs[0].ToString());
                        this.Report(handler.HandlerType.ToString(), timelineEvent.Command, string.Join(",", timelineEvent.CommandArgs), timelineEvent.TrackableId);
                        break;
                        //case "download":
                        //    if (timelineEvent.CommandArgs.Count > 0)
                        //    {
                        //        var x = this.Driver.FindElement(By.XPath(timelineEvent.CommandArgs[0]));
                        //        x.Click();
                        //        this.Report(handler.HandlerType.ToString(), timelineEvent.Command, string.Join(",", timelineEvent.CommandArgs), timelineEvent.TrackableId);
                        //        Thread.Sleep(1000);
                        //    }
                        //    break;
                        //case "type":
                        //    var e = Driver.FindElement(By.Name(timelineEvent.CommandArgs[0]));
                        //    e.SendKeys(timelineEvent.CommandArgs[1]);
                        //    //this.Report(timelineEvent);
                        //    break;
                        //case "click":
                        //    var element = Driver.FindElement(By.Name(timelineEvent.CommandArgs[0]));
                        //    var actions = new Actions(Driver);
                        //    actions.MoveToElement(element).Click().Perform();
                        //    //this.Report(timelineEvent);
                        //    break;
                    }

                    if (timelineEvent.DelayAfter > 0)
                    {
                        Thread.Sleep(timelineEvent.DelayAfter);
                    }
                }
            }
            catch (Exception e)
            {
                _log.Error(e);
            }
        }
Example #16
0
        public VoipPhone UpdateSettings(string numberId, string greeting, string holdUp, string wait, VoiceMail voiceMail, WorkingHours workingHours, bool?allowOutgoingCalls, bool?record, string alias)
        {
            if (!CRMSecurity.IsAdmin)
            {
                throw CRMSecurity.CreateSecurityException();
            }

            var dao    = DaoFactory.GetVoipDao();
            var number = dao.GetNumber(numberId).NotFoundIfNull();

            number.Alias = Update.IfNotEmptyAndNotEquals(number.Alias, alias);
            number.Settings.GreetingAudio = Update.IfNotEmptyAndNotEquals(number.Settings.GreetingAudio, greeting);
            number.Settings.HoldAudio     = Update.IfNotEmptyAndNotEquals(number.Settings.HoldAudio, holdUp);
            number.Settings.VoiceMail     = Update.IfNotEmptyAndNotEquals(number.Settings.VoiceMail, voiceMail);
            number.Settings.WorkingHours  = Update.IfNotEmptyAndNotEquals(number.Settings.WorkingHours, workingHours);

            if (!string.IsNullOrEmpty(wait))
            {
                number.Settings.Queue.WaitUrl = wait;
            }

            if (allowOutgoingCalls.HasValue)
            {
                number.Settings.AllowOutgoingCalls = allowOutgoingCalls.Value;
                if (!number.Settings.AllowOutgoingCalls)
                {
                    number.Settings.Operators.ForEach(r => r.AllowOutgoingCalls = false);
                }
            }

            if (record.HasValue)
            {
                number.Settings.Record = record.Value;
                if (!number.Settings.Record)
                {
                    number.Settings.Operators.ForEach(r => r.Record = false);
                }
            }

            dao.SaveOrUpdateNumber(number);

            return(number);
        }