예제 #1
0
        //[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme, Policy = "Admin")]
        //[HttpPost]
        public void RezOnayla([FromBody] int id)
        {
            IDBManager        dBManager = new MSSQLDBManager();
            IPlanlamaProvider pProvider = new PlanlamaProvider(dBManager);

            pProvider.RezOnaylaQuery(id);
        }
예제 #2
0
        //[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme, Policy = "Admin")]
        //[HttpDelete]
        public void DeleteOnayBekleyenYuklemeler(int id)
        {
            IDBManager        dBManager = new MSSQLDBManager();
            IPlanlamaProvider pProvider = new PlanlamaProvider(dBManager);

            pProvider.DeleteOnayBekleyenYuklemelerQuery(id);
        }
예제 #3
0
        //[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme, Policy = "Admin")]
        //[HttpPost]
        public void UpdateOnaylanmisRezervasyonYapilmamisEmirler([FromBody] PlanlamaBase obj)
        {
            IDBManager        dBManager = new MSSQLDBManager();
            IPlanlamaProvider pProvider = new PlanlamaProvider(dBManager);

            pProvider.UpdateORYEQuery(obj);
        }
예제 #4
0
        public void SendNotifications()
        {
            IDBManager   dBManager = new MSSQLDBManager();
            QueueService qs        = new QueueService(dBManager);

            qs.DequeueAndProcess();
        }
예제 #5
0
        //[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme, Policy = "Admin")]
        //[HttpPost]
        public void UpdateOnayBekleyenYuklemeler([FromBody] PlanlamaBase obj)
        {
            IDBManager        dBManager = new MSSQLDBManager();
            IPlanlamaProvider pProvider = new PlanlamaProvider(dBManager);

            pProvider.UpdateOBYCmdQuery(obj);
        }
예제 #6
0
        public void DeleteOnayBekleyenYuklemeler([FromBody] int id) // postman +
        {
            IDBManager        dBManager = new MSSQLDBManager();
            IPlanlamaProvider pProvider = new PlanlamaProvider(dBManager);

            pProvider.DeleteOnayBekleyenYuklemelerQuery(id);
        }
        public void DeleteOnayBekleyenYuklemelerQuery(int keyId)
        {
            //Dictionary<string, object> columnValues = new Dictionary<string, object>();
            MSSQLDBManager mSSQLDB = new MSSQLDBManager();

            mSSQLDB.DeleteTableRow("tblYuklemeEmirleri", "Id", keyId);
        }
예제 #8
0
        //[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme, Policy ="Admin")]
        //[HttpGet]
        public List <UretimYeri> GetUretimYerleri()
        {
            IDBManager        dBManager = new MSSQLDBManager();
            IPlanlamaProvider pProvider = new PlanlamaProvider(dBManager);
            var yuklemeNoktalariList    = pProvider.GetUretimYerleriList();

            return(yuklemeNoktalariList);
        }
예제 #9
0
        //[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme, Policy = "Admin")]
        //[HttpGet]
        public List <YuklemeNoktasiBase> GetYuklemeNoktalari()
        {
            IDBManager        dBManager = new MSSQLDBManager();
            IPlanlamaProvider pProvider = new PlanlamaProvider(dBManager);
            var yuklemeNoktalariList    = pProvider.GetYuklemeNoktasiList();

            return(yuklemeNoktalariList);
        }
예제 #10
0
        //[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme, Policy = "Admin")]
        //[HttpGet]
        public List <PlanlamaBase> GetOnaylanmisRezYapilmamisEmirler()
        {
            IDBManager        dBManager = new MSSQLDBManager();
            IPlanlamaProvider pProvider = new PlanlamaProvider(dBManager);
            var data = pProvider.GetOnaylanmisRezYapilmamisEmirlerData();

            return(data);
        }
예제 #11
0
        //[Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme, Policy = "Admin")]

        public IEnumerable <PlanlamaBase> GetOnayBekleyenYuklemeler()
        {
            IDBManager        dBManager = new MSSQLDBManager();
            IPlanlamaProvider pProvider = new PlanlamaProvider(dBManager);
            var data = pProvider.GetOnayBekleyenYuklemelerData();

            return(data);
        }
        public IEnumerable <RezervasyonBase> GetRezYapilmisYuklemeEmirleri()
        {
            IDBManager           dBManager = new MSSQLDBManager();
            IRezervasyonProvider rProvider = new RezervasyonProvider(dBManager);
            var data = rProvider.GetRezervasyonYapilmisYE(1);

            return(data);
        }
예제 #13
0
        public IEnumerable <RezervasyonBase> GetRezBekleyenYuklemeEmirleri([FromBody] int nakliyeciId)
        {
            IDBManager           dBManager = new MSSQLDBManager();
            IRezervasyonProvider rProvider = new RezervasyonProvider(dBManager);
            var data = rProvider.GetRezervasyonBekleyenYE(nakliyeciId);

            return(data);
        }
        public void RezOnaylaQuery(int keyId)
        {
            DateTime selected_row_date = DateTime.Now;
            Dictionary <string, object> columnValues = new Dictionary <string, object>();

            columnValues.Add("OnayZamani", selected_row_date);
            columnValues.Add("YuklemeStatus", 1);

            MSSQLDBManager mSSQLDB = new MSSQLDBManager();

            mSSQLDB.UpdateTableRow("tblYuklemeEmirleri", columnValues, "Id", keyId);
        }
예제 #15
0
        private List <Claim> ValidateUserAndAssignClaims(LoginInfo user)
        {
            List <Claim> someClaims  = new List <Claim>();
            String       checkUQuery = "SELECT * FROM [tblUser] WHERE Username=@Username AND Password=@Password";

            SqlParameter[] parameters = new SqlParameter[2] {
                new SqlParameter("@Username", user.UserName),
                new SqlParameter("@Password", user.Password)
            };
            IDBManager dBManager = new MSSQLDBManager();
            var        dataTable = dBManager.ExecuteQuery(checkUQuery, parameters);
            LoginInfo  db_result = new LoginInfo();

            db_result = null;
            if (dataTable.Rows.Count == 1)
            {
                int.TryParse(dataTable.Rows[0]["UserType"].ToString(), out int usertype);
                string username = dataTable.Rows[0]["Username"].ToString();
                someClaims.Add(new Claim(JwtRegisteredClaimNames.UniqueName, username));
                someClaims.Add(new Claim(JwtRegisteredClaimNames.NameId, Guid.NewGuid().ToString()));
                someClaims.Add(new Claim(ClaimTypes.Role, "Basic"));

                if (usertype == 1)
                {
                    int.TryParse(dataTable.Rows[0]["NakliyeFirmasiId"].ToString(), out int nakliyeFirmasiId);
                    someClaims.Add(new Claim("NakliyeFirmasiId", nakliyeFirmasiId.ToString()));

                    int.TryParse(dataTable.Rows[0]["ProductionLocationId"].ToString(), out int productionLocationId);
                    someClaims.Add(new Claim("ProductionLocationId", productionLocationId.ToString()));
                    return(someClaims);
                }

                if (usertype == 2)
                {
                    someClaims.Add(new Claim(ClaimTypes.Role, "Admin"));
                    return(someClaims);
                }
            }

            return(null);
        }