Beispiel #1
0
    protected void btnTahsilatOnay_Click(object sender, EventArgs e)
    {
        int SenetNo = 0;
        int GID     = 0;

        if (tahsilatim != null)
        {
            foreach (DataRow row in tahsilatim.Rows)
            {
                SenetNo = Convert.ToInt32(row[0]);
                GID     = Convert.ToInt32(row[5]);
                break;
            }
        }

        try
        {
            string tahsilatTarihi = DateTime.Now.ToShortDateString();
            int    kullaniciID    = Convert.ToInt32(Session["kulid"]);
            DBIslem.DtGetir("INSERT INTO TBL_TAHSILAT (gID , tTARIH ,tTUTAR, tKULLANICI_ID , tNO) values (" + GID + " ,'" + tahsilatTarihi + "','" + txtTutar.Text + "'," + kullaniciID + "," + SenetNo + ") ");
            DBIslem.DtGetir("Update TBL_GECICI set IsActive = 1 where TARIH = '" + txtTarih.Text + "' and AD_SOYAD ='" + txtAdSoyad.Text + "'");
            Session.Remove("tahsilat");
            Response.Redirect("Default.aspx");
        }
        catch (Exception)
        {
            throw;
        }
    }
    protected void RPT_TIME_SHEET_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        string Tarih  = CL_TAKVIM.SelectedDate.ToShortDateString();
        int    timeid = 0;
        string not    = (e.Item.FindControl("areaNot") as TextBox).Text;

        if (e.CommandName == "Kaydet")
        {
            string    Saat   = e.CommandArgument.ToString();
            DataTable Saatid = DBIslem.DtGetir("SELECT ID FROM TBL_TIMESHEET where Time = '" + Saat + "'");
            foreach (DataRow item in Saatid.Rows)
            {
                timeid = Convert.ToInt32(item[0]);
                break;
            }

            DBIslem.DtGetir("INSERT INTO TBL_CALENDER (Tarih , TimeSheetID, userID, Note) VALUES('" + Tarih + "'," + timeid + "," + Convert.ToInt32(Session["kulid"]) + ",'" + not + "' ) ");
        }
        if (e.CommandName == "Sil")
        {
            string    Saat   = e.CommandArgument.ToString();
            DataTable Saatid = DBIslem.DtGetir("SELECT ID FROM TBL_TIMESHEET where Time = '" + Saat + "'");
            foreach (DataRow item in Saatid.Rows)
            {
                timeid = Convert.ToInt32(item[0]);
                break;
            }
            DBIslem.DtGetir("DELETE FROM TBL_CALENDER WHERE Tarih = '" + Tarih + "' and TimeSheetID = " + timeid + "");
            (e.Item.FindControl("areaNot") as TextBox).Text = "";
        }
    }
