Beispiel #1
0
        public void Save(Sequence sequence)
        {
            int retVal;

            DataCommandService dataCommandDB = DataCommandService.GetInstance();



            List <ScreenDataCommandParameter> parameters = new List <ScreenDataCommandParameter>();



            ScreenDataCommandParameter p = null;

            p       = new ScreenDataCommandParameter();
            p.Name  = "@SequenceName";
            p.Value = sequence.Name;
            parameters.Add(p);

            p       = new ScreenDataCommandParameter();
            p.Name  = "@SequencePrefix";
            p.Value = sequence.Prefix;
            parameters.Add(p);

            p       = new ScreenDataCommandParameter();
            p.Name  = "@SeedValue";
            p.Value = sequence.SeedValue;
            parameters.Add(p);

            p       = new ScreenDataCommandParameter();
            p.Name  = "@Increment";
            p.Value = sequence.Increment;
            parameters.Add(p);

            dataCommandDB.ExecuteDataCommand(Configuration.GetInstance().App.SaveSequenceDataCommand, parameters);
        }
Beispiel #2
0
        public string InsertMessage(
            DateMode DateMode, string PhoneNo, string MessageText, string Template,
            string EntityType, string EntityID, string UserName, string Password,
            string ChannelID, string CreatedBy)
        {
            string MessageID = Guid.NewGuid().ToString();

            DataCommandService dataCommandDB = DataCommandService.GetInstance();;



            List <ScreenDataCommandParameter> parameters = new List <ScreenDataCommandParameter>();



            ScreenDataCommandParameter p = null;


            p       = new ScreenDataCommandParameter();
            p.Name  = "@MessageID";
            p.Value = MessageID;
            parameters.Add(p);

            p       = new ScreenDataCommandParameter();
            p.Name  = "@PhoneNo";
            p.Value = PhoneNo;
            parameters.Add(p);

            p       = new ScreenDataCommandParameter();
            p.Name  = "@MessageText";
            p.Value = MessageText;
            parameters.Add(p);

            p       = new ScreenDataCommandParameter();
            p.Name  = "@Template";
            p.Value = Template;
            parameters.Add(p);

            p       = new ScreenDataCommandParameter();
            p.Name  = "@EntityType";
            p.Value = EntityType;
            parameters.Add(p);

            p       = new ScreenDataCommandParameter();
            p.Name  = "@EntityID";
            p.Value = EntityID;
            parameters.Add(p);

            p       = new ScreenDataCommandParameter();
            p.Name  = "@UserName";
            p.Value = UserName;
            parameters.Add(p);

            p       = new ScreenDataCommandParameter();
            p.Name  = "@Password";
            p.Value = Password;
            parameters.Add(p);

            p       = new ScreenDataCommandParameter();
            p.Name  = "@ChannelID";
            p.Value = ChannelID;
            parameters.Add(p);

            p      = new ScreenDataCommandParameter();
            p.Name = "@CreatedOn";
            switch (DateMode)
            {
            case DateMode.LocalDate:
                p.Value = DateTime.Now;
                break;

            case DateMode.UniversalDate:
                p.Value = DateTime.UtcNow;
                break;
            }

            parameters.Add(p);

            p       = new ScreenDataCommandParameter();
            p.Name  = "@CreatedBy";
            p.Value = CreatedBy;
            parameters.Add(p);

            dataCommandDB.ExecuteDataCommand(Configuration.GetInstance().App.SaveSequenceDataCommand, parameters);



            return(MessageID);
        }