Beispiel #1
0
        protected void modifiko()
        {
            DataClasses1DataContext financa_sh = new DataClasses1DataContext();
            Cmimet cm = new Cmimet();
            var    sk = from c in financa_sh.Skontos
                        select c;

            if (sk.Count() == 0)
            {
                var cm_viti = from c in financa_sh.Cmimets
                              where (c.Viti_shkollor == vitiddl1.SelectedItem.Text) && (c.Klasa == Convert.ToInt16(Klasaddl.SelectedItem.Text))
                              select c;
                cm_viti.FirstOrDefault().Cmimi       = Convert.ToInt32(TextBox1.Text);
                cm_viti.FirstOrDefault().Cmimi_trans = Convert.ToDecimal(TextBox2.Text);
                cm_viti.FirstOrDefault().Prenotimi   = Convert.ToInt32(TextBox3.Text);

                cm_viti.FirstOrDefault().Valuta           = DropDownList1.SelectedItem.Text;
                cm_viti.FirstOrDefault().Valuta_trans     = DropDownList2.SelectedItem.Text;
                cm_viti.FirstOrDefault().Valuta_prenotimi = DropDownList3.SelectedItem.Text;
                financa_sh.SubmitChanges();
                msbox("Cmimet u modifikuan !");
            }
            else
            {
                msbox("Cmimet nuk mund te modifikohen pasi jane konfigurar keste !");
            }
        }
Beispiel #2
0
        public void bind()
        {
            DataClasses1DataContext financa_sh = new DataClasses1DataContext();
            Cmimet cm      = new Cmimet();
            var    cm_viti = from c in financa_sh.Cmimets
                             where (c.Viti_shkollor == vitiddl1.SelectedItem.Text) && (c.Klasa == Convert.ToInt16(Klasaddl.SelectedItem.Text))
                             select new { c.Cmimi, c.Valuta, c.Prenotimi, c.Valuta_prenotimi, c.Cmimi_trans, c.Valuta_trans };

            if (cm_viti.Count() > 0)
            {
                TextBox1.Text = cm_viti.FirstOrDefault().Cmimi.ToString();
                DropDownList1.SelectedValue = cm_viti.FirstOrDefault().Valuta.ToString().Trim();
                TextBox2.Text = cm_viti.FirstOrDefault().Cmimi_trans.ToString().Trim();
                DropDownList2.SelectedValue = cm_viti.FirstOrDefault().Valuta_trans.ToString().Trim();
                TextBox3.Text = cm_viti.FirstOrDefault().Prenotimi.ToString().Trim();
                DropDownList3.SelectedValue = cm_viti.FirstOrDefault().Valuta_prenotimi.ToString().Trim();
                Button1.Visible             = true;
                Button2.Visible             = false;
            }
            else
            {
                TextBox1.Text = "";
                DropDownList1.SelectedValue = "EUR";
                TextBox2.Text = "";
                DropDownList2.SelectedValue = "EUR";
                TextBox3.Text = "";
                DropDownList3.SelectedValue = "EUR";
                Button2.Visible             = true;
                Button1.Visible             = false;
            }
        }
        private async Task <ObservableCollection <Cmimet> > GetCmimet()
        {
            try
            {
                var response = await App.client.GetAsync(App.API_URL_BASE + "payments/cmimet");

                if (response.StatusCode != System.Net.HttpStatusCode.OK)
                {
                    UserDialogs.Instance.Alert("Probleme me server, Provoni Perseri", "Error", "Ok");
                    return(null);
                }
                else
                {
                    var responseString = await response.Content.ReadAsStringAsync();

                    var cmimet = JsonConvert.DeserializeObject <ObservableCollection <Cmimet> >(responseString);
                    Cmimet   = cmimet;
                    HasCmime = Cmimet.Any();
                    OnPropertyChanged("HasCmime");
                    return(Cmimet);
                }
            }
            catch (Exception e)
            {
                return(null);
            }
        }
Beispiel #4
0
        private async Task CreateACmimAsync()
        {
            SelectedCmimi.SeasonID = SelectedSezoni.id;
            var json = JsonConvert.SerializeObject(SelectedCmimi);
            var g    = json.Remove(1, 7);

            App.client.DefaultRequestHeaders.TryAddWithoutValidation("Content-Type", "application/json");
            HttpContent httpContent = new StringContent(g, Encoding.UTF8, "application/json");
            var         response    = await App.client.PostAsync(App.API_URL_BASE + "payments/cmimet", httpContent);

            if (response.IsSuccessStatusCode)
            {
                UserDialogs.Instance.Alert("Cmimi u shtua me sukses", "Sukses", "OK");
            }
            else
            {
                UserDialogs.Instance.Alert("Cmimi nuk u shtua me sukses", "Error", "OK");
            }
            var responseString = await response.Content.ReadAsStringAsync();

            Cmimet addedCmimet = JsonConvert.DeserializeObject <Cmimet>(responseString);

            Cmimet.Add(addedCmimet);
            HasCmime = Cmimet.Any();
            OnPropertyChanged("HasCmime");
        }
        protected string valuta()
        {
            DataClasses1DataContext financa_sh = new DataClasses1DataContext();
            Cmimet cm            = new Cmimet();
            var    cmimet_valuta = from c in financa_sh.Cmimets
                                   where (c.Viti_shkollor == vitiddl1.Text)
                                   select c.Valuta_trans;

            return(cmimet_valuta.FirstOrDefault().ToString().Trim());
        }
        protected string Valuta_pren()
        {
            DataClasses1DataContext financa_sh = new DataClasses1DataContext();
            Cmimet cm = new Cmimet();
            var    cp = from c in financa_sh.Cmimets
                        where (c.Klasa == Convert.ToInt16(DropDownList1.SelectedItem.Text)) && (c.Viti_shkollor == vitiddl0.SelectedItem.Text)
                        select c;

            return(cp.FirstOrDefault().Valuta_prenotimi.Trim());
        }