Beispiel #3
0
    protected void Page_Load(object sender, EventArgs e)
    {
        tahsilatim = (DataTable)Session["tahsilat"];

        if (Session["kullanici"] != null && (Convert.ToInt32(Session["kulid"]) == 16 || Convert.ToInt32(Session["kulid"]) != 12))
        {
            txtAdSoyad.Enabled = false;
            txtTarih.Enabled   = false;
            txtTutar.Enabled   = false;



            foreach (DataRow row in tahsilatim.Rows)
            {
                txtAdSoyad.Text = row[4].ToString();
                txtTarih.Text   = row[1].ToString();
                txtTutar.Text   = row[2].ToString() + " " + row[3].ToString();
            }
            RPT_TAHSILAT_LISTESI_OZEL.DataSource = DBIslem.DtGetir("select  NO ,AD_SOYAD , TUTAR , TBL_TAHSILAT.tTARIH ,TBL_TAHSILAT.tKULLANICI_ID from TBL_GECICI a inner join TBL_GORUSME b on a.GID = b.gID inner join TBL_TAHSILAT on a.GID = TBL_TAHSILAT.gID where IsActive = 1  and AD_SOYAD = '" + txtAdSoyad.Text + "' ");
            RPT_TAHSILAT_LISTESI_OZEL.DataBind();
        }
        else
        {
            Response.Redirect("Default.aspx");
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        Session["sID"] = null;
        Session["gID"] = null;

        if (Session["kullanici"] != null)
        {
            //LISTE
            if (Convert.ToInt32(Session["kulid"]).Equals(16) || Convert.ToInt32(Session["kulid"]).Equals(12))
            {
                RPT_SOZLESME_LISTE.DataSource = DBIslem.DtGetir("SELECT ( sTAKSIT_SAYISI -   (Select COUNT(TBL_TAHSILAT.tID) FROM TBL_TAHSILAT WHERE TBL_TAHSILAT.gID = View_Satis.gID) ) AS Kalan_Taksit , TOPLAM_TAHSIL = ISNULL((SELECT SUM(Convert(money, ISNULL((TBL_GECICI.TUTAR), 0))) FROM TBL_GECICI WHERE IsActive = 1 AND TBL_GECICI.GID = View_Satis.gID GROUP BY AD_SOYAD), 0) , *FROM View_Satis inner JOIN TBL_GORUSME on View_Satis.gID = TBL_GORUSME.gID order by View_Satis.gID desc");
                RPT_SOZLESME_LISTE.DataBind();
            }
            if (!Convert.ToInt32(Session["kulid"]).Equals(16) && !Convert.ToInt32(Session["kulid"]).Equals(12))
            {
                RPT_SOZLESME_LISTE.DataSource = DBIslem.DtGetir("SELECT ( sTAKSIT_SAYISI -   (Select COUNT(TBL_TAHSILAT.tID) FROM TBL_TAHSILAT WHERE TBL_TAHSILAT.gID = View_Satis.gID) ) AS Kalan_Taksit , TOPLAM_TAHSIL = ISNULL((SELECT SUM(Convert(money, ISNULL((TBL_GECICI.TUTAR), 0))) FROM TBL_GECICI WHERE IsActive = 1 AND TBL_GECICI.GID = View_Satis.gID GROUP BY AD_SOYAD), 0) , *FROM View_Satis inner JOIN TBL_GORUSME on View_Satis.gID = TBL_GORUSME.gID WHERE sKULID = " + Convert.ToInt32(Session["kulid"]) + "  order by View_Satis.gID desc");
                RPT_SOZLESME_LISTE.DataBind();
            }
        }

        else
        {
            Response.Redirect("girisYap.aspx");
        }
    }
Beispiel #5
0
    private void MUSTERI_LISTESI_GETIR()
    {
        if (kullaniciadi == "admin" || Convert.ToInt32(Session["kulid"]) == 16)
        {
            RPT_GORUSME_LISTE.DataSource = DBIslem.DtGetir("SELECT * FROM View_GorusmeListesi order by gID desc");
            RPT_GORUSME_LISTE.DataBind();



            DataTable düzenlenecek = DBIslem.DtGetir(" SELECT ( sTAKSIT_SAYISI -   (Select COUNT(TBL_TAHSILAT.tID) FROM TBL_TAHSILAT WHERE TBL_TAHSILAT.gID = View_Satis.gID) ) AS Kalan_Taksit , TOPLAM_TAHSIL = ISNULL((SELECT SUM(Convert(money, ISNULL((TBL_GECICI.TUTAR), 0))) FROM TBL_GECICI WHERE IsActive = 1 AND TBL_GECICI.GID = View_Satis.gID GROUP BY AD_SOYAD), 0), *FROM View_Satis left join TBL_KULLANICI on View_Satis.sKULID = TBL_KULLANICI.kID order by gID desc");

            RPT_SOZLEME_LISTE.DataSource = düzenlenecek;

            RPT_SOZLEME_LISTE.DataBind();
        }
        else
        {
            // DataTable düzenlenecek = DBIslem.DtGetir("SELECT ( sTAKSIT_SAYISI -   (Select COUNT(TBL_TAHSILAT.tID) FROM TBL_TAHSILAT WHERE TBL_TAHSILAT.gID = View_Satis.gID) ) AS Kalan_Taksit , TOPLAM_TAHSIL = ISNULL((SELECT SUM(Convert(money, ISNULL((TBL_GECICI.TUTAR), 0))) FROM TBL_GECICI WHERE IsActive = 1 AND TBL_GECICI.GID = View_Satis.gID GROUP BY AD_SOYAD), 0), *FROM TBL_GORUSME  inner JOIN View_Satis on View_Satis.gID = TBL_GORUSME.gID WHERE sKULID = "+Convert.ToInt32(Session["kulid"])+"  order by View_Satis.gID desc");

            RPT_GORUSME_LISTE.DataSource = DBIslem.DtGetir("SELECT * FROM View_GorusmeListesi where gKULLANICI_ID='" + Session["kulid"] + "'");;
            RPT_GORUSME_LISTE.DataBind();
            //RPT_GORUSME_LISTE1.DataSource = DBIslem.DtGetir("select gNOT from View_GorusmeListesi where gKULLANICI_ID='" + Session["kulid"] + "' and gMUSTERID =' " + RPT_GORUSME_LISTE);
            //RPT_GORUSME_LISTE1.DataBind();

            RPT_SOZLEME_LISTE.DataSource = DBIslem.DtGetir("SELECT ( sTAKSIT_SAYISI -   (Select COUNT(TBL_TAHSILAT.tID) FROM TBL_TAHSILAT WHERE TBL_TAHSILAT.gID = View_Satis.gID) ) AS Kalan_Taksit , TOPLAM_TAHSIL = ISNULL((SELECT SUM(Convert(money, ISNULL((TBL_GECICI.TUTAR), 0))) FROM TBL_GECICI WHERE IsActive = 1 AND TBL_GECICI.GID = View_Satis.gID GROUP BY AD_SOYAD), 0), *FROM View_Satis left join TBL_KULLANICI on View_Satis.sKULID = TBL_KULLANICI.kID where sKULID = " + Convert.ToInt32(Session["kulid"]) + " order by gID desc");
            RPT_SOZLEME_LISTE.DataBind();
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["kullanici"] != null)
        {
            int       yil = bugun.Year;
            DataTable bildirimtable;
            if (Convert.ToInt32(Session["kulid"]).Equals(16) || Convert.ToInt32(Session["kulid"]).Equals(12))
            {
                bildirimtable = DBIslem.DtGetir(" SELECT TOP 10 gecici.AD_SOYAD , gecici.TUTAR , gecici.TARIH , gecici.PARA_BIRIMI , Convert(varchar(100),DATEDIFF(DAY,GETDATE(),Convert(datetime2,TARIH))) as KALAN_GUN FROM TBL_GECICI gecici inner join TBL_GORUSME g ON gecici.GID = g.gID inner join TBL_MUSTERI m on g.gMUSTERI_ID = m.mID where gecici.TARIH like '%" + yil + "' and gecici.IsActive = 0 order by convert(datetime2,TARIH)");
                bildirimler   = bildirimtable;
            }
            if (!Convert.ToInt32(Session["kulid"]).Equals(16) && !Convert.ToInt32(Session["kulid"]).Equals(12))
            {
                bildirimtable = DBIslem.DtGetir(" SELECT TOP 10 gecici.AD_SOYAD , gecici.TUTAR , gecici.TARIH , gecici.PARA_BIRIMI , Convert(varchar(100),DATEDIFF(DAY,GETDATE(),Convert(datetime2,TARIH))) as KALAN_GUN FROM TBL_GECICI gecici inner join TBL_GORUSME g ON gecici.GID = g.gID inner join TBL_MUSTERI m on g.gMUSTERI_ID = m.mID where g.gKULLANICI_ID = " + Session["kulid"] + " and gecici.TARIH like '%" + yil + "' and gecici.IsActive = 0 order by convert(datetime2,TARIH)");
                bildirimler   = bildirimtable;
            }
            lblKullanici.Text = "Hoşgeldin " + Session["kullanici"];



            RPT_BİLDİRİMLER.DataSource = bildirimler;
            RPT_BİLDİRİMLER.DataBind();
        }
        else
        {
            Response.Redirect("girisYap.aspx");
        }
    }
Beispiel #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["kullanici"] != null)
        {
            kullaniciadi = Session["kullanici"].ToString();
            if (Convert.ToInt32(Session["kulid"]).Equals(16) || Convert.ToInt32(Session["kulid"]).Equals(12))
            {
                RPT_GORUSME_LISTE.DataSource = DBIslem.DtGetir("SELECT * FROM View_GorusmeListesi"); // burdan çekicez
                RPT_GORUSME_LISTE.DataBind();
            }

            //LISTE


            else
            {
                //LISTE
                RPT_GORUSME_LISTE.DataSource = DBIslem.DtGetir("SELECT * FROM View_GorusmeListesi where gKULLANICI_ID='" + Session["kulid"] + "'"); // burdan çekicez
                RPT_GORUSME_LISTE.DataBind();
            }
        }
        else
        {
            Response.Redirect("girisYap.aspx");
        }

        //
    }
