public WorkflowUtilities()
 {
     this._flexableDto = new OrderDto();
     this._validate = new ValidationTools();
     this._stateBus = new StateBusiness();
     this._prodBus = new ProductBusiness();
 }
 public TeamLeaderForm1()
 {
     InitializeComponent();
     _tasksBusiness   = new TasksBusiness();
     _tasks           = new Tasks();
     _projectBusiness = new ProjectBusiness();
     _stateBusiness   = new StateBusiness();
 }
        public async Task <List <NiazmandyHaCityBusiness> > GetAllCityFromNiazMandyHa()
        {
            var cities = new List <NiazmandyHaCityBusiness>();

            try
            {
                var states = await StateBusiness.GetAllAsync();

                states  = states.OrderBy(q => q.StateName).ToList();
                _driver = Utility.RefreshDriver(_driver);
                _driver.Navigate().GoToUrl("https://niazmandyha.ir/panel/ads");
                var a = await AdvTokensBusiness.GetAllAsync();

                var tok = a.FirstOrDefault(q => !string.IsNullOrEmpty(q.Token) && q.Type == AdvertiseType.NiazmandyHa);
                var sim = await SimCardBusiness.GetAsync(tok.Number);

                _driver.FindElement(By.Id("username")).SendKeys(sim.UserName);
                _driver.FindElement(By.Id("password")).SendKeys("0" + sim.Number + "\n");
                var linksElement = _driver.FindElements(By.ClassName("black"))
                                   .FirstOrDefault(q => q.Text == "خروج");
                if (linksElement != null)
                {
                    _driver.Navigate().GoToUrl("https://niazmandyha.ir/panel/ads");
                    _driver.FindElement(By.ClassName("white")).Click();
                    foreach (var item in states)
                    {
                        await Utility.Wait();

                        _driver.FindElement(By.Name("state")).Click();
                        await Utility.Wait();

                        _driver.FindElements(By.TagName("option"))
                        .FirstOrDefault(q => q.Text.Contains(item.StateName))?.Click();
                        await Utility.Wait(1);

                        var tt = _driver.FindElement(By.Name("city")).FindElements(By.TagName("option")).ToList()
                                 .Select(q => q?.Text);

                        cities.AddRange(from t in tt
                                        where t != "انتخاب کنید" && t != "همه شهرها"
                                        select new NiazmandyHaCityBusiness()
                        {
                            Guid = Guid.NewGuid(), Modified = DateTime.Now, CityName = t?.Trim()
                        });
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
                throw;
            }

            return(cities);
        }
 public BusinessAnalystForm1()
 {
     _taskBusiness         = new TasksBusiness();
     _projectBusiness      = new ProjectBusiness();
     _tasks                = new Tasks();
     _employeeBusiness     = new EmployeeBusiness();
     _employeeTasks        = new EmployeeTasks();
     _employeeTaskBusiness = new EmployeeTasksBusiness();
     _stateBusiness        = new StateBusiness();
     InitializeComponent();
 }
Exemple #5
0
 public TestingSpecialistForm1()
 {
     InitializeComponent();
     _projectBusiness      = new ProjectBusiness();
     _tasksBusiness        = new TasksBusiness();
     _stateBusiness        = new StateBusiness();
     _tasks                = new Tasks();
     _employeeTaskBusiness = new EmployeeTasksBusiness();
     _employeeTask         = new EmployeeTasks();
     _employeeBusiness     = new EmployeeBusiness();
 }
 public DeveloperForm1()
 {
     InitializeComponent();
     _tasksBusiness         = new TasksBusiness();
     _projectBusiness       = new ProjectBusiness();
     _stateBusiness         = new StateBusiness();
     _employee              = new Employee();
     _tasks                 = new Tasks();
     _state                 = new State();
     _employeeBusiness      = new EmployeeBusiness();
     _employeeTasksBusiness = new EmployeeTasksBusiness();
 }
Exemple #7
0
 public object DeleteState([FromBody] UpdateState PM)
 {
     try
     {
         StateBusiness b      = new StateBusiness();
         var           Result = b.DeleteState(PM);
         return(Result);
     }
     catch (Exception e)
     {
         return(new Error()
         {
             IsError = true, Message = e.Message
         });
     }
 }
Exemple #8
0
 public object AddTaluka([FromBody] TalukaParam obj)
 {
     try
     {
         StateBusiness save   = new StateBusiness();
         var           result = save.SaveTaluka(obj);
         return(result);
     }
     catch (Exception e)
     {
         return(new Error()
         {
             IsError = true, Message = e.Message
         });
     }
 }
 private StateEntity SelectStateById(int id)
 {
     try
     {
         using (var employees = new StateBusiness())
         {
             return(employees.SelectStateById(id));
         }
     }
     catch (Exception ex)
     {
         //Log exception error
         _loggingHandler.LogEntry(ExceptionHandler.GetExceptionMessageFormatted(ex), true);
     }
     return(null);
 }
 private List <StateEntity> ListAllStates()
 {
     try
     {
         using (var states = new StateBusiness())
         {
             return(states.SelectAllStates());
         }
     }
     catch (Exception ex)
     {
         //Log exception error
         _loggingHandler.LogEntry(ExceptionHandler.GetExceptionMessageFormatted(ex), true);
     }
     return(null);
 }
Exemple #11
0
        public object UpdateState(UpdateState b)
        {
            try
            {
                StateBusiness state  = new StateBusiness();
                var           Result = state.StateUpdate(b);

                return(Result);
            }
            catch (Exception e)
            {
                return(new Error()
                {
                    IsError = true, Message = e.Message
                });
            }
        }
Exemple #12
0
        public object GetStateInfo(UserCredential uc)
        {
            try
            {
                StateBusiness state  = new StateBusiness();
                var           Result = state.GetState(uc);

                return(Result);
            }
            catch (Exception e)
            {
                return(new Error()
                {
                    IsError = true, Message = e.Message
                });
            }
        }
Exemple #13
0
        public object GetStateUnderTaluka([FromBody] TalukaParam d)
        {
            try
            {
                StateBusiness state  = new StateBusiness();
                var           Result = state.GetStateunderDistrict(d);

                return(Result);
            }
            catch (Exception e)
            {
                return(new Error()
                {
                    IsError = true, Message = e.Message
                });
            }
        }
Exemple #14
0
        public object UpdateTaluka(TalukaParam b)
        {
            try
            {
                StateBusiness taluka = new StateBusiness();
                var           Result = taluka.TalukaUpdate(b);

                return(Result);
            }
            catch (Exception e)
            {
                return(new Error()
                {
                    IsError = true, Message = e.Message
                });
            }
        }
Exemple #15
0
        public object UpdateDistrict(DistrictParam b)
        {
            try
            {
                StateBusiness district = new StateBusiness();
                var           Result   = district.DistrictUpdate(b);

                return(Result);
            }
            catch (Exception e)
            {
                return(new Error()
                {
                    IsError = true, Message = e.Message
                });
            }
        }
Exemple #16
0
        public object GetDistrictInfo([FromBody] UserCredential uc)
        {
            try
            {
                StateBusiness district = new StateBusiness();
                var           Result   = district.GetDistrict(uc);

                return(Result);
            }
            catch (Exception e)
            {
                return(new Error()
                {
                    IsError = true, Message = e.Message
                });
            }
        }
 private void InsertState(string name)
 {
     try
     {
         using (var states = new StateBusiness())
         {
             var entity = new StateEntity();
             entity.StateName = name;
             var opSuccessful = states.InsertState(entity);
         }
     }
     catch (Exception ex)
     {
         //Log exception error
         _loggingHandler.LogEntry(ExceptionHandler.GetExceptionMessageFormatted(ex), true);
     }
 }
Exemple #18
0
 public StateItemsTagHelper(StateBusiness stateBusiness) {
     this._stateBusiness = stateBusiness;
 }
Exemple #19
0
        public async Task <List <NiazCityBusiness> > GetAllCityFromNiazKade()
        {
            var cities = new List <NiazCityBusiness>();
            var states = await StateBusiness.GetAllAsync();

            _driver = RefreshDriver(_driver);
            _driver.Navigate().GoToUrl("https://www.niazkade.com");
            try
            {
                foreach (var stateItem in states)
                {
                    await Wait();

                    _driver.FindElement(By.ClassName("vs__selected-options")).FindElement(By.TagName("input"))
                    ?.SendKeys(stateItem.StateName + "\n");
                    await Wait(2);

                    string name = null;

                    _driver.FindElements(By.ClassName("vs__selected-options")).LastOrDefault()?.Click();
                    await Wait();

                    var cc = _driver
                             .FindElement(By.ClassName("vs__city_select")).FindElements(By.TagName("ul")).ToArray();
                    if (!cc.Any())
                    {
                        continue;
                    }

                    foreach (var li in cc.ElementAt(0).Text)
                    {
                        if (name == "")
                        {
                            continue;
                        }
                        if (li == '\r' || li == '\n')
                        {
                            if (string.IsNullOrEmpty(name))
                            {
                                continue;
                            }
                            var a = new NiazCityBusiness
                            {
                                Guid     = Guid.NewGuid(),
                                Modified = DateTime.Now,
                                CityName = name
                            };
                            cities.Add(a);
                            name = null;
                            continue;
                        }
                        name = name + li;
                    }

                    await Wait();

                    _driver.FindElement(By.ClassName("vs__selected-options")).FindElement(By.TagName("input"))
                    ?.SendKeys("");
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
                throw;
            }

            return(cities);
        }