Exemple #1
0
        protected override void DoJob()
        {
            OCompanyUtil.CheckDuplicateCompany(Obj, OpConn);

            //Firma kayıt
            string query = string.Format("INSERT INTO Company (CompanyName, Status, Explanation) VALUES ('{0}',{1},'{2}');",
                                         Obj.NewCompanyName, Obj.StatusId, Obj.Explanation);

            BaseRepo.BsExecute(query);
            int companyId = (int)OpConn.LastInsertRowId;

            //Adres ve Telefon kayıtları
            OCompanyUtil.SaveAddressAndTel(Obj, OpConn, companyId);
        }
Exemple #2
0
        protected override void DoJob()
        {
            OCompanyUtil.CheckDuplicateCompany(Obj, OpConn);

            string query = "UPDATE Company SET CompanyName = @CompanyName, Status = @Status, Explanation = @Explanation " +
                           "WHERE CompanyId = @CompanyId";

            BaseRepo.BsExecute(query, new { Obj.CompanyName, Status = Obj.StatusId, Obj.Explanation, Obj.CompanyId });

            //Adresleri sil
            query = string.Format("DELETE FROM Address WHERE CompanyId = {0}", Obj.CompanyId);
            BaseRepo.BsExecute(query);

            //Telefonları sil
            query = string.Format("DELETE FROM Telephone WHERE CompanyId = {0}", Obj.CompanyId);
            BaseRepo.BsExecute(query);

            //Adres ve Telefon kayıtları
            OCompanyUtil.SaveAddressAndTel(Obj, OpConn, Obj.CompanyId);
        }