Beispiel #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["kulid"] != null)
        {
            if (!Session["sID"].Equals(null) && !Session["gID"].Equals(null))
            {
                DataTable dt = DBIslem.DtGetir("SELECT mAD , mSOYAD , gTEKLIF_UCRET , gTEKLIF_PARA_BIRIMI , sSOZLESME_TARIH , fTIP , sTAKSIT_SAYISI from View_Satis WHERE sID = " + Session["sID"] + "");
                foreach (DataRow data in dt.Rows)
                {
                    txtAdSoyad.Text       = data[0].ToString() + " " + data[1].ToString();
                    txtSatisBedel.Text    = data[2] + " " + data[3];
                    txtSozlesmeTarih.Text = data[4].ToString();
                    txtDaireKod.Text      = data[5].ToString();
                    txtTaksitSayi.Text    = data[6].ToString();
                }

                DataTable dtTaksitler = DBIslem.DtGetir("SELECT TUTAR , TUTAR_YAZIYLA , TARIH , [NO]  FROM TBL_GECICI WHERE gID = " + Session["gID"] + " order by NO ");
                GRD_TAKSITLER.DataSource = dtTaksitler;
                GRD_TAKSITLER.DataBind();
            }
        }
        else
        {
            Response.Redirect("girisYap.aspx");
        }
    }
Beispiel #9
0
    } // Tabloda Musteri kontrolu

    public static void SozlesmeSil(int gorusmeID, int sozlesmeID, string daireKodu, int userID)
    {
        DBIslem.DtGetir("INSERT INTO TBL_DEL (dsID , dsSozlesme_Tarih ,dsTarih , dsUserID) SELECT sID, sSOZLESME_TARIH, Convert(nvarchar(50), GETDATE()), " + userID + " FROM TBL_SOZLESME where sID =" + sozlesmeID + " ");
        DBIslem.DtGetir("DELETE FROM TBL_SOZLESME WHERE sID =" + sozlesmeID + " ");
        DBIslem.DtGetir("DELETE FROM TBL_GECICI WHERE gID = " + gorusmeID + " ");
        DBIslem.DtGetir("UPDATE TBL_FIYAT_LISTE set fDURUM = 0 WHERE fTIP = '" + daireKodu + "'");
        DBIslem.DtGetir("DELETE FROM TBL_GORUSME WHERE gID = " + gorusmeID + " ");
    }
