Esempio n. 1
0
 public static int SaveCallLinks(CallsDbModel Model)
 {
     using (var Context = new CRMContext())
     {
         return(Context.Database.ExecuteSqlCommand(
                    "exec dbo.[usp_Sales_CallLinks_Save] @Id,@CallId,@LinkId,@LinkType",
                    new Object[]
         {
             new SqlParameter("Id", Model.CallLinkId),
             new SqlParameter("CallId", Model.Id),
             new SqlParameter("LinkId", Model.LinkId),
             new SqlParameter("LinkType", (int)Model.LinkType)
         }
                    ));
     }
 }
Esempio n. 2
0
        public static int SaveCalls(CallsDbModel 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_Calls_Save] @Id OUT,@Subject,@Description,@CallStatusId,@StartDateTime,@EndDateTime," +
                    "@CallRepeatTypeId,@CallDirectionId,@CallRelatedTo,@PopupReminder,@EmailReminder,@CreatedBy,@IsActive",
                    new object[]
                {
                    outParam,
                    new SqlParameter("Subject", Model.Subject),
                    new SqlParameter("Description", Model.Description),
                    new SqlParameter("CallStatusId", Model.CallStatusId),
                    new SqlParameter("StartDateTime", Model.StartDateTime),
                    new SqlParameter("EndDateTime", Model.EndDateTime),
                    new SqlParameter("CallRepeatTypeId", Model.CallRepeatTypeId),
                    new SqlParameter("CallDirectionId", Model.CallDirectionId),
                    new SqlParameter("CallRelatedTo", Model.CallRelatedTo),
                    new SqlParameter("PopupReminder", Model.PopupReminder),
                    new SqlParameter("EmailReminder", Model.EmailReminder),
                    new SqlParameter("CreatedBy", Model.CreatedBy),
                    new SqlParameter("IsActive", Model.IsActive)
                }
                    );
            }
            result = Convert.ToInt32(outParam.Value);
            return(result);
        }