Example #1
0
        public string CreateUserRolesUpsert(
            int AplicationId,
            int RoleId,
            string UserEmail)
        {
            List <System.Data.IDbDataParameter> lstParams = new List <IDbDataParameter>();

            lstParams.Add(DataInstance.CreateTypedParameter("vApplicationId", AplicationId));
            lstParams.Add(DataInstance.CreateTypedParameter("vRoleId", RoleId));
            lstParams.Add(DataInstance.CreateTypedParameter("vUserEmail", UserEmail));

            ADO.Models.ADOModelResponse response = DataInstance.ExecuteQuery(new ADO.Models.ADOModelRequest()
            {
                CommandExecutionType = ADO.Models.enumCommandExecutionType.Scalar,
                CommandText          = "A_ApplicationRole_Create",
                CommandType          = System.Data.CommandType.StoredProcedure,
                Parameters           = lstParams
            });

            if (response.ScalarResult != null)
            {
                return(response.ScalarResult.ToString());
            }
            else
            {
                return(null);
            }
        }
Example #2
0
        public int BOProviderUpsert(string ProviderPublicId, string ProviderName, string IdentificationType, string IdentificationNumber)
        {
            List <System.Data.IDbDataParameter> lstParams = new List <System.Data.IDbDataParameter>();

            lstParams.Add(DataInstance.CreateTypedParameter("vProviderPublicId", ProviderPublicId));
            lstParams.Add(DataInstance.CreateTypedParameter("vProviderName", ProviderName));
            lstParams.Add(DataInstance.CreateTypedParameter("vIdentificationType", IdentificationType));
            lstParams.Add(DataInstance.CreateTypedParameter("vIdentificationNumber", IdentificationNumber));

            ADO.Models.ADOModelResponse response = DataInstance.ExecuteQuery(new ADO.Models.ADOModelRequest()
            {
                CommandExecutionType = ADO.Models.enumCommandExecutionType.Scalar,
                CommandText          = "AP_BOProviderUpsert",
                CommandType          = System.Data.CommandType.StoredProcedure,
                Parameters           = lstParams,
            });

            int oReturn = 0;

            if (response.ScalarResult != null)
            {
                oReturn = Convert.ToInt32(response.ScalarResult);
            }

            return(oReturn);
        }
