示例#1
0
    protected void btnEkle_Click(object sender, EventArgs e)
    {
        EFDal ed = new EFDal();
        int BolgeKodu = ed.kal_BolgeKoduDon(Context.User.Identity.Name);
        int SiradakiFirmaId = ed.FirmaIdMaxDon() + 1;
        sfKalDataEntities KalData=new sfKalDataEntities();
        firma oFirma = new firma();
        oFirma.MUSTNO = int.Parse(txtMustNo.Text.Trim());
        oFirma.FIRMAADI = txtFirmaAdi.Text.Trim();
        oFirma.ADRESI = txtAdres1.Text.Trim();
        oFirma.ADRESII = txtAdres2.Text.Trim();
        oFirma.IL_ILCE = txtIlce.Text.Trim();
        oFirma.TELEFON = txtTelefon.Text.Trim();
        oFirma.FAX = txtFax.Text.Trim();
        oFirma.ILGILI = txtIlgili.Text.Trim();
        oFirma.EMAIL = txtEmail.Text.Trim();
        oFirma.NOTLAR = txtNotlar.Text.Trim();
        oFirma.FATADRES = txtFatAdresi.Text.Trim();
        oFirma.VERGIDAIRESI = txtVergiDairesi.Text.Trim();
        oFirma.VERGINO = txtVergiNo.Text.Trim();
        oFirma.BOLGEKODU = (short)BolgeKodu;
        oFirma.KAMUFIRMASI = chkKamufirması.Checked;
        oFirma.TSEBELGELI = chkTseBelgeli.Checked;
        KalData.AddTofirma(oFirma);

        firmaChild ofirmaChild = new firmaChild();
        ofirmaChild.AnneFirmaFirmaId = int.Parse(Session["ChildFirmaIcingidecekFirmaId"].ToString());
        ofirmaChild.ChildFirmaId = SiradakiFirmaId;
        KalData.AddTofirmaChild(ofirmaChild);
        KalData.SaveChanges();
    }
 /// <summary>
 /// Deprecated Method for adding a new object to the firma EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTofirma(firma firma)
 {
     base.AddObject("firma", firma);
 }
 /// <summary>
 /// Create a new firma object.
 /// </summary>
 /// <param name="fIRMAID">Initial value of the FIRMAID property.</param>
 /// <param name="mUSTNO">Initial value of the MUSTNO property.</param>
 /// <param name="bOLGEKODU">Initial value of the BOLGEKODU property.</param>
 /// <param name="kAMUFIRMASI">Initial value of the KAMUFIRMASI property.</param>
 /// <param name="tSEBELGELI">Initial value of the TSEBELGELI property.</param>
 /// <param name="sILINDI">Initial value of the SILINDI property.</param>
 /// <param name="iL_ILCEID">Initial value of the IL_ILCEID property.</param>
 public static firma Createfirma(global::System.Int32 fIRMAID, global::System.Int32 mUSTNO, global::System.Int16 bOLGEKODU, global::System.Boolean kAMUFIRMASI, global::System.Boolean tSEBELGELI, global::System.Boolean sILINDI, global::System.Int32 iL_ILCEID)
 {
     firma firma = new firma();
     firma.FIRMAID = fIRMAID;
     firma.MUSTNO = mUSTNO;
     firma.BOLGEKODU = bOLGEKODU;
     firma.KAMUFIRMASI = kAMUFIRMASI;
     firma.TSEBELGELI = tSEBELGELI;
     firma.SILINDI = sILINDI;
     firma.IL_ILCEID = iL_ILCEID;
     return firma;
 }