Example #1
0
        private static void SetMailOptions() {

            DaoFactory factory = null;

            if (string.IsNullOrEmpty(Server)) {

                factory = new DaoFactory();

                Server = factory.DaoConfigOption().Select(
                    new ConfigOption { Code = "MAILSERVER" }).First().DefValue;

                User = factory.DaoConfigOption().Select(
                    new ConfigOption { Code = "MAILUSER" }).First().DefValue;

                Password = factory.DaoConfigOption().Select(
                    new ConfigOption { Code = "MAILPASSWD" }).First().DefValue;

                Domain = factory.DaoConfigOption().Select(
                    new ConfigOption { Code = "MAILDOMAIN" }).First().DefValue;

                HtmlEnvelope = factory.DaoConfigOption().Select(
                    new ConfigOption { Code = "HTMLENVELOPE" }).First().DefValue;

                try
                {
                    EnableSSL = factory.DaoConfigOption().Select(
                      new ConfigOption { Code = "MAILSSL" }).First().DefValue == "T";
                }
                catch { EnableSSL = false; }

            }

        }
        //Constructor
        public TransactionMngr()
        {
            Factory = new DaoFactory();

            WType = new WmsTypes(Factory);
            LblMngr = new LabelMngr();
            DocMngr = new DocumentMngr();
            ErpMngr = new ErpDataMngr();
            Rules = new Rules(Factory);
        }
Example #3
0
 //Constructor
 public Control()
 {
     Factory = new DaoFactory();
     DocMngr = new DocumentMngr();
     LabelMngr = new LabelMngr();
     TranMngr = new TransactionMngr();
     ErpMngr = new ErpDataMngr();
     RptMngr = new ReportMngr();
     BasicMngr = new BasicMngr();
     MsgMngr = new MessageMngr();
     WType = new WmsTypes();
 }
Example #4
0
 public DaoWFDataType(DaoFactory factory) : base(factory) { }
Example #5
0
 public DaoBinRoute (DaoFactory factory) : base(factory) { }
Example #6
0
 public ReportMngr()
 { Factory = new DaoFactory(); }
Example #7
0
        private static void UpdateLabelPrintStatus()
        {
            DaoFactory f = new DaoFactory();

            if (sListLabels == null || sListLabels.Count == 0)
                return;


            foreach (Label label in sListLabels)
            {
                if (label.Printed == true || label.LabelID == 0)
                    continue;

                label.Printed = true;
                f.DaoLabel().Update(label);
            }
        }
Example #8
0
 public WriteLog() { Factory = new DaoFactory(); }
Example #9
0
 public BasicMngr()
 {
     Factory = new DaoFactory();
     Wtype = new WmsTypes(Factory);
 }
Example #10
0
 protected DaoService(DaoFactory factory)
 {
     Factory = factory;
 }
Example #11
0
 public DaoDataInformation (DaoFactory factory) : base(factory) { }
        private void ProcessErpAccounts(IList<Account> list)
        {

            if (list == null)
                return;


            DaoFactory Factory = new DaoFactory();

            Account qAcc = null;
            AccountAddress curLine;
            AccountTypeRelation curAccType;


            foreach (Account e in list)
            {
                try
                {


                    qAcc = new Account();
                    qAcc.Company = e.Company;
                    qAcc.AccountCode = e.AccountCode;
                    qAcc.BaseType = e.BaseType;

                    //Evalua si la entidad ya existe 
                    IList<Account> exList = Factory.DaoAccount().Select(qAcc);
                    e.ModDate = DateTime.Now;
                    e.ModifiedBy = WmsSetupValues.SystemUser;

                    //Si existe
                    if (exList.Count == 0)
                    {
                        e.CreationDate = DateTime.Now;
                        e.CreatedBy = WmsSetupValues.SystemUser;
                        Factory.DaoAccount().Save(e);
                    }
                    else
                    {
                        e.AccountID = exList.First().AccountID;
                        e.CreatedBy = exList.First().CreatedBy;
                        e.CreationDate = exList.First().CreationDate;

                        //Preservar
                        e.UserDefine1 = exList.First().UserDefine1; //Shipping Mails


                        //Evaluar los Account Types
                        int i = 0;
                        foreach (AccountTypeRelation line in e.AccountTypes)
                        {
                            curAccType = new AccountTypeRelation();
                            curAccType.Account = e;
                            curAccType.ErpCode = line.ErpCode;
                            curAccType.AccountType = line.AccountType;
                            IList<AccountTypeRelation> listLines = Factory.DaoAccountTypeRelation().Select(curAccType);

                            if (listLines.Count > 0)
                            {
                                e.AccountTypes[i].ModDate = DateTime.Now;
                                e.AccountTypes[i].ModifiedBy = WmsSetupValues.SystemUser;
                                e.AccountTypes[i].CreationDate = listLines.First().CreationDate;
                                e.AccountTypes[i].CreatedBy = listLines.First().CreatedBy;
                                e.AccountTypes[i].RowID = listLines.First().RowID;
                            }
                            else
                            {
                                e.AccountTypes[i].CreationDate = DateTime.Now;
                                e.AccountTypes[i].CreatedBy = WmsSetupValues.SystemUser;
                            }

                            i++;
                        }


                        //Evaluar los document Lines
                        i = 0;
                        foreach (AccountAddress line in e.AccountAddresses)
                        {
                            curLine = new AccountAddress();
                            curLine.Account = e;
                            curLine.ErpCode = line.ErpCode;
                            IList<AccountAddress> listLines = Factory.DaoAccountAddress().Select(curLine);

                            if (listLines.Count > 0)
                            {
                                e.AccountAddresses[i].ModDate = DateTime.Now;
                                e.AccountAddresses[i].ModifiedBy = WmsSetupValues.SystemUser;
                                e.AccountAddresses[i].AddressID = listLines.First().AddressID;
                                e.AccountAddresses[i].CreationDate = listLines.First().CreationDate;
                                e.AccountAddresses[i].CreatedBy = listLines.First().CreatedBy;
                            }
                            else
                            {
                                e.AccountAddresses[i].CreationDate = DateTime.Now;
                                e.AccountAddresses[i].CreatedBy = WmsSetupValues.SystemUser;
                            }

                            i++;
                        }

                        Factory.DaoAccount().Update(e);
                    }

                }
                catch (Exception ex)
                {
                    Factory.Rollback();
                    ExceptionMngr.WriteEvent("ProcessErpAccounts:" + qAcc.Name, ListValues.EventType.Fatal, ex, null, ListValues.ErrorCategory.Business);
                    ////throw;
                }
            }


        }