Example #3
0
        public List <AdminRolesModel> ListUserRoles()
        {
            ADO.Models.ADOModelResponse response = DataInstance.ExecuteQuery(new ADO.Models.ADOModelRequest()
            {
                CommandExecutionType = ADO.Models.enumCommandExecutionType.DataTable,
                CommandText          = "A_GetAllUsers",
                CommandType          = System.Data.CommandType.StoredProcedure
            });

            List <AdminRolesModel> oRetorno = null;


            if (response.DataTableResult != null &&
                response.DataTableResult.Rows.Count > 0)
            {
                oRetorno = (from au in response.DataTableResult.AsEnumerable()
                            select new AdminRolesModel()
                {
                    RelatedRole = new SessionManager.Models.Auth.ApplicationRole()
                    {
                        ApplicationRoleId = au.Field <int>("ApplicationRoleId"),
                        Application = au.Field <enumApplication>("ApplicationId"),
                        Role = au.Field <enumRole>("RoleId"),
                        CreateDate = au.Field <DateTime>("CreateDate"),
                    },
                    UserEmail = au.Field <string>("UserEmail")
                }).ToList();
            }
            return(oRetorno);
        }
        public CustomerModel CustomerGetById(string CustomerPublicId)
        {
            List <System.Data.IDbDataParameter> lstParams = new List <System.Data.IDbDataParameter>();

            lstParams.Add(DataInstance.CreateTypedParameter("vCustomerPublicId", CustomerPublicId));

            ADO.Models.ADOModelResponse response = DataInstance.ExecuteQuery(new ADO.Models.ADOModelRequest()
            {
                CommandExecutionType = ADO.Models.enumCommandExecutionType.DataTable,
                CommandText          = "C_Customer_GetById",
                CommandType          = System.Data.CommandType.StoredProcedure,
                Parameters           = lstParams
            });

            CustomerModel oReturn = null;

            if (response.DataTableResult != null &&
                response.DataTableResult.Rows.Count > 0)
            {
                oReturn = new CustomerModel()
                {
                    CustomerPublicId   = response.DataTableResult.Rows[0].Field <string>("CustomerPublicId"),
                    Name               = response.DataTableResult.Rows[0].Field <string>("Name"),
                    IdentificationType = new Models.Util.CatalogModel()
                    {
                        ItemId   = response.DataTableResult.Rows[0].Field <int>("IdentificationTypeId"),
                        ItemName = response.DataTableResult.Rows[0].Field <string>("IdentificationTypeName"),
                    },
                    IdentificationNumber = response.DataTableResult.Rows[0].Field <string>("IdentificationNumber"),
                };
            }

            return(oReturn);
        }
        public List <StepModel> StepGetByFormId(string FormPublicId)
        {
            List <System.Data.IDbDataParameter> lstParams = new List <System.Data.IDbDataParameter>();

            lstParams.Add(DataInstance.CreateTypedParameter("vFormPublicId", FormPublicId));

            ADO.Models.ADOModelResponse response = DataInstance.ExecuteQuery(new ADO.Models.ADOModelRequest()
            {
                CommandExecutionType = ADO.Models.enumCommandExecutionType.DataTable,
                CommandText          = "F_Step_GetByFormId",
                CommandType          = System.Data.CommandType.StoredProcedure,
                Parameters           = lstParams
            });

            List <StepModel> oReturn = new List <StepModel>();

            if (response.DataTableResult != null &&
                response.DataTableResult.Rows.Count > 0)
            {
                oReturn =
                    (from s in response.DataTableResult.AsEnumerable()
                     where !s.IsNull("StepId")
                     select new StepModel()
                {
                    StepId = s.Field <int>("StepId"),
                    Name = s.Field <string>("StepName"),
                    Position = s.Field <int>("StepPosition"),
                }).ToList();
            }
            return(oReturn);
        }
        public string CustomerUpsert(string CustomerPublicId, string Name, int IdentificationType, string IdentificationNumber)
        {
            List <System.Data.IDbDataParameter> lstParams = new List <System.Data.IDbDataParameter>();

            lstParams.Add(DataInstance.CreateTypedParameter("vCustomerPublicId", CustomerPublicId));
            lstParams.Add(DataInstance.CreateTypedParameter("vName", Name));
            lstParams.Add(DataInstance.CreateTypedParameter("vIdentificationType", IdentificationType));
            lstParams.Add(DataInstance.CreateTypedParameter("vIdentificationNumber", IdentificationNumber));

            ADO.Models.ADOModelResponse response = DataInstance.ExecuteQuery(new ADO.Models.ADOModelRequest()
            {
                CommandExecutionType = ADO.Models.enumCommandExecutionType.Scalar,
                CommandText          = "C_Customer_UpSert",
                CommandType          = System.Data.CommandType.StoredProcedure,
                Parameters           = lstParams
            });

            if (response.ScalarResult != null)
            {
                return(response.ScalarResult.ToString());
            }
            else
            {
                return(null);
            }
        }
        public List <ProveedoresOnLine.Company.Models.Util.CatalogModel> CatalogGetSanofiOptions()
        {
            ADO.Models.ADOModelResponse response = DataInstance.ExecuteQuery(new ADO.Models.ADOModelRequest()
            {
                CommandExecutionType = ADO.Models.enumCommandExecutionType.DataTable,
                CommandText          = "Sanofi_Catalog_GetProviderOptions",
                CommandType          = CommandType.StoredProcedure,
            });

            List <ProveedoresOnLine.Company.Models.Util.CatalogModel> oReturn = new List <ProveedoresOnLine.Company.Models.Util.CatalogModel>();

            if (response.DataTableResult != null &&
                response.DataTableResult.Rows.Count > 0)
            {
                oReturn =
                    (from c in response.DataTableResult.AsEnumerable()
                     where !c.IsNull("CatalogId")
                     select new ProveedoresOnLine.Company.Models.Util.CatalogModel()
                {
                    CatalogId = c.Field <int>("CatalogId"),
                    CatalogName = c.Field <string>("CatalogName"),
                    ItemId = c.Field <int>("ItemId"),
                    ItemName = c.Field <string>("ItemName"),
                }).ToList();
            }

            return(oReturn);
        }
        public List <CatalogModel> CatalogGetCustomerOptions()
        {
            ADO.Models.ADOModelResponse response = DataInstance.ExecuteQuery(new ADO.Models.ADOModelRequest()
            {
                CommandExecutionType = ADO.Models.enumCommandExecutionType.DataTable,
                CommandText          = "U_Catalog_GetCustomerOptions",
                CommandType          = System.Data.CommandType.StoredProcedure,
                Parameters           = null
            });

            List <CatalogModel> oReturn = new List <CatalogModel>();

            if (response.DataTableResult != null &&
                response.DataTableResult.Rows.Count > 0)
            {
                oReturn =
                    (from c in response.DataTableResult.AsEnumerable()
                     where !c.IsNull("ItemId")
                     select new CatalogModel()
                {
                    CatalogId = c.Field <int>("CatalogId"),
                    CatalogName = c.Field <string>("CatalogName"),
                    ItemId = c.Field <int>("ItemId"),
                    ItemName = c.Field <string>("ItemName"),
                }).ToList();
            }

            return(oReturn);
        }
        public SanofiProcessLogModel GetSanofiLastProcessLog()
        {
            ADO.Models.ADOModelResponse response = DataInstance.ExecuteQuery(new ADO.Models.ADOModelRequest()
            {
                CommandExecutionType = ADO.Models.enumCommandExecutionType.DataTable,
                CommandText          = "Sanofi_LastProcessLog_Get",
                CommandType          = CommandType.StoredProcedure,
            });

            SanofiProcessLogModel oReturn = new SanofiProcessLogModel();

            if (response.DataTableResult != null &&
                !string.IsNullOrEmpty(response.DataTableResult.Rows[0].Field <string>("ProviderPublicId")))
            {
                oReturn = new SanofiProcessLogModel
                {
                    SanofiProcessLogId = response.DataTableResult.Rows[0].Field <int>("SanofiProcessLogId"),
                    ProviderPublicId   = response.DataTableResult.Rows[0].Field <string>("ProviderPublicId"),
                    ProcessName        = response.DataTableResult.Rows[0].Field <string>("ProcessName"),
                    IsSucces           = response.DataTableResult.Rows[0].Field <UInt64>("IsSuccess") == 1 ? true : false,
                    CreateDate         = response.DataTableResult.Rows[0].Field <DateTime>("CreateDate"),
                    LastModify         = response.DataTableResult.Rows[0].Field <DateTime>("lastModify")
                };
            }
            return(oReturn);
        }
        public List <SanofiContableInfoModel> GetContableInfoByProvider(string vProviderPublicId)
        {
            List <System.Data.IDbDataParameter> lstparams = new List <System.Data.IDbDataParameter>();

            lstparams.Add(DataInstance.CreateTypedParameter("vProviderPublicId", vProviderPublicId));

            ADO.Models.ADOModelResponse response = DataInstance.ExecuteQuery(new ADO.Models.ADOModelRequest()
            {
                CommandExecutionType = ADO.Models.enumCommandExecutionType.DataTable,
                CommandText          = "Sanofi_GetContableInfo",
                CommandType          = CommandType.StoredProcedure,
                Parameters           = lstparams,
            });

            List <SanofiContableInfoModel> oReturn = new List <SanofiContableInfoModel>();

            if (response.DataTableResult != null && response.DataTableResult.Rows.Count > 0)
            {
                oReturn =
                    (
                        from sconi in response.DataTableResult.AsEnumerable()
                        where !sconi.IsNull("CompanyId")
                        group sconi by new
                {
                    CompanyId = sconi.Field <int>("CompanyId"),
                    CompanyName = sconi.Field <string>("CompanyName"),
                    FiscalNumber = sconi.Field <string>("FiscalNumber"),
                    IdentificationNumber = sconi.Field <string>("IdentificationNumber"),
                    Country = sconi.Field <string>("Country"),
                    BankPassword = sconi.Field <string>("BankPassword"),
                    BankCountNumber = sconi.Field <string>("BankCountNumber"),
                    CountType = sconi.Field <Int64>("CountType"),
                    IBAN = sconi.Field <string>("IBAN"),
                    PayWay = sconi.Field <string>("PayWay"),
                    PayCondition = sconi.Field <string>("PayCondition"),
                    AssociatedCount = sconi.Field <string>("AssociatedCount")
                }
                        into sconig
                        select new SanofiContableInfoModel()
                {
                    CompanyId = sconig.Key.CompanyId,
                    CompanyName = sconig.Key.CompanyName,
                    FiscalNumber = sconig.Key.FiscalNumber,
                    IdentificationNumber = sconig.Key.IdentificationNumber,
                    Country = sconig.Key.Country,
                    BankPassword = sconig.Key.BankPassword,
                    BankCountNumber = sconig.Key.BankCountNumber,
                    CountType = sconig.Key.CountType,
                    IBAN = sconig.Key.IBAN,
                    PayWay = sconig.Key.PayWay,
                    PayCondition = sconig.Key.PayCondition,
                    AssociatedCount = sconig.Key.AssociatedCount
                }).ToList();
            }
            return(oReturn);
        }
        public List <LogModel> LogSearch(string LogInfoType, string Value)
        {
            List <System.Data.IDbDataParameter> lstParams = new List <System.Data.IDbDataParameter>();

            lstParams.Add(DataInstance.CreateTypedParameter("vLogInfoType", LogInfoType));
            lstParams.Add(DataInstance.CreateTypedParameter("vValue", Value));

            ADO.Models.ADOModelResponse response = DataInstance.ExecuteQuery(new ADO.Models.ADOModelRequest()
            {
                CommandExecutionType = ADO.Models.enumCommandExecutionType.DataTable,
                CommandText          = "L_Log_Search",
                CommandType          = System.Data.CommandType.StoredProcedure,
                Parameters           = lstParams
            });

            List <LogModel> oReturn = new List <LogModel>();

            if (response.DataTableResult != null &&
                response.DataTableResult.Rows.Count > 0)
            {
                oReturn =
                    (from l in response.DataTableResult.AsEnumerable()
                     group l by
                     new
                {
                    LogId = l.Field <int>("LogId"),
                    User = l.Field <string>("User"),
                    Application = l.Field <string>("Application"),
                    Source = l.Field <string>("Source"),
                    IsSuccess = l.Field <UInt64>("IsSuccess") == 1 ? true : false,
                    Message = l.Field <string>("Message"),
                    CreateDate = l.Field <DateTime>("CreateDate"),
                } into lg
                     select new LogModel()
                {
                    LogId = lg.Key.LogId,
                    User = lg.Key.User,
                    Application = lg.Key.Application,
                    Source = lg.Key.Source,
                    IsSuccess = lg.Key.IsSuccess,
                    Message = lg.Key.Message,
                    CreateDate = lg.Key.CreateDate,

                    RelatedLogInfo =
                        (from li in response.DataTableResult.AsEnumerable()
                         where li.Field <int>("LogId") == lg.Key.LogId
                         select new LogInfoModel()
                    {
                        LogInfoId = li.Field <int>("LogInfoId"),
                        LogInfoType = li.Field <string>("LogInfoType"),
                        Value = li.Field <string>("Value"),
                    }).ToList(),
                }).ToList();
            }
            return(oReturn);
        }
