Пример #1
0
        public void insertPliromi(Pliromi myPliromi)
        {
            SqlCommand cmd = new SqlCommand("add_pliromi", conn);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@payDate", myPliromi.PayDay);
            cmd.Parameters.AddWithValue("@payType", myPliromi.pmid);
            cmd.Parameters.AddWithValue("@poso", myPliromi.Poso);
            cmd.Parameters.AddWithValue("@paid", myPliromi.Paid);
            cmd.Parameters.AddWithValue("@opid", myPliromi.Pliromi_opid);

            try
            {
                cmd.ExecuteNonQuery();
            }

            catch (Exception ex)
            {
                string exmsg = ex.Message.ToString();
            }

            finally
            {
                conn.Close();
            }
        }
Пример #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!Page.IsPostBack)
     {
         BLayer  myBlayer  = new BLayer();
         Pliromi myPliromi = new Pliromi();
         Oplitis myOplitis = new Oplitis();
         myPliromi         = myBlayer.get_Last_Pliromi();
         aaPliromis.Text   = myPliromi.PliromiId.ToString();
         priromiDate.Text  = myPliromi.PayDay.ToString();
         payDate.Text      = myPliromi.PayDay.ToString();
         asm.Text          = myPliromi.p_opasm.ToString();
         rank.Text         = myPliromi.bathmos.ToString();
         fname.Text        = myPliromi.onoma.ToString();
         lname.Text        = myPliromi.eponymo.ToString();
         loxos.Text        = myPliromi.loxos.ToString();
         katigoria.Text    = myPliromi.katName.ToString();
         katalogisteo.Text = myPliromi.katalogisteo.ToString();
         kratiseis.Text    = myPliromi.kratiseis.ToString();
         pliroteo.Text     = myPliromi.pliroteo.ToString();
         payType.Text      = myPliromi.mPerigrafi.ToString();
         opid.Text         = myPliromi.Pliromi_opid.ToString();
         posoPliromis.Text = myPliromi.Poso.ToString();
         myOplitis.id      = Convert.ToInt32(opid.Text);
         SqlDataReader myDtr = myBlayer.get_dikaiologitika_pou_exei_proskomisei_by_id(myOplitis);
         dikaiologitika.DataSource = myDtr;
         dikaiologitika.DataBind();
     }
 }
Пример #3
0
        public Pliromi get_Pliromi_By_Id(Pliromi myPliromi)
        {
            Dal           myDal        = new Dal();
            Pliromi       otherPliromi = new Pliromi();
            DataTable     dt           = new DataTable();
            SqlDataReader dr           = myDal.getPliromiById(myPliromi);

            if (dr.HasRows)
            {
                dt.Load(dr);
            }
            foreach (DataRow row in dt.Rows)
            {
                otherPliromi.Pliromi_opid = Convert.ToInt32(row["op_id"].ToString());
                otherPliromi.PliromiId    = Convert.ToInt32(row["p_id"].ToString());
                otherPliromi.PayDay       = Convert.ToDateTime(row["p_date"].ToString());
                otherPliromi.p_opasm      = Convert.ToInt32(row["op_asm"].ToString());
                otherPliromi.bathmos      = row["r_perigrafi"].ToString();
                otherPliromi.onoma        = row["op_onoma"].ToString();
                otherPliromi.eponymo      = row["op_eponymo"].ToString();
                otherPliromi.loxos        = row["op_loxos"].ToString();
                otherPliromi.katName      = row["kat_name"].ToString();
                otherPliromi.katalogisteo = Convert.ToDecimal(row["kat_katalogisteo"].ToString());
                otherPliromi.kratiseis    = Convert.ToDecimal(row["kat_kratiseis"].ToString());
                otherPliromi.pliroteo     = Convert.ToDecimal(row["kat_pliroteo"].ToString());
                otherPliromi.mPerigrafi   = row["m_perigrafi"].ToString();
                float temp = Convert.ToSingle(row["p_posoPliromis"].ToString());
                otherPliromi.Poso = Convert.ToDecimal(temp);
            }
            return(otherPliromi);
        }
Пример #4
0
        public decimal anadromikaCalcLogoApousias(Oplitis myOplitis)
        {
            BLayer    myBlayer = new BLayer();
            Katigoria category = new Katigoria();

            category = myBlayer.get_Katigoria_By_Id(myOplitis);
            decimal poso      = category.katPliroteo;
            Pliromi myPliromi = new Pliromi();

            myPliromi = myBlayer.get_Last_Pliromi_By_Opid(myOplitis);
            DateTime lastPayDate = myPliromi.PayDay;
            DateTime currentDate = DateTime.Now;
            int      diafora     = currentDate.Month - lastPayDate.Month;
            decimal  anadromika  = diafora * poso;

            return(anadromika);
        }