Beispiel #10
0
    public static string NotGoster(object a)
    {
        DataTable dt = DBIslem.DtGetir("Select gNOT from TBL_MUSTERI where gID =" + a + " ");

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            return(dt.Rows[i][0].ToString());
        }
        return("");
    }
Beispiel #11
0
 private void ODEME_LISTELE()
 {
     if (Convert.ToInt32(Session["kulid"]) == 12 || Convert.ToInt32(Session["kulid"]) == 16)
     {
         RPT_ODEMELISTESI.DataSource = DBIslem.DtGetir("SELECT gKULLANICI_ID ,gecici.AD_SOYAD , gecici.TUTAR , gecici.TARIH , gecici.PARA_BIRIMI , Convert(varchar(100),DATEDIFF(DAY,GETDATE(),Convert(datetime2,TARIH))) as KALAN_GUN FROM TBL_GECICI gecici      inner join TBL_GORUSME g    ON gecici.GID = g.gID inner join TBL_MUSTERI m    on g.gMUSTERI_ID = m.mID where DATEDIFF(DAY, GETDATE(), Convert(datetime2, TARIH)) between 0 and 32 and gecici.IsActive = 0   order by DATEDIFF(DAY, GETDATE(), Convert(datetime2, TARIH))");
         RPT_ODEMELISTESI.DataBind();
         return;
     }
     RPT_ODEMELISTESI.DataSource = DBIslem.DtGetir("SELECT gKULLANICI_ID ,gecici.AD_SOYAD , gecici.TUTAR , gecici.TARIH , gecici.PARA_BIRIMI , Convert(varchar(100),DATEDIFF(DAY,GETDATE(),Convert(datetime2,TARIH))) as KALAN_GUN FROM TBL_GECICI gecici      inner join TBL_GORUSME g     ON gecici.GID = g.gID inner join TBL_MUSTERI m     on g.gMUSTERI_ID = m.mID where DATEDIFF(DAY, GETDATE(), Convert(datetime2, TARIH)) between 0 and 32 and gKULLANICI_ID = " + Convert.ToInt32(Session["kulid"]) + " and gecici.IsActive = 0  order by DATEDIFF(DAY, GETDATE(), Convert(datetime2, TARIH))");
     RPT_ODEMELISTESI.DataBind();
 }
 protected void CL_TAKVIM_SelectionChanged(object sender, EventArgs e)
 {
     if (Convert.ToInt32(Session["kulid"]) == 12)
     {
         RPT_TIME_SHEET.DataBind();
         RPT_NOTLISTESI.DataSource = DBIslem.DtGetir("select * FROM TBL_CALENDER c LEFT JOIN TBL_TIMESHEET ts ON c.TimeSheetID = ts.ID  LEFT JOIN TBL_KULLANICI k on k.kID = c.userID ");
         RPT_NOTLISTESI.DataBind();
         return;
     }
     RPT_TIME_SHEET.DataSource = DBIslem.DtGetir("SELECT Time From TBL_TIMESHEET");
     RPT_TIME_SHEET.DataBind();
 }
    protected void CL_TAKVIM_DayRender(object sender, DayRenderEventArgs e)
    {
        if (Convert.ToInt32(Session["kulid"]) == 12)
        {
            DataTable dt = DBIslem.DtGetir("SELECT Tarih , TimeSheetID FROM TBL_CALENDER ");
            if (dt.Rows.Count == 0)
            {
                return;
            }
            else
            {
                foreach (DataRow item in dt.Rows)
                {
                    if (item[0].ToString() == e.Day.Date.ToShortDateString())
                    {
                        e.Cell.BackColor = System.Drawing.Color.Red;
                    }
                }
            }
        }
        else
        {
            string tarih = e.Day.Date.ToShortDateString();
            if (e.Day.IsToday)
            {
                e.Cell.BackColor = System.Drawing.Color.Green;
            }
            if (e.Day.IsWeekend)
            {
                e.Cell.BackColor = System.Drawing.Color.PowderBlue;
            }
            DataTable dt = DBIslem.DtGetir("SELECT Tarih , TimeSheetID FROM TBL_CALENDER WHERE Tarih = '" + e.Day.Date.ToShortDateString() + "' and userID = " + Convert.ToInt32(Session["kulid"]) + "");
            // string tableTarih = dt.Rows[0][0].ToString();
            if (dt.Rows.Count == 0)
            {
                return;
            }
            else if (dt.Rows[0][0].ToString() == e.Day.Date.ToShortDateString())
            {
                e.Cell.BackColor = System.Drawing.Color.Red;
                //foreach (DataRow item in dt.Rows)
                //{
                //    DataTable saatler = DBIslem.DtGetir("SELECT Time FROM TBL_TIMESHEET WHERE ID = "+Convert.ToInt32(item[1])+"");
                //    foreach (DataRow eklenecekSaat in saatler.Rows)
                //    {

                //    }

                //}
            }
        }
    }