Example #12
0
        public ProviderModel ProviderGetByIdentification(string IdentificationNumber, int IdenificationTypeId, string CustomerPublicId)
        {
            List <System.Data.IDbDataParameter> lstParams = new List <System.Data.IDbDataParameter>();

            lstParams.Add(DataInstance.CreateTypedParameter("vIdentificationNumber", IdentificationNumber));
            lstParams.Add(DataInstance.CreateTypedParameter("vIdenificationTypeId", IdenificationTypeId));
            lstParams.Add(DataInstance.CreateTypedParameter("vCustomerPublicId", CustomerPublicId));

            ADO.Models.ADOModelResponse response = DataInstance.ExecuteQuery(new ADO.Models.ADOModelRequest()
            {
                CommandExecutionType = ADO.Models.enumCommandExecutionType.DataTable,
                CommandText          = "P_Provider_GetByIdentification",
                CommandType          = System.Data.CommandType.StoredProcedure,
                Parameters           = lstParams
            });

            ProviderModel oReturn = null;

            if (response.DataTableResult != null &&
                response.DataTableResult.Rows.Count > 0)
            {
                oReturn = new ProviderModel()
                {
                    ProviderPublicId   = response.DataTableResult.Rows[0].Field <string>("ProviderPublicId"),
                    Name               = response.DataTableResult.Rows[0].Field <string>("Name"),
                    IdentificationType = new CatalogModel()
                    {
                        ItemId   = response.DataTableResult.Rows[0].Field <int>("IdentificationTypeId"),
                        ItemName = response.DataTableResult.Rows[0].Field <string>("IdentificationTypeName"),
                    },
                    IdentificationNumber = response.DataTableResult.Rows[0].Field <string>("IdentificationNumber"),
                    Email = response.DataTableResult.Rows[0].Field <string>("Email"),

                    CustomerPublicId = response.DataTableResult.Rows[0].Field <string>("CustomerPublicId"),
                    CustomerName     = response.DataTableResult.Rows[0].Field <string>("CustomerName"),

                    RelatedProviderCustomerInfo =
                        (from pci in response.DataTableResult.AsEnumerable()
                         where !pci.IsNull("ProviderCustomerInfoId")
                         select new ProviderInfoModel()
                    {
                        ProviderInfoId = pci.Field <int>("ProviderCustomerInfoId"),
                        ProviderInfoType = new CatalogModel()
                        {
                            ItemId = pci.Field <int>("ProviderCustomerInfoTypeId"),
                            ItemName = pci.Field <string>("ProviderCustomerInfoTypeName"),
                        },
                        Value = pci.Field <string>("ProviderCustomerInfoValue"),
                        LargeValue = pci.Field <string>("ProviderCustomerInfoLargeValue"),
                    }).ToList(),
                };
            }

            return(oReturn);
        }
        public CompanyCustomer.Models.Customer.CustomerModel GetCustomerByProvider(string ProviderPublicId, string vCustomerRelated)
        {
            List <System.Data.IDbDataParameter> lstParams = new List <System.Data.IDbDataParameter>();

            lstParams.Add(DataInstance.CreateTypedParameter("vProviderPublicId", ProviderPublicId));
            lstParams.Add(DataInstance.CreateTypedParameter("vCustomerRelated", vCustomerRelated));

            ADO.Models.ADOModelResponse response = DataInstance.ExecuteQuery(new ADO.Models.ADOModelRequest()
            {
                CommandExecutionType = ADO.Models.enumCommandExecutionType.DataTable,
                CommandText          = "CC_GetCustomerByProvider",
                CommandType          = System.Data.CommandType.StoredProcedure,
                Parameters           = lstParams,
            });

            CompanyCustomer.Models.Customer.CustomerModel oReturn = new Models.Customer.CustomerModel();

            if (response.DataTableResult != null &&
                response.DataTableResult.Rows.Count > 0)
            {
                oReturn = new Models.Customer.CustomerModel()
                {
                    RelatedProvider =
                        (from cpri in response.DataTableResult.AsEnumerable()
                         where !cpri.IsNull("CustomerPublicId")
                         group cpri by new
                    {
                        CustomerProviderId = cpri.Field <UInt64>("CustomerProviderId"),
                        CustomerPublicId = cpri.Field <string>("CustomerPublicId"),
                        CustomerName = cpri.Field <string>("CustomerName"),
                        StatusId = cpri.Field <UInt64>("StatusId"),
                        StatusName = cpri.Field <string>("StatusName"),
                        IsRelatedCustomer = cpri.Field <UInt64>("IsRelatedCustomer") == 1 ? true : false,
                    } into cprinf
                         select new ProveedoresOnLine.CompanyCustomer.Models.Customer.CustomerProviderModel()
                    {
                        CustomerProviderId = Convert.ToInt32(cprinf.Key.CustomerProviderId),
                        RelatedProvider = new Company.Models.Company.CompanyModel()
                        {
                            CompanyPublicId = cprinf.Key.CustomerPublicId,
                            CompanyName = cprinf.Key.CustomerName,
                        },
                        Status = new Company.Models.Util.CatalogModel()
                        {
                            ItemId = Convert.ToInt32(cprinf.Key.StatusId),
                            ItemName = cprinf.Key.StatusName,
                        },
                        Enable = cprinf.Key.IsRelatedCustomer,
                    }).ToList(),
                };
            }

            return(oReturn);
        }