Пример #5
0
 protected void saveButton_Click(object sender, EventArgs e)
 {
     try
     {
         BLayer  myBlayer  = new BLayer();
         Pliromi myPliromi = new Pliromi();
         myPliromi.PayDay       = Convert.ToDateTime(priromiDate.Text);
         myPliromi.pmid         = Convert.ToInt32(RadioButtonListMisthodType.SelectedValue);// na val0 an o allos den epilexei bathmo na epilegei automata ton bathmo strti
         myPliromi.Poso         = Convert.ToDecimal(posoPliromis.Text);
         myPliromi.Paid         = Convert.ToBoolean(1);
         myPliromi.Pliromi_opid = Convert.ToInt32(aa.Text);
         myBlayer.add_Pliromi(myPliromi);
         Response.Redirect("anafora_pliromis.aspx");
     }
     catch (Exception ex)
     {
         error.Visible = true;
         error.Text    = ex.Message.ToString();
     }
 }
Пример #6
0
        public SqlDataReader getPliromiById(Pliromi myPliromi)
        {
            SqlCommand cmd = new SqlCommand("get_last_pliromi_by_id", conn);

            cmd.CommandType = CommandType.StoredProcedure;
            cmd.Parameters.AddWithValue("@pid", myPliromi.PliromiId);
            SqlDataReader myDtr = null;

            try
            {
                myDtr = cmd.ExecuteReader();
            }

            catch (Exception ex)
            {
                ex.ToString();
            }

            return(myDtr);
        }
Пример #7
0
        protected void logosAnadromikon_SelectedIndexChanged(object sender, EventArgs e)
        {
            BLayer myBlayer = new BLayer();

            error3.Visible    = false;
            anadromika.Text   = string.Empty;
            posoPliromis.Text = string.Empty;
            if (logosAnadromikon.SelectedIndex == 0)
            {
                panelAllagiKatigorias.Visible = true;
                panelApousias.Visible         = false;
                anadromikaCalculate.Visible   = true;
            }
            else if (logosAnadromikon.SelectedIndex == 1)
            {
                panelApousias.Visible         = true;
                anadromikaCalculate.Visible   = true;
                panelAllagiKatigorias.Visible = false;
                DateTime mydatetime = new DateTime();
                mydatetime       = DateTime.Now;
                currentDate.Text = mydatetime.Day.ToString() + "/" + mydatetime.Month.ToString() + "/" + mydatetime.Year.ToString();
                Pliromi otherPliromi = new Pliromi();
                otherOplitis.id      = Convert.ToInt32(aa.Text);
                otherPliromi         = myBlayer.get_Last_Pliromi_By_Opid(otherOplitis);
                lastPliromiDate.Text = otherPliromi.PayDay.ToString();
                if (Convert.ToDateTime(currentDate.Text) == Convert.ToDateTime(lastPliromiDate.Text))
                {
                    anadromikaCalculate.Visible = false;
                    error3.Visible = true;
                    error3.Text    = "Ο επιλεγμένος οπλίτης δεν δικαιούται αναδρομικά λόγω απουσίας!";
                }
                else
                {
                    anadromikaCalculate.Visible = true;
                    error3.Visible = false;
                }
            }
        }
Пример #8
0
        public Pliromi get_Last_Pliromi_By_Opid(Oplitis myOplitis)
        {
            Dal           myDal     = new Dal();
            Pliromi       myPliromi = new Pliromi();
            DataTable     dt        = new DataTable();
            SqlDataReader dr        = myDal.getLastPliromiByOpid(myOplitis);

            if (dr.HasRows)
            {
                dt.Load(dr);
            }
            foreach (DataRow row in dt.Rows)
            {
                myPliromi.Pliromi_opid = Convert.ToInt32(row["op_id"].ToString());
                myPliromi.PliromiId    = Convert.ToInt32(row["p_id"].ToString());
                myPliromi.PayDay       = Convert.ToDateTime(row["p_date"].ToString());
                myPliromi.p_opasm      = Convert.ToInt32(row["op_asm"].ToString());
                myPliromi.bathmos      = row["r_perigrafi"].ToString();
                myPliromi.onoma        = row["op_onoma"].ToString();
                myPliromi.eponymo      = row["op_eponymo"].ToString();
                myPliromi.loxos        = row["op_loxos"].ToString();
                myPliromi.katName      = row["kat_name"].ToString();
                myPliromi.katalogisteo = Convert.ToDecimal(row["kat_katalogisteo"].ToString());
                myPliromi.kratiseis    = Convert.ToDecimal(row["kat_kratiseis"].ToString());
                myPliromi.pliroteo     = Convert.ToDecimal(row["kat_pliroteo"].ToString());
                myPliromi.mPerigrafi   = row["m_perigrafi"].ToString();
                if (string.IsNullOrEmpty(row["p_posoPliromis"].ToString()))
                {
                    myPliromi.Poso = Convert.ToDecimal("0,00");
                }
                else
                {
                    myPliromi.Poso = Convert.ToDecimal(row["p_posoPliromis"].ToString());
                }
            }
            return(myPliromi);
        }
Пример #9
0
        public void add_Pliromi(Pliromi myPliromi)
        {
            Dal myDal = new Dal();

            myDal.insertPliromi(myPliromi);
        }