public void Delete(Memo memo)
 {
     using (DbManager db = new DbManager())
     {
         Accessor.Query.Delete(db, memo);
     }
 }
示例#2
0
 public MemoInfo(Memo memo)
 {
     this.ID = memo.ID;
     this.FromNodeID = memo.Node.NodeID;
     this.CreatedOn = memo.CreatedOn;
     this.Signature = memo.Signature;
     this.Subject = memo.Subject;
     this.Text = memo.Text;
 }
示例#3
0
        public void MemoEquals_UnitTest_SameTypeAndSameID_True()

        {
            var memo1 = new Memo {
                InstanceID = Guid.NewGuid()
            };
            var memo2 = new Memo {
                InstanceID = memo1.InstanceID
            };
            var result = memo1.Equals(memo2);

            Assert.IsTrue(result);
        }
        public Memo AddMemo(Memo memo, IValidationDictionary validationDic)
        {
            if (validationDic == null)
            {
                throw new ArgumentNullException(nameof(validationDic));
            }
            if (validationDic.IsValid)
            {
                return(_repository.Add(memo));
            }

            return(memo);
        }
示例#5
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hash = 17;
         hash = hash * 23 + Date.GetHashCode();
         hash = hash * 23 + Payee.GetHashCode();
         hash = hash * 23 + Memo.GetHashCode();
         hash = hash * 23 + Inflow.GetHashCode();
         hash = hash * 23 + OutFlow.GetHashCode();
         return(hash);
     }
 }
        public async Task SendMessage(string message)
        {
            int    iUserId    = Convert.ToInt32(Context.User.Claims.FirstOrDefault(x => x.Type == "Id")?.Value);
            string sGroupName = "WebSocket_" + Context.User.Identity.Name + "_" + iUserId;

            Memo entityUserMemo = await RedisMethod.GetUserMemoAsync(sGroupName, -1, () => GetUserMemo(iUserId));

            entityUserMemo.Scontent = message;
            RedisMethod.SetUserMemo(sGroupName, entityUserMemo, -1);
            await Clients.Group(sGroupName).SendAsync("ReceiveMessage", message);

            //await Clients.All.SendAsync("ReceiveMessage", message);
        }
示例#7
0
        public IHttpActionResult ChangeMemo(Memo memo)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.Entry(memo).State = EntityState.Modified;

            db.SaveChanges();

            return(StatusCode(HttpStatusCode.NoContent));
        }
示例#8
0
// ReSharper disable InconsistentNaming
        public void MemoEquals_UnitTest_SameTypeAndDifferentID_False()
// ReSharper restore InconsistentNaming
        {
            var memo1 = new Memo {
                InstanceID = Guid.NewGuid()
            };
            var memo2 = new Memo {
                InstanceID = Guid.NewGuid()
            };
            var result = memo1.Equals(memo2);

            Assert.IsFalse(result);
        }
示例#9
0
        //
        // GET: /Memo/Edit/5

        public ActionResult Edit(int id = 0)
        {
            Memo memo = db.Frames.Find(id) as Memo;

            if (memo == null)
            {
                return(View("Missing", new MissingItem(id)));
            }

            this.FillTemplatesSelectList(db, FrameTypes.Memo, memo.TemplateId);

            return(View(memo));
        }
示例#10
0
        public string Add([FromForm] Memo memo)
        {
            try
            {
                MemorizerLogic.AddMemo(Mapper.Map <Data.Models.Memo>(memo));

                return("Added!");
            }
            catch (Exception ex)
            {
                return($"Error: {ex.Message}");
            }
        }
示例#11
0
        /// <summary>
        /// memoに関連付けたMemoMarkのIdとしてidsをキャッシュする。
        /// </summary>
        public static void SaveMarkIdsCache(Memo memo, IEnumerable <string> ids)
        {
            var buf = new StringBuilder();

            foreach (var id in ids)
            {
                buf.AppendLine(id);
            }

            var container = MemopadApplication.Instance.Container;

            container.SaveExtendedTextData(memo, "MarkIds", buf.ToString());
        }