Example #14
0
        public ProveedoresOnLine.AsociateProvider.Client.Models.HomologateModel GetHomologateItemBySourceID(Int32 SourceCode)
        {
            List <System.Data.IDbDataParameter> lstParams = new List <System.Data.IDbDataParameter>();

            lstParams.Add(DataInstance.CreateTypedParameter("vSource", SourceCode));

            ADO.Models.ADOModelResponse response = DataInstance.ExecuteQuery(new ADO.Models.ADOModelRequest()
            {
                CommandExecutionType = ADO.Models.enumCommandExecutionType.DataTable,
                CommandText          = "AP_GetHomologateItemBySourceId",
                CommandType          = System.Data.CommandType.StoredProcedure,
                Parameters           = lstParams,
            });

            ProveedoresOnLine.AsociateProvider.Client.Models.HomologateModel oReturn = null;

            if (response.DataTableResult != null &&
                response.DataTableResult.Rows.Count > 0)
            {
                oReturn = new ProveedoresOnLine.AsociateProvider.Client.Models.HomologateModel()
                {
                    HomologateId   = response.DataTableResult.Rows[0].Field <int>("HomologateId"),
                    HomologateType = new ProveedoresOnLine.AsociateProvider.Client.Models.CatalogModel()
                    {
                        CatalogId   = response.DataTableResult.Rows[0].Field <int>("HomologateTypecatalogId"),
                        CatalogName = response.DataTableResult.Rows[0].Field <string>("HomologateTypecatalogName"),
                        ItemId      = response.DataTableResult.Rows[0].Field <int>("HomologateTypeId"),
                        ItemName    = response.DataTableResult.Rows[0].Field <string>("HomologateTypeName"),
                    },

                    Source = new ProveedoresOnLine.AsociateProvider.Client.Models.CatalogModel()
                    {
                        CatalogId   = response.DataTableResult.Rows[0].Field <int>("SourceCatalogId"),
                        CatalogName = response.DataTableResult.Rows[0].Field <string>("SourceCatalogName"),
                        ItemId      = response.DataTableResult.Rows[0].Field <int>("SourceTypeId"),
                        ItemName    = response.DataTableResult.Rows[0].Field <string>("SourceTypeName"),
                    },

                    Target = new ProveedoresOnLine.AsociateProvider.Client.Models.CatalogModel()
                    {
                        CatalogId   = response.DataTableResult.Rows[0].Field <int>("TargetCatalogId"),
                        CatalogName = response.DataTableResult.Rows[0].Field <string>("TargetCatalogName"),
                        ItemId      = response.DataTableResult.Rows[0].Field <int>("TargetTypeId"),
                        ItemName    = response.DataTableResult.Rows[0].Field <string>("TargetTypeName"),
                    },

                    CreateDate = response.DataTableResult.Rows[0].Field <DateTime>("CreateDate"),
                    LastModify = response.DataTableResult.Rows[0].Field <DateTime>("LastModify"),
                };
            }

            return(oReturn);
        }
        public List <NotificationModel> NotificationGetByUser(string CompanyPublicId, string User, bool Enable)
        {
            List <System.Data.IDbDataParameter> lstParams = new List <IDbDataParameter>();

            lstParams.Add(DataInstance.CreateTypedParameter("vCompanyPublicId", CompanyPublicId));
            lstParams.Add(DataInstance.CreateTypedParameter("vUser", User));
            lstParams.Add(DataInstance.CreateTypedParameter("vEnable", Enable == true ? 1 : 0));

            ADO.Models.ADOModelResponse response = DataInstance.ExecuteQuery(new ADO.Models.ADOModelRequest()
            {
                CommandExecutionType = ADO.Models.enumCommandExecutionType.DataTable,
                CommandText          = "N_Notification_GetByUser",
                CommandType          = CommandType.StoredProcedure,
                Parameters           = lstParams,
            });

            List <NotificationModel> oReturn = null;

            if (response.DataTableResult != null &&
                response.DataTableResult.Rows.Count > 0)
            {
                oReturn =
                    (from n in response.DataTableResult.AsEnumerable()
                     where !n.IsNull("NotificationId")
                     group n by new
                {
                    NotificationId = n.Field <int>("NotificationId"),
                    CompanyPublicId = n.Field <string>("CompanyPublicId"),
                    Label = n.Field <string>("Label"),
                    Url = n.Field <string>("Url"),
                    User = n.Field <string>("User"),
                    NotificationType = n.Field <int>("NotificationType"),
                    NotificationEnable = n.Field <UInt64>("NotificationEnable"),
                    LastModify = n.Field <DateTime>("LastModify"),
                    CreateDate = n.Field <DateTime>("CreateDate"),
                }
                     into ng
                     select new NotificationModel()
                {
                    NotificationId = ng.Key.NotificationId,
                    CompanyPublicId = ng.Key.CompanyPublicId,
                    Label = ng.Key.Label,
                    Url = ng.Key.Url,
                    User = ng.Key.User,
                    NotificationType = ng.Key.NotificationType,
                    Enable = ng.Key.NotificationEnable == 1 ? true : false,
                    LastModify = ng.Key.LastModify,
                    CreateDate = ng.Key.CreateDate,
                }).ToList();
            }

            return(oReturn);
        }