Beispiel #7
0
 public ActionResult Edit(int id)
 {
     if (Session["UserID"] != null)
     {
         CmimetBusiness cb = new CmimetBusiness();
         Cmimet         cm = cb.Cmimet.Single(s => s.id == id);
         return(View(cm));
     }
     else
     {
         return(RedirectToAction("Index", "Hyrje"));
     }
 }
        protected int cmimi_pren()
        {
            DataClasses1DataContext financa_sh = new DataClasses1DataContext();
            Cmimet cm = new Cmimet();
            var    cp = from c in financa_sh.Cmimets
                        where (c.Klasa == Convert.ToInt16(DropDownList1.SelectedItem.Text)) && (c.Viti_shkollor == vitiddl0.SelectedItem.Text)
                        select c;

            if (cp.Count() == 0)
            {
                return(0);
            }
            else
            {
                return(cp.FirstOrDefault().Prenotimi);
            }
        }
Beispiel #9
0
        public void vendos()
        {
            DataClasses1DataContext financa_sh = new DataClasses1DataContext();
            Cmimet cm = new Cmimet();

            cm.Klasa            = Convert.ToInt16(Klasaddl.SelectedItem.Text);
            cm.Viti_shkollor    = vitiddl1.SelectedItem.Text;
            cm.Cmimi            = Convert.ToInt32(TextBox1.Text);
            cm.Cmimi_trans      = Convert.ToDecimal(TextBox2.Text);
            cm.Prenotimi        = Convert.ToInt16(TextBox3.Text);
            cm.Valuta           = DropDownList1.SelectedItem.Text;
            cm.Valuta_prenotimi = DropDownList3.SelectedItem.Text;
            cm.Valuta_trans     = DropDownList2.SelectedItem.Text;
            financa_sh.Cmimets.InsertOnSubmit(cm);
            financa_sh.SubmitChanges();

            bind();
        }
        public decimal gjej_pren()
        {
            DataClasses1DataContext financa_sh = new DataClasses1DataContext();
            Cmimet nxenesi_kest = new Cmimet();
            int    kesti        = 0;
            var    nxenesi_k1   = from c in financa_sh.Cmimets
                                  where (c.Klasa.ToString() == Klasaddl.SelectedValue) && (c.Viti_shkollor == vitiddl1.SelectedValue)
                                  select new { c.Prenotimi };

            if (nxenesi_k1.Count() > 0)
            {
                kesti = nxenesi_k1.FirstOrDefault().Prenotimi;
                return(kesti);
            }
            else
            {
                return(0);
            }
        }
Beispiel #11
0
        public ActionResult Edit(Cmimet cmimet)
        {
            if (Session["UserID"] != null)
            {
                CmimetBusiness cb = new CmimetBusiness();
                if (ModelState.IsValid)

                {
                    cb.modifiko(cmimet);
                    return(RedirectToAction("Index", "Cmimet"));
                }
                else
                {
                    return(View());
                }
            }

            {
                return(RedirectToAction("Index", "Hyrje"));
            }
        }
Beispiel #12
0
 public PaymentsViewModel()
 {
     GoToCmimetCommand             = new Command(async() => await GoToCmimetAsync());
     GoToTarifatCommand            = new Command(async() => await GoToTarifatAsync());
     GoToZbritjetCommand           = new Command(async() => await GoToZbritjetAsync());
     GoToSezonetCommand            = new Command(async() => await GoToSezonetAsync());
     AddASeasonCommand             = new Command(async() => await CreateASeasonAsync());
     AddACmimCommand               = new Command(async() => await CreateACmimAsync());
     GoToCreateCmimeCommand        = new Command(async() => await GoToCreateCmimetAsync());
     GoToCreateSeazonCommand       = new Command(async() => await GoToCreateSeazonAsync());
     GoToPersonalizedReportCommand = new Command(async() => await GoToPersonalizedReportAsync());
     GeneratePdfWithFilterCommand  = new Command(async() => await GeneratePdfWithFilterAsync());
     GeneratePdfWeeklyCommand      = new Command(async() => await GeneratePdfWeekly());
     GeneratePdfDailyCommand       = new Command(async() => await GeneratePdfDailyAsync());
     GeneratePdfMonthlyCommand     = new Command(async() => await GeneratePdfMonthlyAsync());
     GoToDailyRaportsCommand       = new Command(async(c) => await GoToDailyRaportsAsync(c.ToString()));
     GeneratePdfSeasonCommand      = new Command(async() => await GeneratePdfSeasonAsync());
     SelectedSezoni = new Sezonet();
     SelectedCmimi  = new Cmimet();
     Sezonet        = new ObservableCollection <Sezonet>();
     Cmimet         = new ObservableCollection <Cmimet>();
     DailyRaports   = DateTime.Now;
 }