Beispiel #14
0
 private void TAHSILAT_LISTELE()
 {
     if (Convert.ToInt32(Session["kulid"]) != 12 && Convert.ToInt32(Session["kulid"]) != 16)
     {
         RPT_TAHSILAT_LISTESI.DataSource = DBIslem.DtGetir("SELECT NO ,AD_SOYAD , TUTAR ,PARA_BIRIMI , TARIH , tTARIH  FROM TBL_TAHSILAT LEFT JOIN TBL_GECICI ON TBL_TAHSILAT.gID = TBL_GECICI.[GID] where tKULLANICI_ID = " + Convert.ToInt32(Session["kulid"]) + " AND TBL_GECICI.IsActive = 1 and tNO = [NO]");
         RPT_TAHSILAT_LISTESI.DataBind();
     }
     else
     {
         RPT_TAHSILAT_LISTESI.DataSource = DBIslem.DtGetir("  SELECT NO ,AD_SOYAD , TUTAR ,PARA_BIRIMI , TARIH , tTARIH  FROM TBL_TAHSILAT LEFT JOIN TBL_GECICI ON TBL_TAHSILAT.gID = TBL_GECICI.[GID] where TBL_GECICI.IsActive = 1 and tNO = [NO]");
         RPT_TAHSILAT_LISTESI.DataBind();
     }
 }
Beispiel #15
0
    protected void RPT_GECİKEN_ItemCommand(object sender, RepeaterCommandEventArgs e)
    {
        string[] commandArgs   = e.CommandArgument.ToString().Split(new char[] { ',' });
        string   odemeTarih    = commandArgs[0];
        string   odeyenAdSoyad = commandArgs[1];

        if (e.CommandName == "Tahsilat")
        {
            DataTable Tahsilat = DBIslem.DtGetir("select NO , TARIH, TUTAR , PARA_BIRIMI , AD_SOYAD , GID from TBL_GECICI where TARIH = '" + odemeTarih.ToString() + "' and AD_SOYAD ='" + odeyenAdSoyad.ToString() + "' ");
            Session["tahsilat"] = Tahsilat;
            Response.Redirect("MusteriTahsilat.aspx");
        }
    }
 private void MUSTERI_LISTESI_GETIR()
 {
     if (kullaniciadi == "admin")
     {
         RPT_MUSTERI_LISTE.DataSource = DBIslem.DtGetir("SELECT * FROM TBL_MUSTERI INNER JOIN TBL_KULLANICI on mKULLANICI_ID = kID");
         RPT_MUSTERI_LISTE.DataBind();
     }
     else
     {
         RPT_MUSTERI_LISTE.DataSource = DBIslem.DtGetir("SELECT * FROM TBL_MUSTERI INNER JOIN TBL_KULLANICI on mKULLANICI_ID = kID where mKULLANICI_ID='" + Session["kulid"] + "' order by mID desc");
         RPT_MUSTERI_LISTE.DataBind();
     }
 }
    protected void btnKaydet_Click(object sender, EventArgs e)
    {
        if (!String.IsNullOrEmpty(txtAd.Text) && !String.IsNullOrEmpty(txtSoyad.Text) && !String.IsNullOrEmpty(txtTelefonNo.Text) && ddUlke.SelectedItem.Text != "Seçiniz")
        {
            try
            {
                if (btnKaydet.Text == "Güncelle")
                {
                    DBIslem.DtGetir("UPDATE TBL_MUSTERI SET mAD = '" + txtAd.Text + "', mSOYAD = '" + txtSoyad.Text + "', mMAIL = '" + txtEmail.Text + "', mTELEFON = '" + txtTelefonNo.Text + "', mULKE = '" + ddUlke.SelectedItem.Text.ToString() + "', mNOT = '" + txtNot.Text + "' WHERE mID='" + Request.QueryString["mID"] + "'");
                    //Txt Boşalt
                    //TXT_BOSALT();

                    //Sayfa Yenile
                    //MUSTERI_LISTESI_GETIR();
                }
                if (btnKaydet.Text == "Kaydet")
                {
                    if (DBIslem.DtMusteriVarmi(txtAd.Text, txtSoyad.Text))
                    {
//Kayıt Yap
                        DBIslem.DtGetir("INSERT INTO TBL_MUSTERI (mAD,mSOYAD,mMAIL,mTELEFON,mULKE,mNOT,mKULLANICI_ID) VALUES ('" + txtAd.Text + "','" + txtSoyad.Text + "','" + txtEmail.Text + "','" + txtTelefonNo.Text + "','" + ddUlke.SelectedItem.Text.ToString() + "','" + txtNot.Text + "','" + Session["kulid"] + "')");

                        //Txt Boşalt
                        TXT_BOSALT();

                        //Sayfa Yenile
                        MUSTERI_LISTESI_GETIR();

                        //son kaydı getir
                        DataTable dt = DBIslem.DtGetir("SELECT * FROM TBL_MUSTERI ORDER BY mID DESC");
                        string    id = dt.Rows[0]["mID"].ToString();

                        //Müşteri Görüşmeye Git
                        Response.Redirect("musteriGorusme.aspx?mID=" + id);
                    }
                    else
                    {
                        lblHata.Text = "Aynı bilgilerde bir müşteri zaten bulunuyor.";
                    }
                }
            }
            catch (Exception)
            {
                throw;
            }
        }
    }
    protected void RPT_SATIS_GUNCELLEME_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        string[] commandArgs = e.CommandArgument.ToString().Split(new char[] { ',' });
        int      mID         = Convert.ToInt32(commandArgs[0]);
        string   mSOYAD      = commandArgs[1];
        int      gID         = Convert.ToInt32(commandArgs[2]);
        int      sID         = Convert.ToInt32(commandArgs[3]);

        if (e.CommandName.Equals("TemsilciGuncelle"))
        {
            if (Convert.ToInt32(DDL_Satisci.SelectedValue) != 0)
            {
                DBIslem.DtGetir("UPDATE TBL_MUSTERI set mKULLANICI_ID = " + Convert.ToInt32(DDL_Satisci.SelectedItem.Value) + " WHERE mID =  " + mID + " ");
                DBIslem.DtGetir("UPDATE TBL_GORUSME set gKULLANICI_ID = " + Convert.ToInt32(DDL_Satisci.SelectedItem.Value) + "WHERE gID = " + gID + " ");
                DBIslem.DtGetir("UPDATE TBL_SOZLESME set sKULID = " + Convert.ToInt32(DDL_Satisci.SelectedItem.Value) + "WHERE sID =" + sID + " ");
                Response.Redirect("musteriKayit.aspx");
            }
        }
    }