Example #16
0
        public List <Models.CalificationProject.ConfigValidateModel> CalificationProjectConfigValidate_GetByProjectConfigId(int CalificationProjectConfigId, bool Enable)
        {
            List <System.Data.IDbDataParameter> lstParams = new List <IDbDataParameter>();

            lstParams.Add(DataInstance.CreateTypedParameter("vCalificationProjectConfigId", CalificationProjectConfigId));
            lstParams.Add(DataInstance.CreateTypedParameter("vEnable", Enable == true ? 1 : 0));

            ADO.Models.ADOModelResponse response = DataInstance.ExecuteQuery(new ADO.Models.ADOModelRequest()
            {
                CommandExecutionType = ADO.Models.enumCommandExecutionType.DataTable,
                CommandText          = "CC_CalificationProjectConfigValidate_GetByProjectConfigId",
                CommandType          = CommandType.StoredProcedure,
                Parameters           = lstParams
            });

            List <Models.CalificationProject.ConfigValidateModel> oReturn = new List <Models.CalificationProject.ConfigValidateModel>();

            if (response.DataTableResult != null && response.DataTableResult.Rows.Count > 0)
            {
                oReturn = (from cvm in response.DataTableResult.AsEnumerable()
                           where !cvm.IsNull("CalificationProjectConfigValidateId")
                           group cvm by new
                {
                    CalificationProjectConfigValidateId = cvm.Field <int>("CalificationProjectConfigValidateId"),
                    CalificationProjectConfigId = cvm.Field <int>("CalificationProjectConfigId"),
                    OperatorId = cvm.Field <int>("OperatorId"),
                    OperatorName = cvm.Field <string>("OperatorName"),
                    Value = cvm.Field <string>("Value"),
                    Result = cvm.Field <string>("Result"),
                    Enable = cvm.Field <UInt64>("Enable") == 1 ? true : false,
                    CreateDate = cvm.Field <DateTime>("CreateDate"),
                    LastModify = cvm.Field <DateTime>("LastModify")
                }
                           into cvmf
                           select new Models.CalificationProject.ConfigValidateModel()
                {
                    CalificationProjectConfigValidateId = cvmf.Key.CalificationProjectConfigValidateId,
                    CalificationProjectConfigId = cvmf.Key.CalificationProjectConfigId,
                    Operator = new Company.Models.Util.CatalogModel
                    {
                        ItemId = cvmf.Key.OperatorId,
                        ItemName = cvmf.Key.OperatorName
                    },
                    Value = cvmf.Key.Value,
                    Result = cvmf.Key.Result,
                    Enable = cvmf.Key.Enable,
                    CreateDate = cvmf.Key.CreateDate,
                    LastModify = cvmf.Key.LastModify
                }).ToList();
            }
            return(oReturn);
        }