Example #13
0
 public WmsTypes(DaoFactory factory)
 {
     Factory = factory;
 }
Example #14
0
 public WmsTypes()
 {
     Factory = new DaoFactory();
 }
Example #15
0
 public DaoObject(DaoFactory factory) : base(factory) { }
 public DaoDataDefinitionByBin (DaoFactory factory) : base(factory) { }
Example #17
0
 public LabelMngr()
  {
      Factory = new DaoFactory();
      WType = new WmsTypes(Factory);
  }
Example #18
0
        public static IList<ShowData> GetDomainList()
        {
            IList<ShowData> domainList = new List<ShowData>();

            ShowData curDomain;

            //Use LDAP Authentication - read Option
            DaoFactory factory = new DaoFactory();
            try
            {
                string ldapConfig = factory.DaoConfigOption().Select(new ConfigOption { Code = "USELDAP" }).FirstOrDefault().DefValue;
                
                //Muestra dominios si la opcion es True
                if (ldapConfig == "T")
                {

                    DirectoryEntry en = new DirectoryEntry("LDAP://");
                    // Search for objectCategory type "Domain"
                    DirectorySearcher srch = new DirectorySearcher("objectCategory=Domain");
                    SearchResultCollection coll = srch.FindAll();
                    // Enumerate over each returned domain.
                    foreach (SearchResult rs in coll)
                    {
                        curDomain = new ShowData();
                        ResultPropertyCollection resultPropColl = rs.Properties;
                        foreach (object domainKey in resultPropColl["name"])
                        {
                            curDomain.DataKey = domainKey.ToString().ToUpper();

                            foreach (object domainPath in resultPropColl["adspath"])
                                curDomain.DataValue = domainPath.ToString();
                        }

                        domainList.Add(curDomain);
                    }
                }
            }
            catch { }

            //Adding Default Domain
            domainList.Add(new ShowData { DataKey = "WMSEXPRESS", DataValue = "" });

            return domainList;

        }
Example #19
0
        public static IList<ShowData> GetCustomersList()
        {
            //Variables Auxiliares
            IList<ShowData> CustomerList = new List<ShowData>();
            ShowData Customer;
            IList<Location> ListadoClientes;
            DaoFactory factory = new DaoFactory();

            //Obtenemos el listado de clientes habilitados, Status = 1001
            ListadoClientes = factory.DaoLocation().Select(new Location { Status = new Status { StatusID = 1001 } });

            //Recorro el listado de clientes y creo el listado
            foreach (Location Cliente in ListadoClientes)
            {
                //Inicializo la variable del cliente
                Customer = new ShowData();

                //Asigno los datos
                Customer.DataKey = Cliente.Name;
                Customer.DataValue = Cliente.LocationID.ToString();

                //Adicionamos el cliente al listado
                CustomerList.Add(Customer);
            }

            return CustomerList;
        }
Example #20
0
 public LDAPAuth()
 {
     Factory = new DaoFactory();
 }
Example #21
0
 //Constructor
 public Rules(DaoFactory factory)
 { Factory = factory; }
Example #22
0
 protected DaoService(DaoFactory factory)
 {
     Factory = factory;
 }