Beispiel #19
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["kullanici"] != null)
        {
            kullaniciadi = Session["kullanici"].ToString();
            //Response.Write("Hoşgeldin " + Session["kullanici"]);
            MUSTERI_LISTESI_GETIR();
            GECIKEN_ODEME_LISTELE();
            ODEME_LISTELE();
            TAHSILAT_LISTELE();

            //
            if (Convert.ToInt32(Session["kulid"]) == 12 || Convert.ToInt32(Session["kulid"]) == 16)
            {
                dtgorusme = DBIslem.DtGetir("SELECT * FROM TBL_GORUSME");

                //
                dtsatis = DBIslem.DtGetir("SELECT * FROM TBL_SOZLESME");

                //
                dtmusteri = DBIslem.DtGetir("SELECT * FROM TBL_MUSTERI");
            }
            if (Convert.ToInt32(Session["kulid"]) != 12 && Convert.ToInt32(Session["kulid"]) != 16)
            {
                dtgorusme = DBIslem.DtGetir("SELECT * FROM TBL_GORUSME  where gKULLANICI_ID='" + Session["kulid"] + "'");

                //
                dtsatis = DBIslem.DtGetir("SELECT * FROM TBL_SOZLESME where sKULID='" + Session["kulid"] + "'");

                //
                dtmusteri = DBIslem.DtGetir("SELECT * FROM TBL_MUSTERI where mKULLANICI_ID='" + Session["kulid"] + "'");
            }

            lblGorusmeToplam.Text = dtgorusme.Rows.Count.ToString();
            lblSatisToplam.Text   = dtsatis.Rows.Count.ToString();
            lblMusteriToplam.Text = dtmusteri.Rows.Count.ToString();
        }
        else
        {
            Response.Redirect("girisYap.aspx");
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Convert.ToInt32(Session["kulid"]).Equals(12))
        {
            Response.Redirect("Default.aspx");
        }
        else
        {
            RPT_SATIS_GUNCELLEME.DataSource = DBIslem.DtGetir("select * FROM TBL_MUSTERI LEFT JOIN TBL_GORUSME on TBL_MUSTERI.mID = TBL_GORUSME.gMUSTERI_ID left outer JOIN TBL_SOZLESME s on s.gID = TBL_GORUSME.gID  left OUTER join TBL_KULLANICI on TBL_MUSTERI.mKULLANICI_ID = TBL_KULLANICI.kID where mID = " + Convert.ToInt32(Session["MusteriDegisimID"]) + " ");
            RPT_SATIS_GUNCELLEME.DataBind();

            if (!IsPostBack)
            {
                DDL_Satisci.DataSource     = DBIslem.DtGetir("select kKULLANICIADI,kID from TBL_KULLANICI");
                DDL_Satisci.DataTextField  = "kKULLANICIADI";
                DDL_Satisci.DataValueField = "kID";
                DDL_Satisci.DataBind();
            }
        }
    }
    protected void RPT_MUSTERI_LISTE_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        DataTable dt = DBIslem.DtGetir("SELECT * FROM View_Satis WHERE mID = " + e.CommandArgument + " ");
        int       s  = dt.Rows.Count;

        if (e.CommandName.Equals("MusteriSil"))
        {
            Session["MusteriSilme"] = DBIslem.DtGetir("select mAD + ' ' + mSOYAD AS AdSoyad , mMAIL , mTELEFON , mULKE , gMESKEN_ID  from TBL_MUSTERI LEFT JOIN TBL_GORUSME on TBL_MUSTERI.mID = TBL_GORUSME.gMUSTERI_ID WHERE mID = " + e.CommandArgument + " ");
            Session["MusteriID"]    = e.CommandArgument;
            Response.Redirect("MusteriSil.aspx");
        }
        if (e.CommandName.Equals("TemsilciDegis"))
        {
            int mID = Convert.ToInt32(e.CommandArgument);

            Session["MusteriDegisimID"] = mID;

            Response.Redirect("SatisTemsilciDegisim.aspx");
        }
    }