Example #17
0
        public List <ChangesControlModel> ChangesControlSearch(string SearchParam, int PageNumber, int RowCount, out int TotalRows)
        {
            TotalRows = 0;

            List <System.Data.IDbDataParameter> lstParams = new List <System.Data.IDbDataParameter>();

            lstParams.Add(DataInstance.CreateTypedParameter("vSearchParam", SearchParam));
            lstParams.Add(DataInstance.CreateTypedParameter("vPageNumber", PageNumber));
            lstParams.Add(DataInstance.CreateTypedParameter("vRowCount", RowCount));

            ADO.Models.ADOModelResponse response = DataInstance.ExecuteQuery(new ADO.Models.ADOModelRequest()
            {
                CommandExecutionType = ADO.Models.enumCommandExecutionType.DataTable,
                CommandText          = "P_ChangesControl_Search",
                CommandType          = System.Data.CommandType.StoredProcedure,
                Parameters           = lstParams
            });

            List <ChangesControlModel> oReturn = new List <ChangesControlModel>();

            if (response.DataTableResult != null &&
                response.DataTableResult.Rows.Count > 0)
            {
                TotalRows = response.DataTableResult.Rows[0].Field <int>("TotalRows");

                oReturn =
                    (from c in response.DataTableResult.AsEnumerable()
                     where !c.IsNull("ProviderPublicId")
                     select new ChangesControlModel()
                {
                    ProviderPublicId = c.Field <string>("ProviderPublicId"),
                    Name = c.Field <string>("ProviderName"),
                    IdentificationNumber = c.Field <string>("IdentificationNumber"),
                    IdentificationType = new CatalogModel()
                    {
                        ItemId = c.Field <int>("IdentificationTypeId"),
                        ItemName = c.Field <string>("IdentificationType"),
                    },
                    Status = new CatalogModel()
                    {
                        ItemId = c.Field <int>("StatusId"),
                        ItemName = c.Field <string>("Status"),
                    },
                    FormUrl = c.Field <string>("FormPublicId"),
                    StepId = c.Field <int>("StepId"),
                    Enable = c.Field <UInt64>("ChangeEnable") == 1 ? true : false,

                    LastModify = c.Field <DateTime>("LastModify"),
                }).ToList();
            }
            return(oReturn);
        }
Example #18
0
        public List <LogManager.Models.LogModel> ProviderLog(string ProviderPublicId)
        {
            List <System.Data.IDbDataParameter> lstParams = new List <IDbDataParameter>();

            lstParams.Add(DataInstance.CreateTypedParameter("vProviderPublicId", ProviderPublicId));

            ADO.Models.ADOModelResponse response = DataInstance.ExecuteQuery(new ADO.Models.ADOModelRequest()
            {
                CommandExecutionType = ADO.Models.enumCommandExecutionType.DataTable,
                CommandText          = "P_ProviderLog_ByPublicId",
                CommandType          = CommandType.StoredProcedure,
                Parameters           = lstParams,
            });

            List <LogManager.Models.LogModel> oReturn = null;

            if (response.DataTableResult != null &&
                response.DataTableResult.Rows.Count > 0)
            {
                oReturn =
                    (from l in response.DataTableResult.AsEnumerable()
                     where !l.IsNull("LogId")
                     group l by new
                {
                    LogId = l.Field <int>("LogId"),
                    User = l.Field <string>("User"),
                    Source = l.Field <string>("Source"),
                    LogInfoId = l.Field <int>("LogInfoId"),
                    LogInfoType = l.Field <string>("LogInfoType"),
                    Name = l.Field <string>("Name"),
                    CreateDate = l.Field <DateTime>("CreateDate"),
                }
                     into li
                     select new LogManager.Models.LogModel()
                {
                    LogId = li.Key.LogId,
                    User = li.Key.User,
                    Source = li.Key.Source,
                    CreateDate = li.Key.CreateDate,
                    RelatedLogInfo = new List <LogManager.Models.LogInfoModel>()
                    {
                        new LogManager.Models.LogInfoModel()
                        {
                            LogInfoId = li.Key.LogInfoId,
                            LogInfoType = li.Key.LogInfoType,
                            Value = li.Key.Name,
                        }
                    }
                }).ToList();
            }
            return(oReturn);
        }