示例#12
0
        // Post new Memo

        public async Task <Memo> PostMemo(Memo Memo)
        {
            using (var db = _db.GetConnection())
            {
                return(await db.QueryFirstOrDefaultAsync <Memo>(@"INSERT INTO [dbo].[Memos]
                
                                 OUTPUT INSERTED.*
                                 VALUES
                                       (@userId
                                       ,@message
                                       ,@DateCreated)", Memo));
            }
        }
示例#13
0
        public void MemoEquals_UnitTest_SameTypeAndDifferentID_False()

        {
            var memo1 = new Memo {
                InstanceID = Guid.NewGuid()
            };
            var memo2 = new Memo {
                InstanceID = Guid.NewGuid()
            };
            var result = memo1.Equals(memo2);

            Assert.IsFalse(result);
        }
示例#14
0
    public void Init(Memo memo)
    {
        Memo       = memo;
        title.Text = memo.Title;

        string month;

        month = memo.Date[0].ToString() + memo.Date[1].ToString();

        string date = memo.Date[2].ToString() + memo.Date[3].ToString();

        this.date.Text = month + "/" + date;
    }
示例#15
0
        public string GetDecryptedPhrase2(string hash, string targetAnagram)
        {
            var anagramCharPool            = targetAnagram.Alphabetize();
            var targetAnagramRelevantWords = RemoveIrrelevantWords(_words, anagramCharPool);
            var equivalencyClasses         = WordEquivalencyClass.FromWordList(targetAnagramRelevantWords);

            var candidateAnswer = new WordEquivalencyClassComposition(new List <WordEquivalencyClass>()); //answerType

            var memo = new Memo(anagramCharPool);

            var candidateBundles2 = Recursive(candidateAnswer, anagramCharPool, equivalencyClasses, memo, 0);

            var candidateBundles = memo.Solutions.TempList;

            foreach (var bundle in candidateBundles)
            {
                // construct equivalent phrases
                var equivalentPhrases = new List <string> {
                    ""
                };
                foreach (var charPoolWithWords in bundle.OrderedListOfWordEquivalencyClasses)
                {
                    var tempList = new List <string>();

                    foreach (var word in charPoolWithWords.Words)
                    {
                        foreach (var phraseUnderConstruction in equivalentPhrases)
                        {
                            if (phraseUnderConstruction == "")
                            {
                                tempList.Add(word);
                            }
                            tempList.Add(phraseUnderConstruction + " " + word);
                        }
                    }

                    equivalentPhrases = tempList;
                }

                foreach (var phrase in equivalentPhrases)
                {
                    if (_encrypter.Hash(phrase) == hash)
                    {
                        return(phrase);
                    }
                }
            }


            throw new NoPhraseFound("no phrase found");
        }
示例#16
0
        public static void RemoveToastFromSchedule(Memo memo)
        {
            var toastNotifier = ToastNotificationManager.CreateToastNotifier();
            var toasts        = toastNotifier.GetScheduledToastNotifications();

            foreach (var one in toasts)
            {
                if (one.Id == toastIdPrefix + memo.LocalID)
                {
                    toastNotifier.RemoveFromSchedule(one);
                    break;
                }
            }
        }
示例#17
0
        public IHttpActionResult DeleteMemo(int id)
        {
            Memo memo = db.Memos.Find(id);

            if (memo == null)
            {
                return(NotFound());
            }

            db.Memos.Remove(memo);
            db.SaveChanges();

            return(Ok(memo));
        }
示例#18
0
 public void Save(Memo memo)
 {
     using (DbManager db = new DbManager())
     {
         if (memo.RecordNo != 0)
         {
             Accessor.Query.Update(db, memo);
         }
         else
         {
             Accessor.Query.Insert(db, memo);
         }
     }
 }
示例#19
0
 public ActionResult Get(string date)
 {
     if (!isAuthenticated() || !loggedUser.isAdmin)
     {
         return(new HttpUnauthorizedResult());
     }
     else
     {
         DateTime meetingDate = new Common().convertDate(date.Replace("/", "-"), true);
         Memo     memo        = new Memo();
         memo.loadData(meetingDate, loggedUser.Unit);
         return(Json(memo, JsonRequestBehavior.AllowGet));
     }
 }
示例#20
0
        // If Return Key is detected in the editor, expand its vertical size
        void EditorTextChanged(object sender, TextChangedEventArgs e)
        {
            Editor editor = (Editor)sender;
            Memo   memo   = (Memo)WhichObject(editor);

#if iOS
            if (e.NewTextValue.EndsWith("\n"))  // for iOS
#elif UWP
            if (e.NewTextValue.EndsWith("\r"))  // for UWP
#endif
            { memo.Body.HeightRequest += 20; }

            StatusLabel.Text = "Editting";
        }
示例#21
0
        // Create a new Memo and stick it onto "ScrollBoard"
        void StickMemo(object sender, EventArgs args)
        {
            Memo NewMemo = new Memo();

            // Set the initial position and offsets
#if MemoBoardPan
            NewMemo.Body.TranslationX = memoBoard.Display.X;
            NewMemo.Body.TranslationY = memoBoard.Display.Y;
            NewMemo.Offset            = new Point()
            {
                X = memoBoard.Display.X,
                Y = memoBoard.Display.Y
            };
#else
            NewMemo.Body.TranslationX = ScrollBoard.ScrollX;
            NewMemo.Body.TranslationY = ScrollBoard.ScrollY;
            NewMemo.Offset            = new Point()
            {
                X = ScrollBoard.ScrollX,
                Y = ScrollBoard.ScrollY
            };
#endif

            // Add Tap, Pan, Pinch Gesture Event
            var tapGesture = new TapGestureRecognizer();
            tapGesture.Tapped += OnTapMemo;
            NewMemo.Body.GestureRecognizers.Add(tapGesture);

            var panGesture = new PanGestureRecognizer();
            panGesture.PanUpdated += OnPanMemo;
            NewMemo.Body.GestureRecognizers.Add(panGesture);

            var pinchGesture = new PinchGestureRecognizer();
            pinchGesture.PinchUpdated += OnPinchMemo;
            NewMemo.Body.GestureRecognizers.Add(pinchGesture);


            // Add Editor Event
            Editor editor = (Editor)NewMemo.Body.Content;
            editor.TextChanged += EditorTextChanged;
            editor.Focused     += EditorFocused;
            editor.Unfocused   += EditorUnfocused;

            // Add this new Memo to the Memos collection
            //               and "MemoBoard" in "ScrollBoard"
            Memos.Add(NewMemo);
            MemoBoard.Children.Add(NewMemo.Body);

            StatusLabel.Text = "Memo Sticked";
        }
示例#22
0
        public void TestMemoHashTooLong()
        {
            var longer = Enumerable.Repeat((byte)0, 33).ToArray();

            try
            {
                Memo.Hash(longer);
                Assert.Fail();
            }
            catch (MemoTooLongException exception)
            {
                Assert.IsTrue(exception.Message.Contains("MEMO_HASH can contain 32 bytes at max."));
            }
        }
示例#23
0
        void MiEditLogClick(object sender, EventArgs e)
        {
            string LogFile = Application.StartupPath + "//ParseGet.log";

            Memo.SaveFile(LogFile, RichTextBoxStreamType.UnicodePlainText);
            try
            {
                Process.Start(LogFile);  // Edit Log ...
            }
            catch (Exception ex)
            {
                Log(Resources.Error + ex.Message);
            }
        }
示例#24
0
        public Task <string> ProcessRequest(IHostContext context, string jsonObj)
        {
            VerifyArgument.IsNotNull("context", context);
            VerifyArgument.IsNotNullOrWhitespace("jsonObj", jsonObj);

            return(new Task <string>(() =>
            {
                var memo = (IMemo)Memo.Parse(_serializer, jsonObj);

                // TODO: process message

                return memo.ToString(_serializer);
            }));
        }
示例#25
0
        // GET: Memos/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Memo memo = db.MemoSet.Find(id);

            if (memo == null)
            {
                return(HttpNotFound());
            }
            return(View(memo));
        }
        public async Task TestSkipCheckIfDestinationIsMuxedAccount()
        {
            var accountId = "GAYHAAKPAQLMGIJYMIWPDWCGUCQ5LAWY4Q7Q3IKSP57O7GUPD3NEOSEA";

            var muxed = MuxedAccountMed25519.FromMuxedAccountId(
                "MAAAAAAAAAAAJURAAB2X52XFQP6FBXLGT6LWOOWMEXWHEWBDVRZ7V5WH34Y22MPFBHUHY");

            var payment = new PaymentOperation
                          .Builder(muxed, new AssetTypeNative(), "100.500")
                          .Build();

            var tx = BuildTransaction(accountId, new Operation[] { payment }, Memo.None(), skipDefaultOp: true);
            await _server.CheckMemoRequired(tx);
        }
示例#27
0
 public ActionResult Edit([Bind(Include = "Id,Contenu,DateExecution,Delai,Status,Priorite,PersonneId,DateFin,EquipeId,CategorieId,EtatId")] Memo memo)
 {
     if (ModelState.IsValid)
     {
         db.Entry(memo).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.PersonneId  = new SelectList(db.PersonneSet, "Id", "Nom", memo.PersonneId);
     ViewBag.EquipeId    = new SelectList(db.EquipeSet, "Id", "NomEquipe", memo.EquipeId);
     ViewBag.CategorieId = new SelectList(db.CategorieSet, "Id", "NomCategorie", memo.CategorieId);
     ViewBag.EtatId      = new SelectList(db.EtatSet, "Id", "Nom", memo.EtatId);
     return(View(memo));
 }
示例#28
0
        private void network_MemoAdded(Network network, Memo memo)
        {
            TreeIter iter = memoTreeStore.AddItem(network, memo);

            if (Runtime.Core.IsLocalNode(memo.Node))
            {
                memoList.Selection.SelectIter(iter);
                memoList.GrabFocus();
            }

            UpdateMemoList();

            memoCount += 1;
        }
        private void SetMemoModify(WSNode node)
        {
            IMemoDao dao  = ORMFactory.GetService <IMemoDao>(typeof(IMemoDao));
            String   temp = node.Data;
            Memo     memo = new Memo();
            var      map  = GetParameter(node.Data);

            memo.Idx          = Convert.ToInt32(map["idx"]);
            memo              = dao.GetEneity(memo.Idx);
            memo.Title        = map.ContainsKey("title") && !String.IsNullOrEmpty(map["title"].Trim()) ? map["title"] : "No title";
            memo.Contents     = map.ContainsKey("contents") && !String.IsNullOrEmpty(map["contents"].Trim()) ? map["contents"] : "";
            memo.RecentlyDate = DateTime.Now;
            dao.Update(memo);
        }
 public void Save(Memo memo)
 {
     using (DbManager db = new DbManager())
     {
         if (memo.RecordNo != 0)
         {
             Accessor.Query.Update(db, memo);
         }
         else
         {
             Accessor.Query.Insert(db, memo);
         }
     }
 }
        private void SetMemoInsert(WSNode node)
        {
            IMemoDao dao  = ORMFactory.GetService <IMemoDao>(typeof(IMemoDao));
            String   temp = node.Data;
            Memo     memo = new Memo();
            var      map  = GetParameter(node.Data);

            memo.Title        = map.ContainsKey("title") && !String.IsNullOrEmpty(map["title"].Trim()) ? map["title"] : "No title";
            memo.Contents     = map.ContainsKey("contents") && !String.IsNullOrEmpty(map["contents"].Trim()) ? map["contents"] : "";
            memo.RecentlyDate = DateTime.Now;
            int scope = dao.InsertAndScope(memo);

            node.Data = scope.ToString();
        }
示例#32
0
            public override UITableViewCell GetCell(UITableView tableView, NSIndexPath indexPath)
            {
                var cell = tableView.DequeueReusableCell(ReusableMemosTableCellID) ?? new UITableViewCell(UITableViewCellStyle.Subtitle, ReusableMemosTableCellID);

                Memo m = new Memo("");

                m = _memosView._memos[indexPath.Row];
                cell.TextLabel.Text = String.Format("{0} {1} ",
                                                    m.MemoTimeEntered.ToString("dd/MM/yyyy HH:mm:ss"),
                                                    m.MemoDescription);

                cell.DetailTextLabel.Text = _memosView._memos[indexPath.Row].MemoContents;
                return(cell);
            }
        public void TestMemoNone()
        {
            Memo memo = Memo.MemoNone();

            Assert.AreEqual(Memo.MemoTypeEnum.MEMO_NONE, memo.Type);

            Stellar.Generated.Memo genMemo = memo.ToXDR();

            Assert.AreEqual(Stellar.Generated.MemoType.MemoTypeEnum.MEMO_NONE, genMemo.Discriminant.InnerValue);

            Memo resMemo = Memo.FromXDR(genMemo);

            Assert.AreEqual(Memo.MemoTypeEnum.MEMO_NONE, resMemo.Type);
        }
 public static void Encode(IByteWriter stream, Memo encodedMemo) {
 XdrEncoding.EncodeInt32((int)encodedMemo.Discriminant.InnerValue, stream);
 switch (encodedMemo.Discriminant.InnerValue) {
 case MemoType.MemoTypeEnum.MEMO_NONE:
 break;
 case MemoType.MemoTypeEnum.MEMO_TEXT:
 XdrEncoding.WriteString(stream, encodedMemo.Text);
 break;
 case MemoType.MemoTypeEnum.MEMO_ID:
 Uint64.Encode(stream, encodedMemo.Id);
 break;
 case MemoType.MemoTypeEnum.MEMO_HASH:
 Hash.Encode(stream, encodedMemo.Hash);
 break;
 case MemoType.MemoTypeEnum.MEMO_RETURN:
 Hash.Encode(stream, encodedMemo.RetHash);
 break;
 }
 }
 public static Memo Decode(IByteReader stream) {
   Memo decodedMemo = new Memo();
 decodedMemo.Discriminant = MemoType.Decode(stream);
 switch (decodedMemo.Discriminant.InnerValue) {
 case MemoType.MemoTypeEnum.MEMO_NONE:
 break;
 case MemoType.MemoTypeEnum.MEMO_TEXT:
 decodedMemo.Text = XdrEncoding.ReadString(stream);
 break;
 case MemoType.MemoTypeEnum.MEMO_ID:
 decodedMemo.Id = Uint64.Decode(stream);
 break;
 case MemoType.MemoTypeEnum.MEMO_HASH:
 decodedMemo.Hash = Hash.Decode(stream);
 break;
 case MemoType.MemoTypeEnum.MEMO_RETURN:
 decodedMemo.RetHash = Hash.Decode(stream);
 break;
 }
   return decodedMemo;
 }
示例#36
0
 internal min_i(object memo)
 {
     this.memo = (Memo)memo;
 }
示例#37
0
 internal grep_i(Memo memo)
 {
     this.memo = memo;
 }
示例#38
0
 internal partition_i(Memo memo)
 {
     this.memo = memo;
 }
 MemoViewModel MapToMemoViewModel(Memo m)
 {
     MemoViewModel model = new MemoViewModel();
     model.Id = m.Id.ToString();
     m.Name = m.Name;
     return model;
 }
示例#40
0
 public int MemoizedValuation(Memo args)
 {
     if (memoDictionary.ContainsKey(args))
     {
         return memoDictionary[args];
     }
     else
     {
         int result = Valuation(args);
         memoDictionary.Add(args, result);
         return result;
     }
 }
示例#41
0
    public int Valuation(Memo args)
    {
        List<Block> sector = args.sector;
        List<Patrol> patrols = args.patrols;
        if (patrols.Sum(p => p.area) > sector.Count - 1)
        {
            return int.MinValue;
        }

        List<Patrol> remainingPatrols = patrols.ToList();
        Patrol patrol = remainingPatrols.OrderByDescending(p => p.area).First();
        remainingPatrols.Remove(patrol);

        int highestThreat = 0;
        for (int i = 0; i < sector.Count - 1; i++)
        {
            List<Block> subsector1 = sector.Take(i).ToList();
            List<Block> subsector2 = sector.Skip(i + patrol.area).ToList();
            int threat = ThreatOfSector(sector.Skip(i).Take(patrol.area).ToList());
            for (int j = 0; j < remainingPatrols.Count; j++)
            {
                threat += MemoizedValuation(new Memo(subsector1, remainingPatrols));
                if (remainingPatrols.Count > 1)
                {
                    threat += MemoizedValuation(new Memo(subsector2, remainingPatrols.Skip(1).ToList()));
                }
            }
            if (threat > highestThreat)
            {
                highestThreat = threat;
            }
        }
        return highestThreat;
    }
示例#42
0
        public static async Task<Frame> GetNextFrameAsync(int panelId, int displayId, int previousFrameId)
		{
            Frame nci = new Frame()
            {
                PanelId = panelId,
                DisplayId = displayId
            };

            using (SqlCommand cmd = new SqlCommand("sp_GetNextFrame"))
            {
				cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add("@panelId", SqlDbType.Int).Value = panelId;
                cmd.Parameters.Add("@displayId", SqlDbType.Int).Value = displayId;
                cmd.Parameters.Add("@lastFrameId", SqlDbType.Int).Value = previousFrameId;

                await cmd.ExecuteReaderExtAsync((dr) =>
                {
                    nci._initfromRow(dr);
                    return false;
                });
            }

            if (nci.FrameId > 0)
            {
                switch (nci.FrameType)
                {
                    case FrameTypes.Clock:
                        nci = new Clock(nci);
                        break;

                    case FrameTypes.Html:
                        nci = new Html(nci);
                        break;

                    case FrameTypes.Memo:
                        nci = new Memo(nci);
                        break;

                    //case FrameTypes.News:

                    case FrameTypes.Outlook:
                        nci = new Outlook(nci);
                        break;

                    case FrameTypes.Picture:
                        nci = new Picture(nci);
                        break;

                    case FrameTypes.Powerbi:
                        nci = new Powerbi(nci);
                        break;

                    case FrameTypes.Report:
                        nci = new Report(nci);
                        break;

                    case FrameTypes.Video:
                        nci = new Video(nci);
                        break;

                    case FrameTypes.Weather:
                        nci = new Weather(nci);
                        break;

                    case FrameTypes.YouTube:
                        nci = new YouTube(nci);
                        break;

                    default:
                        break;
                }
            }

            return nci;
		}
示例#43
0
        public override object Call(Class last_class, object list, Frame caller, Proc block, Array rest)
        {
            Class.rb_scan_args(caller, rest, 0, 1, false);

            Memo memo = new Memo();

            if (rest.Count > 0)
            {
                memo.first = false;
                memo.result = rest[0];
            }
            else
            {
                memo.first = true;
                memo.result = null;
            }

            //    rb_iterate(rb_each, obj, inject_i, (VALUE)memo);
            Eval.CallPrivate(list, caller, "each", new Proc(null, block, new inject_i(memo), 1));

            return memo.result;
        }
示例#44
0
        public override object Call0(Class last_class, object list, Frame caller, Proc block)
        {
            Memo memo = new Memo();

            Eval.CallPrivate(list, caller, "each", new Proc(null, block, new partition_i(memo), 1));

            return new Array(new object[] { memo.true_array, memo.false_array });
        }
        private System.Web.UI.Control GetVariableEditor(Hashtable variable)
        {
            object value = variable["Value"];
            string name = (string) variable["Name"];
            string editor = variable["Editor"] as string;
            Type type = value.GetType();

            if (type == typeof (DateTime) ||
                (!string.IsNullOrEmpty(editor) &&
                 (editor.IndexOf("date", StringComparison.OrdinalIgnoreCase) > -1 ||
                  editor.IndexOf("time", StringComparison.OrdinalIgnoreCase) > -1)))
            {
                var dateTimePicker = new DateTimePicker
                {
                    ID = Control.GetUniqueID("variable_" + name + "_"),
                    ShowTime = (variable["ShowTime"] != null && (bool) variable["ShowTime"]) ||
                               (!string.IsNullOrEmpty(editor) &&
                                editor.IndexOf("time", StringComparison.OrdinalIgnoreCase) > -1),
                };
                dateTimePicker.Value = value is DateTime ? DateUtil.ToIsoDate((DateTime)value) : (string)value;
                return dateTimePicker;
            }

            if (type == typeof (Item) ||
                (!string.IsNullOrEmpty(editor) && (editor.IndexOf("item", StringComparison.OrdinalIgnoreCase) > -1)))
            {
                var item = (Item) value;
                var dataContext = new DataContext
                {
                    DefaultItem = item.Paths.Path,
                    ID = Control.GetUniqueID("dataContext"),
                    DataViewName = "Master",
                    Root = variable["Root"] as string ?? "/sitecore",
                    Parameters = "databasename=" + item.Database.Name,
                    Database = item.Database.Name,
                    Selected = new[] {new DataUri(item.ID, item.Language, item.Version)},
                    Folder = item.ID.ToString(),
                    Language = item.Language,
                    Version = item.Version
                };
                DataContextPanel.Controls.Add(dataContext);

                var treePicker = new TreePicker
                {
                    ID = Control.GetUniqueID("variable_" + name + "_"),
                    Value = item.ID.ToString(),
                    DataContext = dataContext.ID
                };
                treePicker.Class += " treePicker";
                return treePicker;
            }

            if (type == typeof(bool) ||
                (!string.IsNullOrEmpty(editor) && (editor.IndexOf("bool", StringComparison.OrdinalIgnoreCase) > -1)))
            {
                var checkBox = new Checkbox
                {
                    ID = Control.GetUniqueID("variable_" + name + "_"),
                    Header = (string) variable["Title"],
                    HeaderStyle = "margin-top:20px; display:inline-block;",
                    Checked = (bool) value
                };
                checkBox.Class = "varCheckbox";
                return checkBox;
            }

            if (!string.IsNullOrEmpty(editor))
            {
                bool showRoles = editor.IndexOf("role", StringComparison.OrdinalIgnoreCase) > -1;
                bool showUsers = editor.IndexOf("user", StringComparison.OrdinalIgnoreCase) > -1;
                bool multiple = editor.IndexOf("multiple", StringComparison.OrdinalIgnoreCase) > -1;
                if (showRoles || showUsers)
                {
                    UserPicker picker = new UserPicker();
                    picker.Style.Add("float", "left");
                    picker.ID = Control.GetUniqueID("variable_" + name + "_");
                    picker.Class += " scContentControl textEdit clr" + value.GetType().Name;
                    picker.Value = value.ToString();
                    picker.ExcludeRoles = !showRoles;
                    picker.ExcludeUsers = !showUsers;
                    picker.DomainName = variable["Domain"] as string ?? variable["DomainName"] as string;
                    picker.Multiple = multiple;
                    picker.Click = "UserPickerClick(" + picker.ID + ")";
                    return picker;
                }
            }

            Control edit;
            if (variable["lines"] != null && ((int)variable["lines"] > 1))
            {
                edit = new Memo();
                edit.Attributes.Add("rows", variable["lines"].ToString());
            }
            else if (variable["Options"] != null)
            {
                edit = new Combobox();
                string[] options = ((string) variable["Options"]).Split('|');
                int i = 0;
                while (i < options.Length)
                {
                    var item = new ListItem()
                    {
                        Header = options[i++],
                        Value = options[i++],
                    };
                    edit.Controls.Add(item);
                }
            }
            else
            {
                edit = new Edit();
            }
            if (!string.IsNullOrEmpty((string)variable["Tooltip"]))
            {
                edit.ToolTip = (string)variable["Tooltip"];
            }
            edit.Style.Add("float", "left");
            edit.ID = Control.GetUniqueID("variable_" + name + "_");
            edit.Class += " scContentControl textEdit clr"+value.GetType().Name;
            edit.Value = value.ToString();

            return edit;
        }
示例#46
0
 internal inject_i(Memo memo)
 {
     this.memo = memo;
 }
示例#47
0
        public ActionResult Edit(Memo Memo)
        {
            if (ModelState.IsValid)
            {

                string connectionString = "Data Source=HRMSDEV;user id=PERSON;password=PERSON;Unicode=True;";
                string AUTORIZE_DETAIL;
                using (OracleConnection connection = new OracleConnection(connectionString))
                {
                    if (Memo.Autorize.ToString() == "Department")
                    {
                        AUTORIZE_DETAIL = Memo.Autorize_detail;
                    }
                    else
                    {
                        AUTORIZE_DETAIL = "";
                    }
                    string number = null;
                    number = "";

                    OracleCommand cmd2 = new OracleCommand();
                    cmd2.Connection = connection;
                    connection.Open();
                    if (Memo.MemoFile != null)
                    {
                        byte[] tempFile = new byte[Memo.MemoFile.InputStream.Length];
                        Memo.MemoFile.InputStream.Read(tempFile, 0, tempFile.Length);
                        cmd2.CommandText = "Update KMIINTRANET_MASTER_MEMO set MEMO_THEME=:theme,AUTORIZE=:autorize,AUTORIZE_DETAIL=:detail,MEMO_FILE=:memofile,VALID_FROM=:validfrom,VALID_UNTIL=:validuntil,MODIFY_BY='" + Session["USER"] + "',MODIFY_DATE=SYSDATE where MEMO_ID=:memoid";
                        cmd2.CommandType = CommandType.Text;
                        cmd2.Parameters.Add(":memofile", OracleType.Blob).Value = tempFile;
                        cmd2.Parameters.Add(":validuntil", OracleType.DateTime).Value = Memo.ValidUntil;
                        cmd2.Parameters.Add(":validfrom", OracleType.DateTime).Value = Memo.ValidFrom;
                        cmd2.Parameters.Add(":detail", OracleType.VarChar).Value = AUTORIZE_DETAIL;
                        cmd2.Parameters.Add(":autorize", OracleType.VarChar).Value = Memo.Autorize.ToString();
                        cmd2.Parameters.Add(":theme", OracleType.VarChar).Value = Memo.Theme.ToString();
                        cmd2.Parameters.Add(":memoid", OracleType.VarChar).Value = Memo.idmemo;
                    }
                    else
                    {
                        cmd2.CommandText = "Update KMIINTRANET_MASTER_MEMO set MEMO_THEME=:theme,AUTORIZE=:autorize,AUTORIZE_DETAIL=:detail,VALID_FROM=:validfrom,VALID_UNTIL=:validuntil,MODIFY_BY='" + Session["USER"] + "',MODIFY_DATE=SYSDATE where MEMO_ID=:memoid";
                        cmd2.CommandType = CommandType.Text;
                        cmd2.Parameters.Add(":validuntil", OracleType.DateTime).Value = Memo.ValidUntil;
                        cmd2.Parameters.Add(":validfrom", OracleType.DateTime).Value = Memo.ValidFrom;
                        cmd2.Parameters.Add(":detail", OracleType.VarChar).Value = AUTORIZE_DETAIL;
                        cmd2.Parameters.Add(":autorize", OracleType.VarChar).Value = Memo.Autorize.ToString();
                        cmd2.Parameters.Add(":theme", OracleType.VarChar).Value = Memo.Theme.ToString();
                        cmd2.Parameters.Add(":memoid", OracleType.VarChar).Value = Memo.idmemo.ToString();

                    }
                    cmd2.ExecuteNonQuery();

                    cmd2 = null;
                    connection.Close();
                    return RedirectToAction("Index");
                }

            }

            return View();
        }
示例#48
0
 internal max_ii(object memo)
 {
     this.memo = (Memo)memo;
 }
示例#49
0
        public override object Call(Class last_class, object list, Frame caller, Proc block, Array rest)
        {
            Memo memo = new Memo();
            memo.args = new System.Collections.Generic.List<Array>();
            memo.index = 0;

            for (int i = 0; i < rest.Count; i++)
            {
                memo.args.Add(Object.CheckConvert<Array>(rest[i], "to_a", caller));
            }

            zip_i iterator = new zip_i(memo);

            Eval.CallPrivate(list, caller, "each", new Proc(list, block, iterator, 1));

            return block == null ? iterator.result : null;
        }
示例#50
0
        public static Frame GetNextFrame(int panelId, int displayId, int previousFrameId)
		{
            Frame nci = new Frame()
            {
                PanelId = panelId,
                DisplayId = displayId
            };

            using (SqlCommand cmd = new SqlCommand("sp_GetNextFrame"))
            {
				cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add("@panelId", SqlDbType.Int).Value = panelId;
                cmd.Parameters.Add("@displayId", SqlDbType.Int).Value = displayId;
                cmd.Parameters.Add("@lastFrameId", SqlDbType.Int).Value = previousFrameId;

                using (DataSet ds = DataAccess.RunSql(cmd))
                {
                    if (ds.Tables[0].Rows.Count > 0)
                    {
                        DataRow r = ds.Tables[0].Rows[0];
                        nci._initfromRow(r);
                    }
                }
            }

            if (nci.FrameId > 0)
            {
                switch (nci.FrameType)
                {
                    case FrameTypes.Clock:
                        nci = new Clock(nci);
                        break;

                    case FrameTypes.Html:
                        nci = new Html(nci);
                        break;

                    case FrameTypes.Memo:
                        nci = new Memo(nci);
                        break;

                    //case FrameTypes.News:
                    case FrameTypes.Outlook:
                        nci = new Outlook(nci);
                        break;

                    case FrameTypes.Picture:
                        nci = new Picture(nci);
                        break;

                    case FrameTypes.Report:
                        nci = new Report(nci);
                        break;

                    case FrameTypes.Video:
                        nci = new Video(nci);
                        break;

                    case FrameTypes.Weather:
                        nci = new Weather(nci);
                        break;

                    case FrameTypes.YouTube:
                        nci = new YouTube(nci);
                        break;

                    default:
                        break;
                }
            }

            return nci;
		}
示例#51
0
        public override object Call1(Class last_class, object list, Frame caller, Proc block, object p1)
        {
            Memo memo = new Memo();
            memo.found = false;
            memo.member = p1;

            Eval.CallPrivate(list, caller, "each", new Proc(null, block, new member_i(memo), 1));

            return memo.found;
        }
示例#52
0
        public override object Call0(Class last_class, object list, Frame caller, Proc block)
        {

            Memo memo = new Memo(null);

            Eval.CallPrivate(list, caller, "each", new Proc(null, block, block != null ? (MethodBody)new max_ii(memo) : (MethodBody)new max_i(memo), 1));

            return memo.max;
        }
示例#53
0
 public void Popup(Memo selectedMemo)
 {
     this.selectedMemo = selectedMemo;
     mnuMemos.Popup ();
 }
示例#54
0
 internal zip_i(Memo memo)
 {
     result = new Array();
     this.memo = memo;
 }
示例#55
0
        public override object Call1(Class last_class, object list, Frame caller, Proc block, object p1)
        {
            Memo memo = new Memo();
            memo.ary = new Array();
            memo.pattern = p1;

            Eval.CallPrivate(list, caller, "each", new Proc(null, block, block != null ? (MethodBody)new grep_iter_i(memo) : (MethodBody)new grep_i(memo), 1));

            return memo.ary;
        }
示例#56
0
 internal member_i(Memo memo)
 {
     this.memo = memo;
 }