Beispiel #22
0
    protected void btnMusteriSil_Click(object sender, EventArgs e)
    {
        if (DBIslem.DtGetir("SELECT * FROM View_Satis WHERE mID = " + Session["MusteriID"] + " ").Rows.Count != 0)
        {
            lblHataMesaji.Text = "Bu müşterinin mevcut bir sözleşmesi bulunmaktadır.";
            return;
        }
        else
        {
            DBIslem.DtGetir("DELETE FROM TBL_MUSTERI WHERE mID = " + Session["MusteriID"] + " ");

            if (!String.IsNullOrEmpty(txtDaire.Text))
            {
                DBIslem.DtGetir("DELETE FROM TBL_GORUSME WHERE gMUSTERI_ID = " + Session["MusteriID"] + " and gMESKEN_ID = '" + txtDaire.Text + "' ");
                DBIslem.DtGetir("UPDATE TBL_FIYAT_LISTE SET fDURUM = 0 where fTIP =  '" + txtDaire.Text + "' ");
            }
            Session.Remove("MusteriID");
            Response.Redirect("musteriKayit.aspx");
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["kullanici"] != null)
        {
            if (Session["kulid"] != null && (Convert.ToInt32(Session["kulid"]) == 12 || Convert.ToInt32(Session["kulid"]) == 16))
            {
                RPT_BORCLISTE.DataSource = DBIslem.DtGetir("SELECT gKULLANICI_ID ,gecici.AD_SOYAD , gecici.TUTAR , gecici.TARIH , gecici.PARA_BIRIMI , Convert(varchar(100),DATEDIFF(DAY,GETDATE(),Convert(datetime2,TARIH))) as KALAN_GUN FROM TBL_GECICI gecici      inner join TBL_GORUSME g    ON gecici.GID = g.gID inner join TBL_MUSTERI m    on g.gMUSTERI_ID = m.mID where gecici.IsActive = 0   order by DATEDIFF(DAY, GETDATE(), Convert(datetime2, TARIH))");
                RPT_BORCLISTE.DataBind();
            }
            if (Convert.ToInt32(Session["kulid"]) != 12 && Convert.ToInt32(Session["kulid"]) != 16)
            {
                RPT_BORCLISTE.DataSource = DBIslem.DtGetir("SELECT gKULLANICI_ID ,gecici.AD_SOYAD , gecici.TUTAR , gecici.TARIH , gecici.PARA_BIRIMI , Convert(varchar(100),DATEDIFF(DAY,GETDATE(),Convert(datetime2,TARIH))) as KALAN_GUN FROM TBL_GECICI gecici      inner join TBL_GORUSME g    ON gecici.GID = g.gID inner join TBL_MUSTERI m    on g.gMUSTERI_ID = m.mID where gecici.IsActive = 0 and gKULLANICI_ID = " + Convert.ToInt32(Session["kulid"]) + "  order by DATEDIFF(DAY, GETDATE(), Convert(datetime2, TARIH))");
                RPT_BORCLISTE.DataBind();
            }
        }

        else
        {
            Response.Redirect("girisYap.aspx");
        }
    }