Example #19
0
        public List <Models.CalificationProject.ConfigItemModel> CalificationProjectConfigItem_GetByCalificationProjectConfigId(int CalificationProjectConfigId, bool Enable)
        {
            List <System.Data.IDbDataParameter> lstParams = new List <System.Data.IDbDataParameter>();

            lstParams.Add(DataInstance.CreateTypedParameter("vCalificationProjectConfigId", CalificationProjectConfigId));
            lstParams.Add(DataInstance.CreateTypedParameter("vEnable", Enable == true ? 1 : 0));

            ADO.Models.ADOModelResponse response = DataInstance.ExecuteQuery(new ADO.Models.ADOModelRequest()
            {
                CommandExecutionType = ADO.Models.enumCommandExecutionType.DataTable,
                CommandText          = "CC_CalificationProjectConfigItem_GetByConfigId",
                CommandType          = System.Data.CommandType.StoredProcedure,
                Parameters           = lstParams,
            });

            List <Models.CalificationProject.ConfigItemModel> oReturn = new List <Models.CalificationProject.ConfigItemModel>();

            if (response.DataTableResult != null &&
                response.DataTableResult.Rows.Count > 0)
            {
                oReturn =
                    (from cit in response.DataTableResult.AsEnumerable()
                     where !cit.IsNull("CalificationProjectConfigId")
                     group cit by new
                {
                    CalificationProjectConfigItemId = cit.Field <int>("CalificationProjectConfigItemId"),
                    CalificationProjectConfigId = cit.Field <int>("CalificationProjectConfigId"),
                    CalificationProjectConfigItemName = cit.Field <string>("CalificationProjectConfigItemName"),
                    CalicationProjecConfigItemTypeId = cit.Field <int>("CalicationProjecConfigItemTypeId"),
                    CalicationProjecConfigItemTypeName = cit.Field <string>("CalicationProjecConfigItemTypeName"),
                    Enable = cit.Field <UInt64>("Enable") == 1 ? true : false,
                    LastModify = cit.Field <DateTime>("LastModify"),
                    CreateDate = cit.Field <DateTime>("CreateDate"),
                }
                     into citg
                     select new Models.CalificationProject.ConfigItemModel()
                {
                    CalificationProjectConfigItemId = citg.Key.CalificationProjectConfigItemId,
                    CalificationProjectConfigItemName = citg.Key.CalificationProjectConfigItemName,
                    CalificationProjectConfigItemType = new Company.Models.Util.CatalogModel()
                    {
                        ItemId = citg.Key.CalicationProjecConfigItemTypeId,
                        ItemName = citg.Key.CalicationProjecConfigItemTypeName,
                    },
                    Enable = citg.Key.Enable,
                    LastModify = citg.Key.LastModify,
                    CreateDate = citg.Key.CreateDate,
                }).ToList();
            }

            return(oReturn);
        }
        public void NotificationDeleteById(int NotificationId)
        {
            List <System.Data.IDbDataParameter> lstParams = new List <IDbDataParameter>();

            lstParams.Add(DataInstance.CreateTypedParameter("vNotificationId", NotificationId));

            ADO.Models.ADOModelResponse response = DataInstance.ExecuteQuery(new ADO.Models.ADOModelRequest()
            {
                CommandExecutionType = ADO.Models.enumCommandExecutionType.NonQuery,
                CommandText          = "N_Notification_DeleteById",
                CommandType          = CommandType.StoredProcedure,
                Parameters           = lstParams,
            });
        }
        public List <Interfaces.Models.AsociateProvider.AsociateProviderModel> GetAllAsociateProvider(string SearchParam, int PageNumber, int RowCount, out int TotalRows)
        {
            List <System.Data.IDbDataParameter> lstParams = new List <System.Data.IDbDataParameter>();

            lstParams.Add(DataInstance.CreateTypedParameter("vSearchParam", SearchParam));
            lstParams.Add(DataInstance.CreateTypedParameter("vPageNumber", PageNumber));
            lstParams.Add(DataInstance.CreateTypedParameter("vRowCount", RowCount));

            ADO.Models.ADOModelResponse response = DataInstance.ExecuteQuery(new ADO.Models.ADOModelRequest()
            {
                CommandExecutionType = ADO.Models.enumCommandExecutionType.DataTable,
                CommandText          = "AP_GetAllAsociateProviders",
                CommandType          = System.Data.CommandType.StoredProcedure,
                Parameters           = lstParams,
            });

            TotalRows = 0;
            List <Interfaces.Models.AsociateProvider.AsociateProviderModel> oReturn = null;

            if (response.DataTableResult != null &&
                response.DataTableResult.Rows.Count > 0)
            {
                TotalRows = response.DataTableResult.Rows[0].Field <int>("TotalRows");
                oReturn   =
                    (from ap in response.DataTableResult.AsEnumerable()
                     where !ap.IsNull("AsociateProviderId")
                     select new AsociateProvider.Interfaces.Models.AsociateProvider.AsociateProviderModel()
                {
                    AsociateProviderId = ap.Field <int>("AsociateProviderId"),
                    RelatedProviderBO = new Interfaces.Models.AsociateProvider.RelatedProviderModel()
                    {
                        ProviderPublicId = ap.Field <string>("BO_ProviderPublicId"),
                        ProviderName = ap.Field <string>("BO_ProviderName"),
                        IdentificationType = ap.Field <int>("BO_IdentificationType").ToString(),
                        IdentificationNumber = ap.Field <string>("BO_IdentificationNumber"),
                    },
                    RelatedProviderDM = new Interfaces.Models.AsociateProvider.RelatedProviderModel()
                    {
                        ProviderPublicId = ap.Field <string>("DM_ProviderPublicId"),
                        ProviderName = ap.Field <string>("DM_ProviderName"),
                        IdentificationType = ap.Field <int>("DM_IdentificationType").ToString(),
                        IdentificationNumber = ap.Field <string>("DM_IdentificationNumber")
                    },
                    Email = ap.Field <string>("UserEmail"),
                    CreateDate = ap.Field <DateTime>("CreateDate"),
                    LastModify = ap.Field <DateTime>("LastModify"),
                }).ToList();
            }
            return(oReturn);
        }
        public void FieldDelete(int FieldId)
        {
            List <System.Data.IDbDataParameter> lstParams = new List <System.Data.IDbDataParameter>();

            lstParams.Add(DataInstance.CreateTypedParameter("vFieldId", FieldId));

            ADO.Models.ADOModelResponse response = DataInstance.ExecuteQuery(new ADO.Models.ADOModelRequest()
            {
                CommandExecutionType = ADO.Models.enumCommandExecutionType.NonQuery,
                CommandText          = "F_Field_Delete",
                CommandType          = System.Data.CommandType.StoredProcedure,
                Parameters           = lstParams
            });
        }
        public void FileUsedCreate(string Url)
        {
            List <System.Data.IDbDataParameter> lstParams = new List <System.Data.IDbDataParameter>();

            lstParams.Add(DataInstance.CreateTypedParameter("vUrl", Url));

            ADO.Models.ADOModelResponse response = DataInstance.ExecuteQuery(new ADO.Models.ADOModelRequest()
            {
                CommandExecutionType = ADO.Models.enumCommandExecutionType.NonQuery,
                CommandText          = "F_FileUsed_Create",
                CommandType          = System.Data.CommandType.StoredProcedure,
                Parameters           = lstParams
            });
        }
        public List <SanofiComercialInfoModel> GetComercialInfoByProvider(string vProviderPublicId)
        {
            List <System.Data.IDbDataParameter> lstparams = new List <System.Data.IDbDataParameter>();

            lstparams.Add(DataInstance.CreateTypedParameter("vProviderPublicId", vProviderPublicId));

            ADO.Models.ADOModelResponse response = DataInstance.ExecuteQuery(new ADO.Models.ADOModelRequest()
            {
                CommandExecutionType = ADO.Models.enumCommandExecutionType.DataTable,
                CommandText          = "Sanofi_GetComercialInfo",
                CommandType          = CommandType.StoredProcedure,
                Parameters           = lstparams,
            });

            List <SanofiComercialInfoModel> oReturn = new List <SanofiComercialInfoModel>();

            if (response.DataTableResult != null && response.DataTableResult.Rows.Count > 0)
            {
                oReturn =
                    (
                        from sci in response.DataTableResult.AsEnumerable()
                        where !sci.IsNull("CompanyId")
                        group sci by new
                {
                    CompanyId = sci.Field <int>("CompanyId"),
                    CompanyName = sci.Field <string>("CompanyName"),
                    IdentificationNumber = sci.Field <string>("IdentificationNumber"),
                    FiscalNumber = sci.Field <string>("FiscalNumber"),
                    NIF_Type = sci.Field <string>("NIF_Type"),
                    PayCondition = sci.Field <string>("PayCondition"),
                    GroupSchemaProvider = sci.Field <int>("GroupSchemaProvider"),
                    ContactName = sci.Field <string>("ContactName"),
                    ComprasCod = sci.Field <string>("ComprasCod"),
                }
                        into scig
                        select new SanofiComercialInfoModel()
                {
                    CompanyId = scig.Key.CompanyId,
                    CompanyName = scig.Key.CompanyName,
                    IdentificationNumber = scig.Key.IdentificationNumber,
                    FiscalNumber = scig.Key.FiscalNumber,
                    NIFType = scig.Key.NIF_Type,
                    PayCondition = scig.Key.PayCondition,
                    GroupSchemaProvider = scig.Key.GroupSchemaProvider,
                    ContactName = scig.Key.ContactName,
                    BuyCod = scig.Key.ComprasCod
                }).ToList();
            }
            return(oReturn);
        }
