Ejemplo n.º 1
0
        public static int SaveMeetings(MeetingsDbModel Model)
        {
            var outParam = new SqlParameter();

            outParam.ParameterName = "Id";
            outParam.Value         = Model.Id;
            outParam.SqlDbType     = SqlDbType.BigInt;
            outParam.Direction     = ParameterDirection.InputOutput;
            int result = 0;

            using (var Context = new CRMContext())
            {
                Context.Database.ExecuteSqlCommand(
                    "exec dbo.[usp_Sales_Meetings_Save] @Id OUT,@Name,@Description,@StartDateTime,@EndDateTime,@Location," +
                    "@PopupReminder,@EmailReminder,@MeetingTypeId,@MeetingStatusId,@CreatedBy,@IsActive",
                    new Object[]
                {
                    outParam,
                    new SqlParameter("Name", Model.Name),
                    new SqlParameter("Description", Model.Description),
                    new SqlParameter("StartDateTime", Model.StartDateTime),
                    new SqlParameter("EndDateTime", Model.EndDateTime),
                    new SqlParameter("Location", Model.Location),
                    new SqlParameter("PopupReminder", Model.PopupReminder),
                    new SqlParameter("EmailReminder", Model.EmailReminder),
                    new SqlParameter("MeetingTypeId", Model.MeetingTypeId),
                    new SqlParameter("MeetingStatusId", Model.MeetingStatusId),
                    new SqlParameter("CreatedBy", Model.CreatedBy),
                    new SqlParameter("IsActive", Model.IsActive)
                }
                    );
            }
            result = Convert.ToInt32(outParam.Value);
            return(result);
        }
Ejemplo n.º 2
0
 public static int SaveMeetingLinks(MeetingsDbModel Model)
 {
     using (var Context = new CRMContext())
     {
         return(Context.Database.ExecuteSqlCommand(
                    "exec dbo.[usp_Sales_MeetingLinks_Save] @Id,@MeetingId,@LinkId,@LinkType",
                    new Object[]
         {
             new SqlParameter("Id", Model.MeetingLinkId),
             new SqlParameter("MeetingId", Model.Id),
             new SqlParameter("LinkId", Model.LinkId),
             new SqlParameter("LinkType", (int)Model.LinkType)
         }
                    ));
     }
 }