Beispiel #24
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (Session["kullanici"] != null)
     {
         kullaniciadi = Session["kullanici"].ToString();
         //
         if (kullaniciadi == "admin")
         {
             RPT_KULLANICI_BILGI.DataSource = DBIslem.DtGetir("select * from TBL_KULLANICI");
             RPT_KULLANICI_BILGI.DataBind();
         }
         else
         {
             RPT_KULLANICI_BILGI.DataSource = DBIslem.DtGetir("select * from TBL_KULLANICI where kID = " + Session["kulid"] + " ");
             RPT_KULLANICI_BILGI.DataBind();
         }
     }
     else
     {
         Response.Redirect("girisYap.aspx");
     }
 }
    protected void RPT_TIME_SHEET_ItemDataBound(object sender, RepeaterItemEventArgs e)
    {
        string    alinacakNot   = "";
        int       alinacakID    = 0;
        string    alinacakTime  = "";
        string    alinacakTarih = CL_TAKVIM.SelectedDate.ToShortDateString();
        string    time          = (e.Item.FindControl("lblTime") as Label).Text;
        DataTable dt            = DBIslem.DtGetir("select ID , Time from TBL_TIMESHEET where Time = '" + time + "'");

        foreach (DataRow item in dt.Rows)
        {
            alinacakID   = Convert.ToInt32(item[0]);
            alinacakTime = item[1].ToString();
        }
        dt = DBIslem.DtGetir("Select Tarih , Note From TBL_CALENDER where TimeSheetID = " + alinacakID + " and Tarih = '" + alinacakTarih + "' and userID = " + Convert.ToInt32(Session["kulid"]) + " ");
        foreach (DataRow item in dt.Rows)
        {
            alinacakTarih = item[0].ToString();
            alinacakNot   = item[1].ToString();
        }
        if (dt.Rows.Count != 0)
        {
            if (CL_TAKVIM.SelectedDate.Date.ToShortDateString() == alinacakTarih && time == alinacakTime.ToString())
            {
                ((TextBox)e.Item.FindControl("areaNot")).Text       = alinacakNot;
                (e.Item.FindControl("areaNot") as TextBox).ReadOnly = true;
            }
        }

        else
        {
            ((TextBox)e.Item.FindControl("areaNot")).Text       = "";
            (e.Item.FindControl("areaNot") as TextBox).ReadOnly = false;
        }
        string newtime = (e.Item.FindControl("lblTime") as Label).Text.Substring(0, (e.Item.FindControl("lblTime") as Label).Text.Length - 3);

        (e.Item.FindControl("lblTime") as Label).Text = newtime;
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        lblHata.Text = "";
        if (Convert.ToInt32(Session["kulid"]) == 16)
        {
            Response.Redirect("Default.aspx");
        }
        if (Session["kullanici"] != null)
        {
            //
            kullaniciadi = Session["kullanici"].ToString();
            MUSTERI_LISTESI_GETIR();
            //

            if (Request.QueryString["mID"] != null)
            {
                if (!Page.IsPostBack)
                {
                    btnKaydet.Text = "Güncelle";
                    DataTable dt = DBIslem.DtGetir("select * from TBL_MUSTERI where mID='" + Request.QueryString["mID"] + "'");
                    txtAd.Text           = dt.Rows[0]["mAD"].ToString();
                    txtSoyad.Text        = dt.Rows[0]["mSOYAD"].ToString();
                    txtEmail.Text        = dt.Rows[0]["mMAIL"].ToString();
                    txtTelefonNo.Text    = dt.Rows[0]["mTELEFON"].ToString();
                    ddUlke.SelectedValue = dt.Rows[0]["mULKE"].ToString();
                    txtNot.Text          = dt.Rows[0]["mNOT"].ToString();
                }
            }
            else
            {
                btnKaydet.Text = "Kaydet";
            }
        }
        else
        {
            Response.Redirect("girisYap.aspx");
        }
    }
    protected void RPT_SOZLESME_LISTE_ItemCommand(object source, RepeaterCommandEventArgs e)
    {
        string[] commandArgs = e.CommandArgument.ToString().Split(new char[] { ',' });
        string   sID         = commandArgs[0];
        string   gID         = commandArgs[1];

        if (e.CommandName == "sSilme")
        {
            //Response.Redirect("musteriSozlesmeListesi.aspx");
            Session["sID"] = sID;
            Session["gID"] = gID;


            Session["Silme"] = DBIslem.DtGetir("SELECT sSOZLESME_TARIH , sTAKSIT_SAYISI , mAD , mSOYAD , gTEKLIF_UCRET , gTEKLIF_PARA_BIRIMI , fTIP  FROM View_Satis WHERE sID = " + sID + " ");
            Response.Redirect("MusteriSozlesmeSil.aspx");
        }
        if (e.CommandName == "sDuzenle")
        {
            Session["sID"] = sID;
            Session["gID"] = gID;
            Response.Redirect("SozlesmeDuzenle.aspx");
        }
    }
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            CL_TAKVIM.SelectedDate = DateTime.Today.Date;


            if (Convert.ToInt32(Session["kulid"]) == 12)
            {
                RPT_TIME_SHEET.DataBind();
                RPT_NOTLISTESI.DataSource = DBIslem.DtGetir("select * FROM TBL_CALENDER c LEFT JOIN TBL_TIMESHEET ts ON c.TimeSheetID = ts.ID  LEFT JOIN TBL_KULLANICI k on k.kID = c.userID ");
                RPT_NOTLISTESI.DataBind();
            }
            else
            {
                RPT_TIME_SHEET.DataSource = DBIslem.DtGetir("SELECT Time From TBL_TIMESHEET");
                RPT_TIME_SHEET.DataBind();
            }
        }


        CL_TAKVIM.SelectedDayStyle.BackColor = System.Drawing.Color.Olive; // Seçilen
        CL_TAKVIM.DataBind();
    }
Beispiel #29
0
    public string NotuCek(string AdSoyad)
    {
        string not = DBIslem.DtGetir("SELECT gNOT FROM View_GorusmeListesi where gKULLANICI_ID='" + Session["kulid"] + "'").ToString();

        return(not);
    }