Example #25
0
        public void DeleteUserRoles(int AplicationRoleId)
        {
            List <System.Data.IDbDataParameter> lstParams = new List <IDbDataParameter>();

            lstParams.Add(DataInstance.CreateTypedParameter("vApplicationRoleId", AplicationRoleId));

            ADO.Models.ADOModelResponse response = DataInstance.ExecuteQuery(new ADO.Models.ADOModelRequest()
            {
                CommandExecutionType = ADO.Models.enumCommandExecutionType.NonQuery,
                CommandText          = "A_ApplicationRole_Delete",
                CommandType          = System.Data.CommandType.StoredProcedure,
                Parameters           = lstParams
            });
        }
        public void FormUpsertLogo(string FormPublicId, string Logo)
        {
            List <System.Data.IDbDataParameter> lstParams = new List <System.Data.IDbDataParameter>();

            lstParams.Add(DataInstance.CreateTypedParameter("vFormPublicId", FormPublicId));
            lstParams.Add(DataInstance.CreateTypedParameter("vLogo", Logo));

            ADO.Models.ADOModelResponse response = DataInstance.ExecuteQuery(new ADO.Models.ADOModelRequest()
            {
                CommandExecutionType = ADO.Models.enumCommandExecutionType.NonQuery,
                CommandText          = "F_Form_UpsertLogo",
                CommandType          = System.Data.CommandType.StoredProcedure,
                Parameters           = lstParams
            });
        }
        public void StepModify(int StepId, string Name, int Position)
        {
            List <System.Data.IDbDataParameter> lstParams = new List <System.Data.IDbDataParameter>();

            lstParams.Add(DataInstance.CreateTypedParameter("vStepId", StepId));
            lstParams.Add(DataInstance.CreateTypedParameter("vName", Name));
            lstParams.Add(DataInstance.CreateTypedParameter("vPosition", Position));

            ADO.Models.ADOModelResponse response = DataInstance.ExecuteQuery(new ADO.Models.ADOModelRequest()
            {
                CommandExecutionType = ADO.Models.enumCommandExecutionType.NonQuery,
                CommandText          = "F_Step_Modify",
                CommandType          = System.Data.CommandType.StoredProcedure,
                Parameters           = lstParams
            });
        }
        public void LogInfoCreate(int LogId, string LogInfoType, string Value)
        {
            List <System.Data.IDbDataParameter> lstParams = new List <System.Data.IDbDataParameter>();

            lstParams.Add(DataInstance.CreateTypedParameter("vLogId", LogId));
            lstParams.Add(DataInstance.CreateTypedParameter("vLogInfoType", LogInfoType));
            lstParams.Add(DataInstance.CreateTypedParameter("vValue", Value));

            ADO.Models.ADOModelResponse response = DataInstance.ExecuteQuery(new ADO.Models.ADOModelRequest()
            {
                CommandExecutionType = ADO.Models.enumCommandExecutionType.NonQuery,
                CommandText          = "L_LogInfo_Create",
                CommandType          = System.Data.CommandType.StoredProcedure,
                Parameters           = lstParams
            });
        }
Example #29
0
        public void AP_AsociateProviderUpsert(string BOProviderPublicId, string DMProviderPublicId, string Email)
        {
            List <System.Data.IDbDataParameter> lstParams = new List <System.Data.IDbDataParameter>();

            lstParams.Add(DataInstance.CreateTypedParameter("vDM_ProviderPublicId", DMProviderPublicId));
            lstParams.Add(DataInstance.CreateTypedParameter("vBO_ProviderPublicId", BOProviderPublicId));
            lstParams.Add(DataInstance.CreateTypedParameter("vUserEmail", Email));

            ADO.Models.ADOModelResponse response = DataInstance.ExecuteQuery(new ADO.Models.ADOModelRequest()
            {
                CommandExecutionType = ADO.Models.enumCommandExecutionType.Scalar,
                CommandText          = "AP_AsociateProviderUpsert",
                CommandType          = System.Data.CommandType.StoredProcedure,
                Parameters           = lstParams,
            });
        }
Example #30
0
        public void AP_AsociateRelatedCustomerProvider(string CustomerPublicId, string ProviderPublicId, bool Enable)
        {
            List <System.Data.IDbDataParameter> lstParams = new List <IDbDataParameter>();

            lstParams.Add(DataInstance.CreateTypedParameter("vCustomerPublicId", CustomerPublicId));
            lstParams.Add(DataInstance.CreateTypedParameter("vProviderPublicId", ProviderPublicId));
            lstParams.Add(DataInstance.CreateTypedParameter("vEnable", Enable == true ? 1 : 0));

            ADO.Models.ADOModelResponse response = DataInstance.ExecuteQuery(new ADO.Models.ADOModelRequest()
            {
                CommandExecutionType = ADO.Models.enumCommandExecutionType.NonQuery,
                CommandText          = "AP_RelatedCustomer",
                CommandType          = CommandType.StoredProcedure,
                Parameters           = lstParams,
            });
        }